Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing files for printing #2762

Merged
merged 1 commit into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions web/src/main/resources/applicationContext.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"

xmlns:cxf="http://cxf.apache.org/core"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"

xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"
default-autowire="byName">

<context:annotation-config />

<bean id="mapPrinter" class="org.mapfish.print.MapPrinter" scope="prototype"></bean>
<bean id="configFactory" class="org.mapfish.print.config.ConfigFactory"></bean>

<bean id="geostoreInitializer" class="it.geosolutions.geostore.init.GeoStoreInit" lazy-init="false">
<!-- Site specific initialization. Please specify a path in the ovr file-->
<!--<property name="userListInitFile"><null/></property>-->
<property name="userListInitFile" value="classpath:sample_users.xml"/>
<!-- Site specific initialization. Please specify a path in the ovr file-->
<property name="categoryListInitFile" value="classpath:sample_categories.xml" />

<!-- Site specific initialization. Please specify a path in the ovr file-->
<property name="userGroupListInitFile" value="classpath:sample_groups.xml" />
<!-- The default password encoder -->
<property name="passwordEncoder" ref="${passwordEncoderUsed}"></property>


</bean>

<!-- Define MapReaderFactories -->
<bean id="mapReaderFactoryFinder" class="org.mapfish.print.map.readers.MapReaderFactoryFinder"/>
<bean id="wms-MapReaderFactory" class="org.mapfish.print.map.readers.WMSMapReader$Factory"/>
<bean id="mapServer-MapReaderFactory" class="org.mapfish.print.map.readers.MapServerMapReader$Factory"/>
<bean id="tileCache-MapReaderFactory" class="org.mapfish.print.map.readers.TileCacheMapReader$Factory"/>
<bean id="osm-MapReaderFactory" class="org.mapfish.print.map.readers.OsmMapReader$Factory"/>
<bean id="xyz-MapReaderFactory" class="org.mapfish.print.map.readers.XyzMapReader$Factory"/>
<bean id="tms-MapReaderFactory" class="org.mapfish.print.map.readers.TmsMapReader$Factory"/>
<bean id="vector-MapReaderFactory" class="org.mapfish.print.map.readers.VectorMapReader$Factory"/>
<bean id="image-MapReaderFactory" class="org.mapfish.print.map.readers.ImageMapReader$Factory"/>
<bean id="tiledGoogle-MapReaderFactory" class="org.mapfish.print.map.readers.google.GoogleMapTileReader$Factory"/>
<bean id="google-MapReaderFactory" class="org.mapfish.print.map.readers.google.GoogleMapReader$Factory"/>
<bean id="kaMapCache-ReaderFactory" class="org.mapfish.print.map.readers.KaMapCacheMapReader$Factory"/>
<bean id="kaMap-ReaderFactory" class="org.mapfish.print.map.readers.KaMapMapReader$Factory"/>
<bean id="wmts-ReaderFactory" class="org.mapfish.print.map.readers.WMTSMapReader$Factory"/>

<!-- Define output factories -->
<bean id="outputFactory" class="org.mapfish.print.output.OutputFactory">
<property name="formatFactories">
<list>
<!-- Uncomment to use image magick for image output -->
<!-- <ref bean="imageMagickOutput" /> -->
<ref bean="fileCachingJaiMosaicOutputFactory" />
<ref bean="inMemoryJaiMosaicOutputFactory" />
<ref bean="pdfOutputFactory" />
</list>
</property>
</bean>
<bean id="imageMagickOutput" class="org.mapfish.print.output.NativeProcessOutputFactory">
<!-- the path and command of the process to use for converting the pdf to another format.
The normal configuration is for imagemagick -->
<property name="cmd">
<value>/usr/local/convert</value>
</property>
<!-- The arguments to use when running an imagemagick process -->
<property name="cmdArgs">
<list>
<value>-density</value>
<value>@@dpi@@</value>
<value>-append</value>
<value>@@sourceFile@@</value>
<value>@@targetFile@@</value>
</list>
</property>
<!-- Formats supported by the converter -->
<property name="formats">
<list>
<value>jpg</value>
<value>png</value>
<value>tif</value>
<value>tiff</value>
<value>gif</value>
<value>bmp</value>
</list>
</property>
<!-- The number of concurrent processes to run. Extra processes will wait their turn -->
<constructor-arg>
<value>10</value>
</constructor-arg>
<!-- the length of time to wait for a process to be available before giving up -->
<property name="timeoutSeconds">
<value>30</value>
</property>
</bean>
<bean id="fileCachingJaiMosaicOutputFactory" class="org.mapfish.print.output.FileCachingJaiMosaicOutputFactory"/>
<bean id="inMemoryJaiMosaicOutputFactory" class="org.mapfish.print.output.InMemoryJaiMosaicOutputFactory"/>
<bean id="pdfOutputFactory" class="org.mapfish.print.output.PdfOutputFactory"/>
</beans>
14 changes: 14 additions & 0 deletions web/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@
<url-pattern>/proxy/*</url-pattern>
</servlet-mapping>

<!-- Printing Servlet -->
<servlet>
<servlet-name>mapfish.print</servlet-name>
<servlet-class>org.mapfish.print.servlet.MapPrinterServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>printing/config.yaml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>mapfish.print</servlet-name>
<url-pattern>/pdf/*</url-pattern>
</servlet-mapping>

<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
Expand Down