← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5577: Added org unit groups to data mart task

 

------------------------------------------------------------
revno: 5577
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-12-24 15:34:46 +0100
message:
  Added org unit groups to data mart task
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
  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/period/RelativePeriods.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2011-12-22 09:50:44 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2011-12-24 14:34:46 +0000
@@ -513,7 +513,7 @@
         {
             relatives.setLast12Months( true );
             relatives.setLast4Quarters( true );
-            relatives.setLastYear( true );
+            relatives.setThisYear( true );
         }
         else
         {
@@ -521,7 +521,7 @@
             relatives.setLast6BiMonths( periodTypes.contains( BiMonthlyPeriodType.NAME ) );
             relatives.setLast4Quarters( periodTypes.contains( QuarterlyPeriodType.NAME ) );
             relatives.setLast2SixMonths( periodTypes.contains( SixMonthlyPeriodType.NAME ) );
-            relatives.setLastYear( periodTypes.contains( YearlyPeriodType.NAME ) );
+            relatives.setThisYear( periodTypes.contains( YearlyPeriodType.NAME ) );
         }
 
         return relatives;

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2011-12-22 17:28:35 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2011-12-24 14:34:46 +0000
@@ -270,6 +270,7 @@
     <constructor-arg ref="org.hisp.dhis.indicator.IndicatorService" />
 	<constructor-arg ref="org.hisp.dhis.period.PeriodService" />
     <constructor-arg ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
+    <constructor-arg ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupService" />
     <constructor-arg ref="org.hisp.dhis.dataset.DataSetService" />
 	<constructor-arg ref="org.hisp.dhis.options.SystemSettingManager" />
   </bean>

=== 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-12-19 14:21:03 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java	2011-12-24 14:34:46 +0000
@@ -48,6 +48,8 @@
 import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.options.SystemSettingManager;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
+import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.period.Cal;
 import org.hisp.dhis.period.Period;
@@ -76,6 +78,8 @@
     private PeriodService periodService;
     
     private OrganisationUnitService organisationUnitService;
+    
+    private OrganisationUnitGroupService organisationUnitGroupService;
 
     private DataSetService dataSetService;
     
@@ -97,7 +101,8 @@
 
     public DataMartTask( DataMartService dataMartService, DataSetCompletenessService completenessService, 
         DataElementService dataElementService, IndicatorService indicatorService, PeriodService periodService,
-        OrganisationUnitService organisationUnitService, DataSetService dataSetService, SystemSettingManager systemSettingManager )
+        OrganisationUnitService organisationUnitService, OrganisationUnitGroupService organisationUnitGroupService,
+        DataSetService dataSetService, SystemSettingManager systemSettingManager )
     {
         this.dataMartService = dataMartService;
         this.completenessService = completenessService;
@@ -105,6 +110,7 @@
         this.indicatorService = indicatorService;
         this.periodService = periodService;
         this.organisationUnitService = organisationUnitService;
+        this.organisationUnitGroupService = organisationUnitGroupService;
         this.dataSetService = dataSetService;
         this.systemSettingManager = systemSettingManager;
     }
@@ -115,8 +121,9 @@
     {
         Collection<Integer> dataElementIds = ConversionUtils.getIdentifiers( DataElement.class, dataElementService.getAllDataElements() );
         Collection<Integer> indicatorIds = ConversionUtils.getIdentifiers( Indicator.class, indicatorService.getAllIndicators() );
+        Collection<Integer> dataSetIds = ConversionUtils.getIdentifiers( DataSet.class, dataSetService.getAllDataSets() );
         Collection<Integer> organisationUnitIds = ConversionUtils.getIdentifiers( OrganisationUnit.class, organisationUnitService.getAllOrganisationUnits() );
-        Collection<Integer> dataSetIds = ConversionUtils.getIdentifiers( DataSet.class, dataSetService.getAllDataSets() );
+        Collection<Integer> organisationUnitGroupIds = ConversionUtils.getIdentifiers( OrganisationUnitGroup.class, organisationUnitGroupService.getOrganisationUnitGroupsWithGroupSets() );
         
         Set<String> periodTypes = (Set<String>) systemSettingManager.getSystemSetting( KEY_SCHEDULED_PERIOD_TYPES, DEFAULT_SCHEDULED_PERIOD_TYPES );
 
@@ -149,7 +156,7 @@
         
         Collection<Integer> periodIds = ConversionUtils.getIdentifiers( Period.class, periodService.reloadPeriods( periods ) );
         
-        dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, null, null, true );
+        dataMartService.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, organisationUnitGroupIds, null, true );
         completenessService.exportDataSetCompleteness( dataSetIds, periodIds, organisationUnitIds ); 
     }
 }