dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21060
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9873: proper sorting of types in dxf2 export ui
------------------------------------------------------------
revno: 9873
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-02-22 13:49:10 +0700
message:
proper sorting of types in dxf2 export ui
modified:
dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dxf2/MetaDataExportFormAction.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-importexport/src/main/java/org/hisp/dhis/importexport/action/dxf2/MetaDataExportFormAction.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dxf2/MetaDataExportFormAction.java 2012-06-06 17:55:16 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/dxf2/MetaDataExportFormAction.java 2013-02-22 06:49:10 +0000
@@ -31,7 +31,10 @@
import org.apache.commons.lang3.StringUtils;
import org.hisp.dhis.dxf2.metadata.ExchangeClasses;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
/**
@@ -58,7 +61,10 @@
@Override
public String execute() throws Exception
{
- for ( String key : ExchangeClasses.getExportMap().values() )
+ List<String> values = new ArrayList<String>( ExchangeClasses.getExportMap().values() );
+ Collections.sort( values );
+
+ for ( String key : values )
{
String[] camelCaseWords = StringUtils.capitalize( key ).split( "(?=[A-Z])" );
exportClasses.put( key, StringUtils.join( camelCaseWords, " " ) );