← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18924: Reverted R 18895

 

------------------------------------------------------------
revno: 18924
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-04-16 10:35:49 +0200
message:
  Reverted R 18895
modified:
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTree.vm
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTreePartial.vm
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java
  dhis-2/dhis-web/dhis-web-commons/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-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTree.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTree.vm	2015-04-14 08:13:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTree.vm	2015-04-16 08:35:49 +0000
@@ -6,8 +6,7 @@
 #if( ! $versionOnly )
 ,"organisationUnits": {
 #foreach( $unit in $organisationUnits )
-"$!encoder.jsonEncode($unit.uid)":{"id":"$!encoder.jsonEncode($unit.uid)","n":"$!encoder.jsonEncode( ${unit.displayName} )","l":${unit.level},#if( $unit.parent )"pid":"$!encoder.jsonEncode($unit.parent.uid)",#end"c":[#foreach( $child in $unit.sortedChildren )
-"$!encoder.jsonEncode($child.uid)"#if( $velocityCount < $unit.children.size() ),#end#end]}
+"$!encoder.jsonEncode($unit.uid)":{"id":"$!encoder.jsonEncode($unit.uid)","n":"$!encoder.jsonEncode( ${unit.name} )","l":${unit.level},#if( $unit.parent )"pid":"$!encoder.jsonEncode($unit.parent.uid)",#end"c":[#foreach( $child in $unit.sortedChildren )"$!encoder.jsonEncode($child.uid)"#if( $velocityCount < $unit.children.size() ),#end#end]}
 #if( $velocityCount < $organisationUnits.size() ),#end#end
 }#end
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTreePartial.vm'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTreePartial.vm	2015-04-14 08:13:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTreePartial.vm	2015-04-16 08:35:49 +0000
@@ -4,7 +4,6 @@
 ,"roots": [ #foreach( $root in $rootOrganisationUnits )"$!encoder.jsonEncode($root.uid)"#if( $velocityCount < $rootOrganisationUnits.size() ),#end#end ]
 ,"organisationUnits": {
 #foreach( $unit in $organisationUnits )
-"$!encoder.jsonEncode($unit.uid)":{"id":"$!encoder.jsonEncode($unit.uid)","n":"$!encoder.jsonEncode( ${unit.displayName} )",#if( $unit.parent )"pid":"$!encoder.jsonEncode($unit.parent.uid)",#end"c":[#foreach( $child in $unit.sortedChildren )"$!encoder
-.jsonEncode($child.uid)"#if( $velocityCount < $unit.children.size() ),#end#end]}
+"$!encoder.jsonEncode($unit.uid)":{"id":"$!encoder.jsonEncode($unit.uid)","n":"$!encoder.jsonEncode( ${unit.name} )",#if( $unit.parent )"pid":"$!encoder.jsonEncode($unit.parent.uid)",#end"c":[#foreach( $child in $unit.sortedChildren )"$!encoder.jsonEncode($child.uid)"#if( $velocityCount < $unit.children.size() ),#end#end]}
 #if( $velocityCount < $organisationUnits.size() ),#end#end
 }}
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java	2015-04-14 08:13:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java	2015-04-16 08:35:49 +0000
@@ -30,7 +30,6 @@
 
 import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
-import org.hisp.dhis.i18n.I18nService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -38,7 +37,6 @@
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.version.Version;
 import org.hisp.dhis.version.VersionService;
-import org.springframework.beans.factory.annotation.Autowired;
 
 import java.util.ArrayList;
 import java.util.Collection;
@@ -56,17 +54,26 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    @Autowired
     private CurrentUserService currentUserService;
 
-    @Autowired
+    public void setCurrentUserService( CurrentUserService currentUserService )
+    {
+        this.currentUserService = currentUserService;
+    }
+
     private OrganisationUnitService organisationUnitService;
 
-    @Autowired
+    public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
     private VersionService versionService;
 
-    @Autowired
-    protected I18nService i18nService;
+    public void setVersionService( VersionService versionService )
+    {
+        this.versionService = versionService;
+    }
 
     // -------------------------------------------------------------------------
     // Input & Output
@@ -170,8 +177,6 @@
             rootOrganisationUnits = new ArrayList<>( organisationUnitService.getRootOrganisationUnits() );
         }
 
-        i18nService.internationalise( rootOrganisationUnits );
-
         if ( byName != null )
         {
             List<OrganisationUnit> organisationUnitByName = organisationUnitService.getOrganisationUnitByName( byName );
@@ -192,8 +197,6 @@
                     while ( (parent = parent.getParent()) != null );
                 }
 
-                i18nService.internationalise( organisationUnits );
-
                 return "partial";
             }
         }
@@ -214,8 +217,6 @@
                 }
             }
 
-            i18nService.internationalise( organisationUnits );
-
             return "partial";
         }
 
@@ -228,8 +229,6 @@
                 organisationUnits.addAll( parent.getChildren() );
             }
 
-            i18nService.internationalise( organisationUnits );
-
             return "partial";
         }
 
@@ -252,7 +251,6 @@
         }
 
         Collections.sort( rootOrganisationUnits, IdentifiableObjectNameComparator.INSTANCE );
-        i18nService.internationalise( organisationUnits );
 
         return SUCCESS;
     }

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2015-04-14 08:13:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/resources/META-INF/dhis/beans.xml	2015-04-16 08:35:49 +0000
@@ -501,6 +501,9 @@
 
   <bean id="org.hisp.dhis.commons.action.GetOrganisationUnitTreeAction" class="org.hisp.dhis.commons.action.GetOrganisationUnitTreeAction"
     scope="prototype">
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+    <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    <property name="versionService" ref="org.hisp.dhis.version.VersionService" />
   </bean>
 
   <bean id="org.hisp.dhis.commons.action.GetPeriodAction" class="org.hisp.dhis.commons.action.GetPeriodAction"