dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #04206
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1396: Made the data elements in the default form in multidimensional data entry screen adhere to the cu...
------------------------------------------------------------
revno: 1396
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Thu 2010-02-04 17:57:55 +0100
message:
Made the data elements in the default form in multidimensional data entry screen adhere to the custom sort order.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2010-02-04 09:59:45 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementService.java 2010-02-04 16:57:55 +0000
@@ -236,7 +236,7 @@
* @param dataElements the DataElements to include.
* @return grouped DataElements based on their DataElementCategoryCombo.
*/
- Map<DataElementCategoryCombo, Collection<DataElement>> getGroupedDataElementsByCategoryCombo(
+ Map<DataElementCategoryCombo, List<DataElement>> getGroupedDataElementsByCategoryCombo(
List<DataElement> dataElements );
/**
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2010-02-04 09:59:45 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementService.java 2010-02-04 16:57:55 +0000
@@ -271,10 +271,10 @@
return i18n( i18nService, dataElementStore.getDataElementByCategoryCombo( categoryCombo ) );
}
- public Map<DataElementCategoryCombo, Collection<DataElement>> getGroupedDataElementsByCategoryCombo(
+ public Map<DataElementCategoryCombo, List<DataElement>> getGroupedDataElementsByCategoryCombo(
List<DataElement> dataElements )
{
- Map<DataElementCategoryCombo, Collection<DataElement>> mappedDataElements = new HashMap<DataElementCategoryCombo, Collection<DataElement>>();
+ Map<DataElementCategoryCombo, List<DataElement>> mappedDataElements = new HashMap<DataElementCategoryCombo, List<DataElement>>();
for ( DataElement de : dataElements )
{
@@ -284,7 +284,7 @@
}
else
{
- Collection<DataElement> des = new ArrayList<DataElement>();
+ List<DataElement> des = new ArrayList<DataElement>();
des.add( de );
mappedDataElements.put( de.getCategoryCombo(), des );
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java 2009-12-14 08:29:21 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java 2010-02-04 16:57:55 +0000
@@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
@@ -46,6 +47,7 @@
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataelement.comparator.DataElementSortOrderComparator;
import org.hisp.dhis.datalock.DataSetLock;
import org.hisp.dhis.datalock.DataSetLockService;
import org.hisp.dhis.dataset.DataEntryForm;
@@ -66,8 +68,6 @@
import com.opensymphony.xwork2.Action;
-import edu.emory.mathcs.backport.java.util.Collections;
-
/**
* @author Abyot Asalefew
* @version $Id$
@@ -200,9 +200,9 @@
return customValues;
}
- private Map<DataElementCategoryCombo, Collection<DataElement>> orderedDataElements = new HashMap<DataElementCategoryCombo, Collection<DataElement>>();
+ private Map<DataElementCategoryCombo, List<DataElement>> orderedDataElements = new HashMap<DataElementCategoryCombo, List<DataElement>>();
- public Map<DataElementCategoryCombo, Collection<DataElement>> getOrderedDataElements()
+ public Map<DataElementCategoryCombo, List<DataElement>> getOrderedDataElements()
{
return orderedDataElements;
}
@@ -547,6 +547,7 @@
des = (List<DataElement>) orderedDataElements.get( categoryCombo );
displayPropertyHandler.handle( des );
+ Collections.sort( des, new DataElementSortOrderComparator() );
orderedDataElements.put( categoryCombo, des );
}