← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18674: Analytics, using id object manager

 

------------------------------------------------------------
revno: 18674
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-03-24 12:19:25 +0100
message:
  Analytics, using id object manager
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.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/common/DimensionalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java	2015-03-23 20:38:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java	2015-03-24 11:19:25 +0000
@@ -57,6 +57,7 @@
     final String PERIOD_DIM_ID = "pe";
     final String ORGUNIT_DIM_ID = "ou";
     final String ORGUNIT_GROUP_DIM_ID = "oug"; // Used for org unit target
+    final String PROGRAM_INDICATOR_DIM_ID = "pin";
     final String ITEM_DIM_ID = "item";
 
     final String OU_MODE_SELECTED = "selected"; //TODO replace with OrganisationUnitSelectionMode

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-03-07 16:26:59 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-03-24 11:19:25 +0000
@@ -100,6 +100,7 @@
 import org.hisp.dhis.common.DisplayProperty;
 import org.hisp.dhis.common.Grid;
 import org.hisp.dhis.common.GridHeader;
+import org.hisp.dhis.common.IdentifiableObjectManager;
 import org.hisp.dhis.common.IdentifiableObjectUtils;
 import org.hisp.dhis.common.IdentifiableProperty;
 import org.hisp.dhis.common.IllegalQueryException;
@@ -118,11 +119,9 @@
 import org.hisp.dhis.dataelement.DataElementOperandService;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.dataset.DataSet;
-import org.hisp.dhis.dataset.DataSetService;
 import org.hisp.dhis.expression.ExpressionService;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.indicator.Indicator;
-import org.hisp.dhis.indicator.IndicatorService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
 import org.hisp.dhis.organisationunit.OrganisationUnitGroupService;
@@ -141,7 +140,6 @@
 import org.hisp.dhis.system.util.MathUtils;
 import org.hisp.dhis.system.util.SystemUtils;
 import org.hisp.dhis.system.util.UniqueArrayList;
-import org.hisp.dhis.trackedentity.TrackedEntityAttributeService;
 import org.hisp.dhis.user.CurrentUserService;
 import org.hisp.dhis.user.User;
 import org.hisp.dhis.util.Timer;
@@ -172,8 +170,8 @@
     private QueryPlanner queryPlanner;
 
     @Autowired
-    private IndicatorService indicatorService;
-
+    private IdentifiableObjectManager idObjectManager;
+    
     @Autowired
     private DataElementService dataElementService;
 
@@ -181,18 +179,12 @@
     private DataElementCategoryService categoryService;
 
     @Autowired
-    private DataSetService dataSetService;
-
-    @Autowired
     private OrganisationUnitService organisationUnitService;
 
     @Autowired
     private OrganisationUnitGroupService organisationUnitGroupService;
 
     @Autowired
-    private TrackedEntityAttributeService attributeService;
-
-    @Autowired
     private ExpressionService expressionService;
 
     @Autowired
@@ -936,7 +928,7 @@
                     continue itemLoop;
                 }
                 
-                Indicator in = indicatorService.getIndicator( uid );
+                Indicator in = idObjectManager.get( Indicator.class, uid );
 
                 if ( in != null )
                 {
@@ -944,7 +936,7 @@
                     continue itemLoop;
                 }
 
-                DataElement de = dataElementService.getDataElement( uid );
+                DataElement de = idObjectManager.get( DataElement.class, uid );
 
                 if ( de != null )
                 {
@@ -952,7 +944,7 @@
                     continue itemLoop;
                 }
 
-                DataSet ds = dataSetService.getDataSet( uid );
+                DataSet ds = idObjectManager.get( DataSet.class, uid );
 
                 if ( ds != null )
                 {