← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5103: Data mart, fixed bug with relative periods

 

------------------------------------------------------------
revno: 5103
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-11-03 15:35:44 +0100
message:
  Data mart, fixed bug with relative periods
modified:
  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-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/pom.xml


--
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-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-11-03 13:26:09 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/engine/DefaultDataMartEngine.java	2011-11-03 14:35:44 +0000
@@ -162,7 +162,13 @@
         Collection<Period> periods = periodService.getPeriods( periodIds );
         List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnits( organisationUnitIds ) );
         Collection<DataElement> dataElements = dataElementService.getDataElements( dataElementIds );
-        
+
+        clock.logTime( "Retrieved objects" );
+
+        // ---------------------------------------------------------------------
+        // Filter objects
+        // ---------------------------------------------------------------------
+
         organisationUnitService.filterOrganisationUnitsWithoutData( organisationUnits );
         Collections.shuffle( organisationUnits );
         FilterUtils.filter( dataElements, new AggregatableDataElementFilter() );

=== 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-10-12 17:32:39 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/impl/DefaultDataMartService.java	2011-11-03 14:35:44 +0000
@@ -80,7 +80,7 @@
     // Export
     // -------------------------------------------------------------------------
 
-    @Transactional
+    @Transactional //TODO potential problem with reload periods inside same tx
     public void export( int id )
     {
         DataMartExport dataMartExport = getDataMartExport( id );
@@ -100,21 +100,19 @@
             false, new OutputHolderState() );
     }
 
-    @Transactional
+ 
     public void export( Collection<Integer> dataElementIds, Collection<Integer> indicatorIds,
         Collection<Integer> periodIds, Collection<Integer> organisationUnitIds )
     {
         dataMartEngine.export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, false, new OutputHolderState() );
     }
     
-    @Transactional
     public void export( Collection<Integer> dataElementIds, Collection<Integer> indicatorIds,
         Collection<Integer> periodIds, Collection<Integer> organisationUnitIds, RelativePeriods relatives )
     {
         export( dataElementIds, indicatorIds, periodIds, organisationUnitIds, relatives, false );
     }
 
-    @Transactional
     public void export( Collection<Integer> dataElementIds, Collection<Integer> indicatorIds,
         Collection<Integer> periodIds, Collection<Integer> organisationUnitIds, RelativePeriods relatives, boolean completeExport )
     {
@@ -160,21 +158,25 @@
         return dataMartExportStore.getByName( name );
     }
 
+    @Transactional
     public int getDataMartExportCount()
     {
         return dataMartExportStore.getCount();
     }
 
+    @Transactional
     public int getDataMartExportCountByName( String name )
     {
         return dataMartExportStore.getCountByName( name );
     }
 
+    @Transactional
     public Collection<DataMartExport> getDataMartExportsBetween( int first, int max )
     {
         return dataMartExportStore.getBetween( first, max );
     }
 
+    @Transactional
     public Collection<DataMartExport> getDataMartExportsBetweenByName( String name, int first, int max )
     {
         return dataMartExportStore.getBetweenByName( name, first, max );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/pom.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/pom.xml	2011-10-14 16:54:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/pom.xml	2011-11-03 14:35:44 +0000
@@ -42,6 +42,10 @@
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-service-administration</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.hisp.dhis</groupId>
+      <artifactId>dhis-service-datamart-default</artifactId>
+    </dependency>
 	
 	<!-- Other -->