← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4966: Fixed bug export PDF for Meta-data objects.

 

------------------------------------------------------------
revno: 4966
committer: Hieu <hieu.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-10-17 15:11:42 +0700
message:
  Fixed bug export PDF for Meta-data objects.
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ExportParams.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/UserConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/ITextPDFExportService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java
  dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/pdf/ExportToPdfAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/pdf/ExportToPdfAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/pdf/ExportToPdfAction.java
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/pdf/ExportToPdfAction.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-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ExportParams.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ExportParams.java	2011-09-14 03:44:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ExportParams.java	2011-10-17 08:11:42 +0000
@@ -47,6 +47,8 @@
  */
 public class ExportParams
 {
+    private boolean isMetaData;
+
     private boolean includeDataValues;
 
     private boolean includeCompleteDataSetRegistrations;
@@ -133,6 +135,16 @@
     // Getters & setters
     // -------------------------------------------------------------------------
 
+    public boolean isMetaData()
+    {
+        return isMetaData;
+    }
+
+    public void setMetaData( boolean isMetaData )
+    {
+        this.isMetaData = isMetaData;
+    }
+
     public boolean isIncludeDataValues()
     {
         return includeDataValues;

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java	2011-09-12 09:15:08 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java	2011-10-17 08:11:42 +0000
@@ -27,7 +27,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementService;
+import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
@@ -46,6 +52,14 @@
     extends PDFUtils
     implements PDFConverter
 {
+
+    private DataElementService dataElementService;
+
+    public DataElementConverter( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+
     // -------------------------------------------------------------------------
     // PDFConverter implementation
     // -------------------------------------------------------------------------
@@ -54,12 +68,25 @@
     {
         I18n i18n = params.getI18n();
         I18nFormat format = params.getFormat();
-
-        PDFUtils.printObjectFrontPage( document, params.getDataElementObjects(), i18n, format, "data_elements" );
-        
-        for ( DataElement element : params.getDataElementObjects() )
+        List<DataElement> elements = null;
+
+        if ( params.isMetaData() )
+        {
+            elements = new ArrayList<DataElement>( dataElementService.getDataElements( params.getDataElements() ) );
+        }
+        else
+        {
+            elements = new ArrayList<DataElement>( params.getDataElementObjects() );
+        }
+        
+        Collections.sort( elements, new DataElementNameComparator() );
+        
+        PDFUtils.printObjectFrontPage( document, elements, i18n, format, "data_elements" );
+
+        for ( DataElement element : elements )
         {
             addTableToDocument( document, printDataElement( element, i18n, true, 0.40f, 0.60f ) );
         }
+
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java	2011-09-12 09:15:08 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/IndicatorConverter.java	2011-10-17 08:11:42 +0000
@@ -27,12 +27,18 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.PDFConverter;
 import org.hisp.dhis.indicator.Indicator;
+import org.hisp.dhis.indicator.IndicatorService;
+import org.hisp.dhis.indicator.comparator.IndicatorNameComparator;
 import org.hisp.dhis.system.util.PDFUtils;
 
 import com.lowagie.text.Document;
@@ -49,9 +55,12 @@
 {
     private ExpressionService expressionService;
 
-    public IndicatorConverter( ExpressionService expressionService )
+    private IndicatorService indicatorService;
+
+    public IndicatorConverter( ExpressionService expressionService, IndicatorService indicatorService )
     {
         this.expressionService = expressionService;
+        this.indicatorService = indicatorService;
     }
 
     // -------------------------------------------------------------------------
@@ -62,10 +71,22 @@
     {
         I18n i18n = params.getI18n();
         I18nFormat format = params.getFormat();
-
-        PDFUtils.printObjectFrontPage( document, params.getIndicatorObjects(), i18n, format, "indicators" );
-
-        for ( Indicator indicator : params.getIndicatorObjects() )
+        List<Indicator> elements = null;
+
+        if ( params.isMetaData() )
+        {
+            elements = new ArrayList<Indicator>( indicatorService.getIndicators( params.getIndicators() ) );
+        }
+        else
+        {
+            elements = new ArrayList<Indicator>( params.getIndicatorObjects() );
+        }
+
+        Collections.sort( elements, new IndicatorNameComparator() );
+
+        PDFUtils.printObjectFrontPage( document, elements, i18n, format, "indicators" );
+
+        for ( Indicator indicator : elements )
         {
             addTableToDocument( document, printIndicator( indicator, i18n, expressionService, true, 0.40f, 0.60f ) );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java	2011-09-14 03:44:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/OrganisationUnitConverter.java	2011-10-17 08:11:42 +0000
@@ -27,11 +27,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.PDFConverter;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.system.util.PDFUtils;
 
 import com.lowagie.text.Document;
@@ -47,7 +53,14 @@
     extends PDFUtils
     implements PDFConverter
 {
-    public OrganisationUnitConverter( )
+    private OrganisationUnitService organisationUnitService;
+
+    public OrganisationUnitConverter( OrganisationUnitService organisationUnitService )
+    {
+        this.organisationUnitService = organisationUnitService;
+    }
+
+    public OrganisationUnitConverter()
     {
     }
 
@@ -59,10 +72,22 @@
     {
         I18n i18n = params.getI18n();
         I18nFormat format = params.getFormat();
-
-        PDFUtils.printObjectFrontPage( document, params.getOrganisationUnitObjects(), i18n, format, "organisation_units" );
-
-        for ( OrganisationUnit unit : params.getOrganisationUnitObjects() )
+        List<OrganisationUnit> elements = null;
+
+        if ( params.isMetaData() )
+        {
+            elements = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnits( params.getOrganisationUnits() ) );
+        }
+        else
+        {
+            elements = new ArrayList<OrganisationUnit>( params.getOrganisationUnitObjects() );
+        }
+
+        Collections.sort( elements, new OrganisationUnitNameComparator() );
+        
+        PDFUtils.printObjectFrontPage( document, elements, i18n, format, "organisation_units" );
+
+        for ( OrganisationUnit unit : elements )
         {
             addTableToDocument( document, printOrganisationUnit( unit, i18n, format, true, 0.40f, 0.60f ) );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/UserConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/UserConverter.java	2011-09-10 08:40:27 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/UserConverter.java	2011-10-17 08:11:42 +0000
@@ -27,12 +27,18 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.PDFConverter;
 import org.hisp.dhis.system.util.PDFUtils;
 import org.hisp.dhis.user.UserCredentials;
+import org.hisp.dhis.user.UserService;
+import org.hisp.dhis.user.comparator.UsernameComparator;
 
 import com.lowagie.text.Document;
 
@@ -44,11 +50,14 @@
     extends PDFUtils
     implements PDFConverter
 {
+    private UserService userService;
+
     /**
      * Constructor for write operations.
      */
-    public UserConverter()
+    public UserConverter( UserService userService )
     {
+        this.userService = userService;
     }
 
     // -------------------------------------------------------------------------
@@ -59,10 +68,22 @@
     {
         I18n i18n = params.getI18n();
         I18nFormat format = params.getFormat();
-
-        PDFUtils.printObjectFrontPage( document, params.getUserObjects(), i18n, format, "users" );
-        
-        for ( UserCredentials userCredentials : params.getUserObjects() )
+        List<UserCredentials> elements = null;
+
+        if ( params.isMetaData() )
+        {
+            elements = new ArrayList<UserCredentials>( userService.getUsers( params.getUsers(), params.getCurrentUser() ) );
+        }
+        else
+        {
+            elements = new ArrayList<UserCredentials>( params.getUserObjects() );
+        }
+
+        Collections.sort( elements, new UsernameComparator() );
+
+        PDFUtils.printObjectFrontPage( document, elements, i18n, format, "users" );
+
+        for ( UserCredentials userCredentials : elements )
         {
             addTableToDocument( document, printUser( userCredentials, i18n, format, true, 0.40f, 0.60f ) );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java	2011-09-10 08:40:27 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/ValidationRuleConverter.java	2011-10-17 08:11:42 +0000
@@ -27,6 +27,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
@@ -34,6 +38,8 @@
 import org.hisp.dhis.importexport.PDFConverter;
 import org.hisp.dhis.system.util.PDFUtils;
 import org.hisp.dhis.validation.ValidationRule;
+import org.hisp.dhis.validation.ValidationRuleService;
+import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
 
 import com.lowagie.text.Document;
 
@@ -47,12 +53,15 @@
 {
     private ExpressionService expressionService;
 
+    private ValidationRuleService validationRuleService;
+
     /**
      * Constructor for write operations.
      */
-    public ValidationRuleConverter( ExpressionService expressionService )
+    public ValidationRuleConverter( ExpressionService expressionService, ValidationRuleService validationRuleService )
     {
         this.expressionService = expressionService;
+        this.validationRuleService = validationRuleService;
     }
 
     // -------------------------------------------------------------------------
@@ -63,10 +72,23 @@
     {
         I18n i18n = params.getI18n();
         I18nFormat format = params.getFormat();
-
-        PDFUtils.printObjectFrontPage( document, params.getValidationRuleObjects(), i18n, format, "validation_rules" );
-
-        for ( ValidationRule rule : params.getValidationRuleObjects() )
+        List<ValidationRule> elements = null;
+
+        if ( params.isMetaData() )
+        {
+            elements = new ArrayList<ValidationRule>( validationRuleService.getValidationRules( params
+                .getValidationRules() ) );
+        }
+        else
+        {
+            elements = new ArrayList<ValidationRule>( params.getValidationRuleObjects() );
+        }
+
+        Collections.sort( elements, new ValidationRuleNameComparator() );
+
+        PDFUtils.printObjectFrontPage( document, elements, i18n, format, "validation_rules" );
+
+        for ( ValidationRule rule : elements )
         {
             addTableToDocument( document, printValidationRule( rule, i18n, expressionService, true, 0.40f, 0.60f ) );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/ITextPDFExportService.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/ITextPDFExportService.java	2011-09-14 03:44:56 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/exporter/ITextPDFExportService.java	2011-10-17 08:11:42 +0000
@@ -36,6 +36,7 @@
 import java.util.zip.ZipOutputStream;
 
 import org.hibernate.SessionFactory;
+import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.ExportService;
@@ -45,7 +46,10 @@
 import org.hisp.dhis.importexport.pdf.converter.OrganisationUnitHierarchyConverter;
 import org.hisp.dhis.importexport.pdf.converter.UserConverter;
 import org.hisp.dhis.importexport.pdf.converter.ValidationRuleConverter;
+import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.user.UserService;
+import org.hisp.dhis.validation.ValidationRuleService;
 
 /**
  * @author Lars Helge Overland
@@ -72,6 +76,20 @@
         this.expressionService = expressionService;
     }
 
+    private DataElementService dataElementService;
+
+    public void setDataElementService( DataElementService dataElementService )
+    {
+        this.dataElementService = dataElementService;
+    }
+
+    private IndicatorService indicatorService;
+
+    public void setIndicatorService( IndicatorService indicatorService )
+    {
+        this.indicatorService = indicatorService;
+    }
+
     private OrganisationUnitService organisationUnitService;
 
     public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -79,6 +97,20 @@
         this.organisationUnitService = organisationUnitService;
     }
 
+    private UserService userService;
+
+    public void setUserService( UserService userService )
+    {
+        this.userService = userService;
+    }
+
+    private ValidationRuleService validationRuleService;
+
+    public void setValidationRuleService( ValidationRuleService validationRuleService )
+    {
+        this.validationRuleService = validationRuleService;
+    }
+
     // -------------------------------------------------------------------------
     // ExportService implementation
     // -------------------------------------------------------------------------
@@ -106,12 +138,13 @@
             thread.setOutputStream( zipOut );
             thread.setExportParams( params );
 
-            thread.setDataElementConverter( new DataElementConverter() );
-            thread.setIndicatorConverter( new IndicatorConverter( expressionService ) );
-            thread.setOrganisationUnitHierarchyConverter( new OrganisationUnitHierarchyConverter( organisationUnitService ) );
-            thread.setOrganisationUnitConverter( new OrganisationUnitConverter() );
-            thread.setUserConverter( new UserConverter() );
-            thread.setValidationRuleConverter( new ValidationRuleConverter( expressionService ) );
+            thread.setDataElementConverter( new DataElementConverter( dataElementService ) );
+            thread.setIndicatorConverter( new IndicatorConverter( expressionService, indicatorService ) );
+            thread.setOrganisationUnitHierarchyConverter( new OrganisationUnitHierarchyConverter(
+                organisationUnitService ) );
+            thread.setOrganisationUnitConverter( new OrganisationUnitConverter( organisationUnitService ) );
+            thread.setUserConverter( new UserConverter( userService ) );
+            thread.setValidationRuleConverter( new ValidationRuleConverter( expressionService, validationRuleService ) );
 
             thread.start();
 
@@ -122,5 +155,4 @@
             throw new RuntimeException( "Error occured during PDF export", ex );
         }
     }
-
 }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml	2011-09-11 16:32:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/resources/META-INF/dhis/beans.xml	2011-10-17 08:11:42 +0000
@@ -280,8 +280,12 @@
 
   <bean id="org.hisp.dhis.importexport.PDFExportService" class="org.hisp.dhis.importexport.pdf.exporter.ITextPDFExportService">
     <property name="sessionFactory" ref="sessionFactory" />
+	<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
+	<property name="indicatorService" ref="org.hisp.dhis.indicator.IndicatorService" />
 	<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
     <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    <property name="userService" ref="org.hisp.dhis.user.UserService" />
+    <property name="validationRuleService" ref="org.hisp.dhis.validation.ValidationRuleService" />
   </bean>
 
 	<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java	2011-05-05 21:15:45 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/exp/MetaDataExportAction.java	2011-10-17 08:11:42 +0000
@@ -34,6 +34,7 @@
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.ExportService;
+import org.hisp.dhis.user.CurrentUserService;
 
 import com.opensymphony.xwork2.Action;
 
@@ -57,6 +58,13 @@
         this.serviceProvider = serviceProvider;
     }
 
+    private CurrentUserService currentUserService;
+
+    public void setCurrentUserService( CurrentUserService currentUserService)
+    {
+        this.currentUserService = currentUserService;
+    }
+
     private I18n i18n;
 
     public void setI18n( I18n i18n )
@@ -326,8 +334,10 @@
             params.setOlapUrls( null );
         }
 
+        params.setMetaData( true );
         params.setIncludeDataValues( false );
-
+        params.setCurrentUser( currentUserService.getCurrentUser() );
+        
         params.setI18n( i18n );
         params.setFormat( format );
 

=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml	2011-07-13 12:50:14 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/META-INF/dhis/beans.xml	2011-10-17 08:11:42 +0000
@@ -104,6 +104,7 @@
   <bean id="org.hisp.dhis.importexport.action.exp.MetaDataExportAction" class="org.hisp.dhis.importexport.action.exp.MetaDataExportAction"
     scope="prototype">
     <property name="serviceProvider" ref="exportServiceProvider" />
+    <property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
   </bean>
 
   <bean id="org.hisp.dhis.importexport.action.exp.DetailedMetaDataExportAction" class="org.hisp.dhis.importexport.action.exp.DetailedMetaDataExportAction"

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/pdf/ExportToPdfAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/pdf/ExportToPdfAction.java	2011-09-26 09:31:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/pdf/ExportToPdfAction.java	2011-10-17 08:11:42 +0000
@@ -31,7 +31,6 @@
 
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -40,14 +39,12 @@
 import org.hisp.dhis.datadictionary.DataDictionaryService;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
 import org.hisp.dhis.i18n.I18n;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.ExportService;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
-import org.hisp.dhis.indicator.comparator.IndicatorNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -188,8 +185,6 @@
                     dataElements = new ArrayList<DataElement>( dataElementService.getAllDataElements() );
                 }
 
-                Collections.sort( dataElements, new DataElementNameComparator() );
-
                 if ( (dataElements != null) && !dataElements.isEmpty() )
                 {
                     params.setDataElementObjects( dataElements );
@@ -221,8 +216,6 @@
                     indicators = new ArrayList<Indicator>( indicatorService.getAllIndicators() );
                 }
 
-                Collections.sort( indicators, new IndicatorNameComparator() );
-
                 if ( (indicators != null) && !indicators.isEmpty() )
                 {
                     params.setIndicatorObjects( indicators );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/pdf/ExportToPdfAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/pdf/ExportToPdfAction.java	2011-09-26 09:31:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/pdf/ExportToPdfAction.java	2011-10-17 08:11:42 +0000
@@ -32,7 +32,6 @@
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -44,7 +43,6 @@
 import org.hisp.dhis.importexport.ExportService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 
 import com.opensymphony.xwork2.Action;
@@ -172,8 +170,6 @@
                 {
                     organisationUnitService.searchOrganisationUnitByName( organisationUnits, curKey );
                 }
-                
-                Collections.sort( organisationUnits, new OrganisationUnitNameComparator() );
 
                 if ( (organisationUnits != null) && !organisationUnits.isEmpty() )
                 {

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/pdf/ExportToPdfAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/pdf/ExportToPdfAction.java	2011-09-26 09:31:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-user/src/main/java/org/hisp/dhis/user/action/pdf/ExportToPdfAction.java	2011-10-17 08:11:42 +0000
@@ -31,7 +31,6 @@
 
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -46,7 +45,6 @@
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.UserCredentials;
 import org.hisp.dhis.user.UserService;
-import org.hisp.dhis.user.comparator.UsernameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -178,8 +176,6 @@
                 FilterUtils.filter( userCredentialsList, new UserCredentialsCanUpdateFilter( currentUserService
                     .getCurrentUser() ) );
 
-                Collections.sort( userCredentialsList, new UsernameComparator() );
-
                 if ( (userCredentialsList != null) && !userCredentialsList.isEmpty() )
                 {
                     params.setUserObjects( userCredentialsList );

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/pdf/ExportToPdfAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/pdf/ExportToPdfAction.java	2011-09-26 09:31:56 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/pdf/ExportToPdfAction.java	2011-10-17 08:11:42 +0000
@@ -31,7 +31,6 @@
 
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
@@ -43,7 +42,6 @@
 import org.hisp.dhis.importexport.ExportService;
 import org.hisp.dhis.validation.ValidationRule;
 import org.hisp.dhis.validation.ValidationRuleService;
-import org.hisp.dhis.validation.comparator.ValidationRuleNameComparator;
 
 import com.opensymphony.xwork2.Action;
 
@@ -154,8 +152,6 @@
                     validationRulesList = new ArrayList<ValidationRule>( validationRuleService.getAllValidationRules() );
                 }
 
-                Collections.sort( validationRulesList, new ValidationRuleNameComparator() );
-
                 if ( (validationRulesList != null) && !validationRulesList.isEmpty() )
                 {
                     params.setValidationRuleObjects( validationRulesList );