← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5476: Data mart, minor fix

 

------------------------------------------------------------
revno: 5476
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-12-19 15:21:03 +0100
message:
  Data mart, minor fix
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamart/DataMartService.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/impl/DefaultDataMartService.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorConverter.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.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/datamart/DataMartService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamart/DataMartService.java	2011-08-13 10:41:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamart/DataMartService.java	2011-12-19 14:21:03 +0000
@@ -80,11 +80,13 @@
      * @param indicatorIds the indicator identifiers.
      * @param periodIds the period identifiers.
      * @param organisationUnitIds the organisation unit identifiers.
+     * @param organisationUnitGroupIds the organisation unit group identifiers.
      * @param relatives the RelativePeriods.
      * @param completeExport indicates whether this is a complete export.
      */
     void export( Collection<Integer> dataElementIds, Collection<Integer> indicatorIds,
-        Collection<Integer> periodIds, Collection<Integer> organisationUnitIds, RelativePeriods relatives, boolean completeExport );
+        Collection<Integer> periodIds, Collection<Integer> organisationUnitIds, Collection<Integer> organisationUnitGroupIds,
+        RelativePeriods relatives, boolean completeExport );
     
     // ----------------------------------------------------------------------
     // DataMartExport

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java	2011-12-11 16:07:13 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java	2011-12-19 14:21:03 +0000
@@ -186,6 +186,16 @@
         final int cpuCores = SystemUtils.getCpuCores();
         
         Clock clock = new Clock().startClock().logTime( "Data mart export process started, number of CPU cores: " + cpuCores );
+
+        // ---------------------------------------------------------------------
+        // Replace null with empty collection
+        // ---------------------------------------------------------------------
+
+        dataElementIds = dataElementIds != null ? dataElementIds : new ArrayList<Integer>();
+        indicatorIds = indicatorIds != null ? indicatorIds : new ArrayList<Integer>();
+        periodIds = periodIds != null ? periodIds : new ArrayList<Integer>();
+        organisationUnitIds = organisationUnitIds != null ? organisationUnitIds : new ArrayList<Integer>();
+        organisationUnitGroupIds = organisationUnitGroupIds != null ? organisationUnitGroupIds : new ArrayList<Integer>();
         
         // ---------------------------------------------------------------------
         // Get objects

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/impl/DefaultDataMartService.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/impl/DefaultDataMartService.java	2011-12-11 01:24:32 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/impl/DefaultDataMartService.java	2011-12-19 14:21:03 +0000
@@ -97,8 +97,7 @@
             getIdentifiers( Indicator.class, dataMartExport.getIndicators() ), 
             getIdentifiers( Period.class, allPeriods ),
             getIdentifiers( OrganisationUnit.class, dataMartExport.getOrganisationUnits() ),
-            null,
-            false, new OutputHolderState() );
+            null, false, new OutputHolderState() );
     }
 
  
@@ -111,11 +110,12 @@
     public void export( Collection<Integer> dataElementIds, Collection<Integer> indicatorIds,
         Collection<Integer> periodIds, Collection<Integer> organisationUnitIds, RelativePeriods relatives )
     {
-        export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, relatives, false );
+        export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, null, relatives, false );
     }
 
     public void export( Collection<Integer> dataElementIds, Collection<Integer> indicatorIds,
-        Collection<Integer> periodIds, Collection<Integer> organisationUnitIds, RelativePeriods relatives, boolean completeExport )
+        Collection<Integer> periodIds, Collection<Integer> organisationUnitIds, Collection<Integer> organisationUnitGroupIds, 
+        RelativePeriods relatives, boolean completeExport )
     {
         if ( relatives != null )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorConverter.java	2011-12-19 13:10:25 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorConverter.java	2011-12-19 14:21:03 +0000
@@ -185,7 +185,7 @@
 
             if ( params.minorVersionGreaterOrEqual(  "1.2" ) ) 
             {
-              indicator.setCode( values.get( FIELD_CODE ) );
+                indicator.setCode( values.get( FIELD_CODE ) );
             }
             
             indicator.setDescription( values.get( FIELD_DESCRIPTION ) );

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java	2011-11-25 10:09:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java	2011-12-19 14:21:03 +0000
@@ -149,7 +149,7 @@
         
         Collection<Integer> periodIds = ConversionUtils.getIdentifiers( Period.class, periodService.reloadPeriods( periods ) );
         
-        dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, null, true );
+        dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, null, null, true );
         completenessService.exportDataSetCompleteness( dataSetIds, periodIds, organisationUnitIds ); 
     }
 }