← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14502: Mobile maintenance, fixed tons of wrong spring configuration

 

------------------------------------------------------------
revno: 14502
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-03-28 00:16:43 +0100
message:
  Mobile maintenance, fixed tons of wrong spring configuration
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/caseentry/state/DefaultSelectedStateManager.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.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-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/J2meClientUpdateAction.java	2014-03-27 23:16:43 +0000
@@ -45,13 +45,13 @@
     // Dependencies
     // -------------------------------------------------------------------------
     
-    TrackedEntityMobileSettingService TrackedEntityMobileSettingService;
+    private TrackedEntityMobileSettingService mobileSettingService;
 
-    public void setTrackedEntityMobileSettingService( TrackedEntityMobileSettingService TrackedEntityMobileSettingService )
+    public void setMobileSettingService( TrackedEntityMobileSettingService mobileSettingService )
     {
-        this.TrackedEntityMobileSettingService = TrackedEntityMobileSettingService;
+        this.mobileSettingService = mobileSettingService;
     }
-    
+
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
@@ -70,11 +70,11 @@
         this.autoUpdate = autoUpdate;
     }
     
-    private TrackedEntityMobileSetting TrackedEntityMobileSetting;
+    private TrackedEntityMobileSetting trackedEntityMobileSetting;
 
     public TrackedEntityMobileSetting getTrackedEntityMobileSetting()
     {
-        return TrackedEntityMobileSetting;
+        return trackedEntityMobileSetting;
     }
 
     @Override
@@ -83,31 +83,31 @@
     { 
         List<TrackedEntityMobileSetting> list;
         
-        list = (List<TrackedEntityMobileSetting>) TrackedEntityMobileSettingService.getCurrentSetting();
+        list = (List<TrackedEntityMobileSetting>) mobileSettingService.getCurrentSetting();
         
         if( list.size() == 0 )
         {
-            this.TrackedEntityMobileSetting = new TrackedEntityMobileSetting();
+            trackedEntityMobileSetting = new TrackedEntityMobileSetting();
         }
         else
         {
-            this.TrackedEntityMobileSetting = list.get( 0 );
+            trackedEntityMobileSetting = list.get( 0 );
         }    
         if ( this.version != 0 )
         {
-            this.TrackedEntityMobileSetting.setVersionToUpdate( this.version );
+            trackedEntityMobileSetting.setVersionToUpdate( this.version );
         }
         if ( autoUpdate != null && autoUpdate.equals( "yes" ) )
         {
-            this.TrackedEntityMobileSetting.setAutoUpdateClient( true );
+            trackedEntityMobileSetting.setAutoUpdateClient( true );
         }
         
         if ( autoUpdate != null && autoUpdate.equals( "no" ) )
         {
-            this.TrackedEntityMobileSetting.setAutoUpdateClient( false );
+            trackedEntityMobileSetting.setAutoUpdateClient( false );
         }
-        TrackedEntityMobileSettingService.saveTrackedEntityMobileSetting( this.TrackedEntityMobileSetting );
+        
+        mobileSettingService.saveTrackedEntityMobileSetting( this.trackedEntityMobileSetting );
         return SUCCESS;
     }
-
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/ShowMobileSettingFormAction.java	2014-03-27 23:16:43 +0000
@@ -48,28 +48,18 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private TrackedEntityAttributeService patientAttributeService;
-
-    public TrackedEntityAttributeService getTrackedEntityAttributeService()
-    {
-        return patientAttributeService;
-    }
-
-    public void setTrackedEntityAttributeService( TrackedEntityAttributeService patientAttributeService )
-    {
-        this.patientAttributeService = patientAttributeService;
-    }
-
-    private TrackedEntityMobileSettingService patientMobileSettingService;
-
-    public TrackedEntityMobileSettingService getTrackedEntityMobileSettingService()
-    {
-        return patientMobileSettingService;
-    }
-
-    public void setTrackedEntityMobileSettingService( TrackedEntityMobileSettingService patientMobileSettingService )
-    {
-        this.patientMobileSettingService = patientMobileSettingService;
+    private TrackedEntityAttributeService attributeService;
+
+    public void setAttributeService( TrackedEntityAttributeService attributeService )
+    {
+        this.attributeService = attributeService;
+    }
+
+    private TrackedEntityMobileSettingService mobileSettingService;
+
+    public void setMobileSettingService( TrackedEntityMobileSettingService mobileSettingService )
+    {
+        this.mobileSettingService = mobileSettingService;
     }
 
     // -------------------------------------------------------------------------
@@ -132,10 +122,10 @@
     public String execute()
         throws Exception
     {
-        attributes = patientAttributeService.getAllTrackedEntityAttributes();
+        attributes = attributeService.getAllTrackedEntityAttributes();
         allAttributes = new ArrayList<TrackedEntityAttribute>(attributes);
 
-        Collection<TrackedEntityMobileSetting> paSettings = new HashSet<TrackedEntityMobileSetting>( patientMobileSettingService
+        Collection<TrackedEntityMobileSetting> paSettings = new HashSet<TrackedEntityMobileSetting>( mobileSettingService
             .getCurrentSetting() );
 
         if ( !paSettings.isEmpty() )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java	2014-03-20 15:05:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/action/UpdateMobileSettingAction.java	2014-03-27 23:16:43 +0000
@@ -47,28 +47,18 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private TrackedEntityAttributeService patientAttributeService;
-
-    public TrackedEntityAttributeService getTrackedEntityAttributeService()
-    {
-        return patientAttributeService;
-    }
-
-    public void setTrackedEntityAttributeService( TrackedEntityAttributeService patientAttributeService )
-    {
-        this.patientAttributeService = patientAttributeService;
-    }
-
-    private TrackedEntityMobileSettingService patientMobileSettingService;
-
-    public TrackedEntityMobileSettingService getTrackedEntityMobileSettingService()
-    {
-        return patientMobileSettingService;
-    }
-
-    public void setTrackedEntityMobileSettingService( TrackedEntityMobileSettingService patientMobileSettingService )
-    {
-        this.patientMobileSettingService = patientMobileSettingService;
+    private TrackedEntityAttributeService attributeService;
+
+    public void setAttributeService( TrackedEntityAttributeService attributeService )
+    {
+        this.attributeService = attributeService;
+    }
+
+    private TrackedEntityMobileSettingService mobileSettingService;
+
+    public void setMobileSettingService( TrackedEntityMobileSettingService mobileSettingService )
+    {
+        this.mobileSettingService = mobileSettingService;
     }
 
     // -------------------------------------------------------------------------
@@ -106,13 +96,13 @@
         if ( selectedList.size() > 0 )
         {
             TrackedEntityMobileSetting setting;
-            if ( patientMobileSettingService.getCurrentSetting().size() > 0 )
+            if ( mobileSettingService.getCurrentSetting().size() > 0 )
             {
-                setting = patientMobileSettingService.getCurrentSetting().iterator().next();
+                setting = mobileSettingService.getCurrentSetting().iterator().next();
                 List<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
                 setting.setAttributes( attributes );
                 fillValues( attributes );
-                patientMobileSettingService.updateTrackedEntityMobileSetting( setting );
+                mobileSettingService.updateTrackedEntityMobileSetting( setting );
             }
             else
             {
@@ -120,19 +110,19 @@
                 List<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
                 setting.setAttributes( attributes );
                 fillValues( attributes );
-                patientMobileSettingService.saveTrackedEntityMobileSetting( setting );
+                mobileSettingService.saveTrackedEntityMobileSetting( setting );
             }
         }
         else
         {
             TrackedEntityMobileSetting setting;
-            if ( patientMobileSettingService.getCurrentSetting().size() > 0 )
+            if ( mobileSettingService.getCurrentSetting().size() > 0 )
             {
-                setting = patientMobileSettingService.getCurrentSetting().iterator().next();
+                setting = mobileSettingService.getCurrentSetting().iterator().next();
                 List<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
                 setting.setAttributes( attributes );
                 fillValues( attributes );
-                patientMobileSettingService.updateTrackedEntityMobileSetting( setting );
+                mobileSettingService.updateTrackedEntityMobileSetting( setting );
             }
             else
             {
@@ -140,20 +130,15 @@
                 List<TrackedEntityAttribute> attributes = new ArrayList<TrackedEntityAttribute>();
                 setting.setAttributes( attributes );
                 fillValues( attributes );
-                patientMobileSettingService.saveTrackedEntityMobileSetting( setting );
+                mobileSettingService.saveTrackedEntityMobileSetting( setting );
             }
         }
 
-        Collection<TrackedEntityAttribute> allTrackedEntityAttributes = patientAttributeService.getAllTrackedEntityAttributes();
+        Collection<TrackedEntityAttribute> allTrackedEntityAttributes = attributeService.getAllTrackedEntityAttributes();
 
         for ( TrackedEntityAttribute patientAttribute : allTrackedEntityAttributes )
         {
-//            patientAttribute.setGroupBy( false );
-//            if ( patientAttribute.getId() == groupingAttributeId )
-//            {
-//                patientAttribute.setGroupBy( true );
-//            }
-            patientAttributeService.updateTrackedEntityAttribute( patientAttribute );
+            attributeService.updateTrackedEntityAttribute( patientAttribute );
         }
 
         return SUCCESS;
@@ -167,7 +152,7 @@
     {
         for ( String id : selectedList )
         {
-            attributes.add( patientAttributeService.getTrackedEntityAttribute( Integer.parseInt( id ) ) );
+            attributes.add( attributeService.getTrackedEntityAttribute( Integer.parseInt( id ) ) );
         }
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/caseentry/state/DefaultSelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/caseentry/state/DefaultSelectedStateManager.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/java/org/hisp/dhis/mobile/caseentry/state/DefaultSelectedStateManager.java	2014-03-27 23:16:43 +0000
@@ -76,11 +76,11 @@
         this.selectionManager = selectionManager;
     }
 
-    private TrackedEntityInstanceService patientService;
+    private TrackedEntityInstanceService trackedEntityInstanceService;
 
-    public void setPatientService( TrackedEntityInstanceService patientService )
+    public void setTrackedEntityInstanceService( TrackedEntityInstanceService trackedEntityInstanceService )
     {
-        this.patientService = patientService;
+        this.trackedEntityInstanceService = trackedEntityInstanceService;
     }
 
     private ProgramInstanceService programInstanceService;
@@ -120,7 +120,7 @@
             return null;
         }
 
-        return patientService.getTrackedEntityInstance( id );
+        return trackedEntityInstanceService.getTrackedEntityInstance( id );
     }
 
     public void clearSelectedPatient()

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml	2014-01-07 10:08:24 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-mobile/src/main/resources/META-INF/dhis/beans.xml	2014-03-27 23:16:43 +0000
@@ -13,7 +13,7 @@
 	<bean id="org.hisp.dhis.mobile.caseentry.state.SelectedStateManager"
 		class="org.hisp.dhis.mobile.caseentry.state.DefaultSelectedStateManager"
         scope="prototype">
-		<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
+		<property name="trackedEntityInstanceService" ref="org.hisp.dhis.tracker.TrackedEntityInstanceService" />
 		<property name="selectionManager"
 			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
 		<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
@@ -69,19 +69,19 @@
 	<bean id="org.hisp.dhis.mobile.action.ShowMobileSettingFormAction"
 		class="org.hisp.dhis.mobile.action.ShowMobileSettingFormAction" 
 		scope="prototype">
-		<property name="patientMobileSettingService"
-			ref="org.hisp.dhis.mobile.service.PatientMobileSettingService" />
-		<property name="patientAttributeService"
-			ref="org.hisp.dhis.patient.PatientAttributeService" />
+		<property name="mobileSettingService"
+			ref="org.hisp.dhis.api.mobile.TrackedEntityMobileSettingService" />
+		<property name="attributeService"
+			ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
 	</bean>
 
 	<bean id="org.hisp.dhis.mobile.action.UpdateMobileSettingAction"
 		class="org.hisp.dhis.mobile.action.UpdateMobileSettingAction" 
 		scope="prototype">
-		<property name="patientMobileSettingService"
-			ref="org.hisp.dhis.mobile.service.PatientMobileSettingService" />
-		<property name="patientAttributeService"
-			ref="org.hisp.dhis.patient.PatientAttributeService" />
+		<property name="mobileSettingService"
+			ref="org.hisp.dhis.api.mobile.TrackedEntityMobileSettingService" />
+		<property name="attributeService"
+			ref="org.hisp.dhis.trackedentity.TrackedEntityAttributeService" />
 	</bean>
 
 	<!-- Mobile DataSet -->
@@ -173,14 +173,12 @@
 	<bean id="org.hisp.dhis.mobile.action.J2meClientUpdateAction"
 		class="org.hisp.dhis.mobile.action.J2meClientUpdateAction" 
 		scope="prototype">
-		<property name="patientMobileSettingService"
-			ref="org.hisp.dhis.mobile.service.PatientMobileSettingService" />
+		<property name="mobileSettingService"
+			ref="org.hisp.dhis.api.mobile.TrackedEntityMobileSettingService" />
 	</bean>
 	
 	<bean id="org.hisp.dhis.mobile.action.incoming.ProcessingSendQuickSMSAction"
         class="org.hisp.dhis.mobile.action.incoming.ProcessingSendQuickSMSAction" 
         scope="prototype"/>
 
-	<!-- <bean id="org.hisp.dhis.mobile.action.MobilePhonesPatternAction" class="org.hisp.dhis.mobile.action.MobilePhonesPatternAction" 
-		scope="prototype"> </bean> -->
 </beans>