dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13278
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4204: using sortedChildren instead
------------------------------------------------------------
revno: 4204
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-07-25 13:07:38 +0200
message:
using sortedChildren instead
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/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java
--
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 2011-07-25 09:32:54 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnitTree.vm 2011-07-25 11:07:38 +0000
@@ -6,8 +6,7 @@
"hasChildren": #if( $organisationUnit.children.size() > 0 )true,#{else}false#end
#if( $organisationUnit.children.size() > 0 )
"children": [
- #set( $children = $sorter.sort( $organisationUnit.children ) )
- #foreach ( $child in $children )
+ #foreach ( $child in $organisationUnit.sortedChildren )
#expandOrganisationUnit( $child )#if( $velocityCount < $organisationUnit.children.size() ),#end
#end
]
=== 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 2011-07-25 09:32:54 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/commons/action/GetOrganisationUnitTreeAction.java 2011-07-25 11:07:38 +0000
@@ -88,29 +88,6 @@
return organisationUnits;
}
- public class SetSorter<T>
- {
- private Comparator<T> comparator;
-
- public SetSorter( Comparator<T> comparator )
- {
- this.comparator = comparator;
- }
-
- public Set<T> sort( Set<T> unsortedSet )
- {
- SortedSet<T> sortedSet = new TreeSet<T>( comparator );
- sortedSet.addAll( unsortedSet );
-
- return sortedSet;
- }
- }
-
- public SetSorter<OrganisationUnit> getSorter()
- {
- return new SetSorter<OrganisationUnit>( organisationUnitComparator );
- }
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------