Opened 15 years ago

Last modified 14 years ago

#5 closed enhancement

Print service and server-side requirements — at Version 4

Reported by: yvesm Owned by: sguillemette
Priority: major Milestone: First milestone
Component: server Version: 0.7
Keywords: Cc:

Description (last modified by yvesm)

Implement theMapFish print server. Here's what needs to be done.

  • Server-side requirements
  • Install Maven (http://maven.apache.org/download.html)
  • Put install path (on windows : C:\Program Files\apache-maven-2.2.0\bin) on the system path
  • Test on a commandline : ' mvn -version'
  • Create the war file based on directory .../geoprisma/trunk/lib/externals/mapfish-print/print-servlet
  • At the prompt type : 'mvn clean install'
  • Deploy the war file in a Tomcat container
  • Apache conf
  • In the GeoPrisma Apache conf, create a reverse proxy to direct requests to the print server, e.g.;
    	LoadModule proxy_module modules/mod_proxy.so
    	LoadModule proxy_connect_module modules/mod_proxy_connect.so
    	LoadModule proxy_http_module modules/mod_proxy_http.so
    	LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
    
    	ProxyRequests Off
    	<Proxy *>
    		Order deny,allow
    		Allow from all
    	</Proxy>
    	ProxyPass /print http://localhost:9998/print-servlet-1.2-SNAPSHOT/pdf
    	ProxyPassReverse /print http://localhost:9998/print-servlet-1.2-SNAPSHOT/pdf
    

  • Add this variable to configure the print server url:
        var printConfigUrl = '/print/info.json'; 
    
  • GeoPrisma service implementation
  • Implement a new service
  • Implement a new 'print proxy' to that service
  • Make sure the print proxy can use proxy classes to resolve service url and to modify the url string contained in the JSON object sent to the print server, e.g.
    	http://localhost:9998/print-servlet-1.2-SNAPSHOT/
    	
    	See baseURL. 
    	{
        layout: 'A4 portrait',
        title: 'A simple example',
        srs: 'EPSG:4326',
        units: 'dd',
        layers: [
            {
                type: 'WMS',
                format: 'image/png',
                layers: ['basic'],
                baseURL: 'http://labs.metacarta.com/wms/vmap0'
            },
            {
                type: 'WMS',
                format: 'image/png',
                layers: ['routes'],
                baseURL: 'http://www.camptocamp.org/cgi-bin/mapserv_c2corg',
                customParams: {TRANSPARENT:true}
            }
        ],
        pages: [
            {
                center: [6, 45.5],
                scale: 4000000,
                dpi: 190,
                mapTitle: "First map",
                comment: "The \"routes\" layer is not shown (the scale is too small)",
                data: [
                    {id:1, name: 'blah', icon: 'icon_pan'},
                    {id:2, name: 'blip', icon: 'icon_zoomin'}
                ]
            },
            {
                center: [6.9, 46.2],
                scale: 500000,
                dpi: 190,
                mapTitle: "Second map",
                comment: "This is a zoomed in version of the first map. Since the scale is more appropriate, we show the \"routes\" layer.",
                data: [
                    {id:1, name: 'blah', icon: 'icon_pan'},
                    {id:2, name: 'blip', icon: 'icon_zoomin'}
                ]
            }
        ]
    }
    

GeoPrisma will replace the url shown above by that of the print proxy and the various GeoPrisma proxy parameters. The print proxy will re-map the url to the one specified in the Apache conf file

Change History (4)

comment:1 by yvesm, 15 years ago

Version: 1.00.7

comment:2 by yvesm, 15 years ago

Component: widgets -- printserver
Description: modified (diff)

comment:3 by yvesm, 15 years ago

Summary: Print widget and servicePrint service

comment:4 by yvesm, 15 years ago

Description: modified (diff)
Summary: Print servicePrint service and server-side requirements
Note: See TracTickets for help on using tickets.