← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11217: Fixed bug, added missing struts action for adding maps to dashboard

 

------------------------------------------------------------
revno: 11217
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-06-17 13:19:14 +0200
message:
  Fixed bug, added missing struts action for adding maps to dashboard
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.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 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java	2012-11-06 07:01:56 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddMapViewToDashboardAction.java	2013-06-17 11:19:14 +0000
@@ -35,12 +35,12 @@
 import org.hisp.dhis.mapping.MappingService;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
+import org.springframework.beans.factory.annotation.Autowired;
 
 import com.opensymphony.xwork2.Action;
 
 /**
  * @author Lars Helge Overland
- * @version $Id$
  */
 public class AddMapViewToDashboardAction
     implements Action
@@ -51,27 +51,15 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
+    @Autowired
     private CurrentUserService currentUserService;
 
-    public void setCurrentUserService( CurrentUserService currentUserService )
-    {
-        this.currentUserService = currentUserService;
-    }
-
+    @Autowired
     private DashboardService dashboardService;
 
-    public void setDashboardService( DashboardService dashboardService )
-    {
-        this.dashboardService = dashboardService;
-    }
-    
+    @Autowired
     private MappingService mappingService;
 
-    public void setMappingService( MappingService mappingService )
-    {
-        this.mappingService = mappingService;
-    }
-
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml	2013-06-09 19:12:02 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/META-INF/dhis/beans.xml	2013-06-17 11:19:14 +0000
@@ -18,6 +18,12 @@
         <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
     </bean>
 
+    <!-- Dashboard -->
+    
+    <bean id="org.hisp.dhis.mapping.action.AddMapViewToDashboardAction"
+        class="org.hisp.dhis.mapping.action.AddMapViewToDashboardAction"
+        scope="prototype"/>
+
 	<!-- OrganisationUnit -->
 
 	<bean id="org.hisp.dhis.mapping.action.GetOrganisationUnitChildrenAction"
@@ -61,7 +67,7 @@
         class="org.hisp.dhis.mapping.action.GetInfrastructuralDataElementMapValuesAction" scope="prototype">
     </bean>
 
-<!-- Period -->
+    <!-- Period -->
 
 	<bean id="org.hisp.dhis.mapping.action.GetAllPeriodTypesAction"
 		class="org.hisp.dhis.mapping.action.GetAllPeriodTypesAction" scope="prototype">

=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2013-05-24 14:04:12 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml	2013-06-17 11:19:14 +0000
@@ -15,6 +15,12 @@
       <result name="success" type="redirect">app/index.html</result>
     </action>
 	
+	<!-- Dashboard -->
+	
+	<action name="addMapViewToDashboard" class="org.hisp.dhis.mapping.action.AddMapViewToDashboardAction">
+	  <result name="success" type="velocity-json">/dhis-web-mapping/void.vm</result>
+	</action>
+	
     <!-- Security -->
 	  
     <action name="deleteMapLegendSet" class="org.hisp.dhis.mapping.action.NoAction">