← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 483: (GIS) PDF print module added.

 

------------------------------------------------------------
revno: 483
committer: Jan Henrik Overland janhenrik.overland@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-08-20 20:53:51 +0200
message:
  (GIS) PDF print module added.
added:
  gis/dhis-web-mapping/src/main/webapp/config.yaml
modified:
  gis/dhis-web-mapping/src/main/resources/xwork.xml
  gis/dhis-web-mapping/src/main/webapp/WEB-INF/web.xml


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription.
=== modified file 'gis/dhis-web-mapping/src/main/resources/xwork.xml'
--- gis/dhis-web-mapping/src/main/resources/xwork.xml	2009-07-13 20:00:15 +0000
+++ gis/dhis-web-mapping/src/main/resources/xwork.xml	2009-08-20 18:53:51 +0000
@@ -56,7 +56,6 @@
 	<action name="getMapSourceTypeUserSetting" class="org.hisp.dhis.mapping.action.GetMapSourceTypeUserSettingAction">
       <result name="success" type="velocity-json">/dhis-web-mapping/jsonUserSetting.vm</result>
     </action>   	  
-	  
     
     <!-- MapOrganisationUnitRelations -->
     
@@ -119,6 +118,20 @@
     <action name="addMapViewToDashboard" class="org.hisp.dhis.mapping.action.AddMapViewToDashboardAction">
       <result name="success" type="velocity-json">/dhis-web-mapping/void.vm</result>
     </action>
+	  
+	<!-- MapLayer -->
+	  
+	<action name="addOrUpdateMapLayer" class="org.hisp.dhis.mapping.action.AddOrUpdateMapLayerAction">
+      <result name="success" type="velocity-json">/dhis-web-mapping/void.vm</result>
+    </action>
+	  
+	<action name="deleteMapLayer" class="org.hisp.dhis.mapping.action.DeleteMapLayerAction">
+      <result name="success" type="velocity-json">/dhis-web-mapping/void.vm</result>
+    </action>
+	  
+	<action name="getAllMapLayers" class="org.hisp.dhis.mapping.action.GetAllMapLayersAction">
+      <result name="success" type="velocity-json">/dhis-web-mapping/jsonMapLayers.vm</result>
+    </action>
         
     <!-- Indicator -->
     

=== modified file 'gis/dhis-web-mapping/src/main/webapp/WEB-INF/web.xml'
--- gis/dhis-web-mapping/src/main/webapp/WEB-INF/web.xml	2009-06-10 22:25:07 +0000
+++ gis/dhis-web-mapping/src/main/webapp/WEB-INF/web.xml	2009-08-20 18:53:51 +0000
@@ -61,4 +61,18 @@
   <listener>
     <listener-class>org.hisp.dhis.system.startup.StartupListener</listener-class>
   </listener>
+	
+  <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>config.yaml</param-value>
+    </init-param>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>mapfish.print</servlet-name>
+    <url-pattern>/pdf/*</url-pattern>
+  </servlet-mapping>
+	
 </web-app>

=== added file 'gis/dhis-web-mapping/src/main/webapp/config.yaml'
--- gis/dhis-web-mapping/src/main/webapp/config.yaml	1970-01-01 00:00:00 +0000
+++ gis/dhis-web-mapping/src/main/webapp/config.yaml	2009-08-20 18:53:51 +0000
@@ -0,0 +1,160 @@
+#===========================================================================
+# allowed DPIs
+#===========================================================================
+dpis: [254, 190, 127, 56]
+
+#===========================================================================
+# the allowed scales
+#===========================================================================
+scales:
+  - 25000
+  - 50000
+  - 100000
+  - 200000
+  - 500000
+  - 1000000
+  - 2000000
+  - 4000000
+
+#===========================================================================
+# the list of allowed hosts
+#===========================================================================
+hosts:
+  - !localMatch
+    dummy: true
+  - !ipMatch
+    ip: www.camptocamp.org
+  - !dnsMatch
+    host: labs.metacarta.com
+    port: 80
+  - !dnsMatch
+    host: terraservice.net
+    port: 80
+
+layouts:
+  #===========================================================================
+  A4 portrait:
+  #===========================================================================
+    metaData:
+      title: '${title}'
+      author: 'MapFish print module'
+      subject: 'Simple layout'
+      keywords: 'map,print'
+      creator: 'MapFish'
+
+    titlePage:
+      pageSize: A4
+      items:
+        - !text
+          spacingAfter: 150
+        - !text
+          font: Helvetica
+          fontSize: 40
+          spacingAfter: 100
+          align: center
+          text: '${title}'
+        - !image
+          maxWidth: 160
+          maxHeight: 160
+          spacingAfter: 100
+          align: center
+          url: http://trac.mapfish.org/trac/mapfish/attachment/ticket/3/logo_v8_sphere.svg?format=raw
+        - !text
+          font: Helvetica
+          fontSize: 14
+          align: left
+          text: |
+            Two layers are asked by the client:
+            - a base layer from Metacarta
+            - a transparent layer from Camptocamp.org (routes)
+            .
+            Some text is added over the map, just to demonstrate the absolute positionning.
+      footer: &commonFooter
+        height: 30
+        items:
+          - !columns
+            config:
+              cells:
+                - paddingBottom: 5   
+            items:
+              - !text
+                backgroundColor: #FF0000
+                align: left
+                text: ©Camptocamp SA
+              - !text
+                align: right
+                text: 'Page ${pageNum}'
+
+    #-------------------------------------------------------------------------
+    mainPage:
+      pageSize: A4
+      rotation: true
+      header:
+        height: 50
+        items:
+          - !text
+            font: Helvetica
+            fontSize: 30
+            align: right
+            text: '${mapTitle}'
+      items:
+        - !map
+          spacingAfter: 30
+          width: 440
+          height: 483
+        - !columns
+          # columns can have an absolute position. In that case, they need the 3 following fields:
+          absoluteX: 410
+          absoluteY: 310
+          width: 100
+          items:
+            - !scalebar
+              type: bar
+              maxSize: 100
+              barBgColor: white
+              fontSize: 8
+              align: right
+        - !text
+          text: '${comment}'
+          spacingAfter: 30
+        - !attributes
+          source: data
+          spacingAfter: 30
+          columnDefs:
+            id:
+              columnWeight: 2
+              header: !text
+                text: ID
+                backgroundColor: #A0A0A0
+              cell: !text
+                text: '${id}'
+            name:
+              columnWeight: 5
+              header: !text
+                text: Name
+                backgroundColor: #A0A0A0
+              cell: !columns
+                config:
+                  cells:
+                    - backgroundColor: '${nameBackgroundColor}'
+                      borderWidth: 1
+                      borderColor: '${nameBorderColor}'
+                items:
+                  - !text
+                    text: '${name}'
+            icon:
+              columnWeight: 2
+              header: !text
+                text: Symbol
+                backgroundColor: #A0A0A0
+              cell: !image
+                align: center
+                maxWidth: 15
+                maxHeight: 15
+                url: 'http://www.mapfish.org/svn/mapfish/trunk/MapFish/client/mfbase/mapfish/img/${icon}.png'
+        - !text
+          font: Helvetica
+          fontSize: 9
+          align: right
+          text: '1:${scale} ${now MM.dd.yyyy}'
+      footer: *commonFooter
\ No newline at end of file