dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38999
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19799: Analytics, favorites with operands, fix for save
------------------------------------------------------------
revno: 19799
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-08-19 16:52:05 -0400
message:
Analytics, favorites with operands, fix for save
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.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-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java 2015-07-14 09:34:46 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java 2015-08-19 20:52:05 +0000
@@ -38,6 +38,7 @@
import static org.hisp.dhis.common.DimensionType.PROGRAM_ATTRIBUTE;
import static org.hisp.dhis.common.DimensionType.PROGRAM_DATAELEMENT;
import static org.hisp.dhis.common.IdentifiableObjectUtils.getUids;
+import static org.hisp.dhis.commons.util.TextUtils.splitSafe;
import static org.hisp.dhis.organisationunit.OrganisationUnit.KEY_LEVEL;
import static org.hisp.dhis.organisationunit.OrganisationUnit.KEY_ORGUNIT_GROUP;
import static org.hisp.dhis.organisationunit.OrganisationUnit.KEY_USER_ORGUNIT;
@@ -75,6 +76,7 @@
import org.hisp.dhis.dataelement.DataElementDomain;
import org.hisp.dhis.dataelement.DataElementGroup;
import org.hisp.dhis.dataelement.DataElementGroupSet;
+import org.hisp.dhis.dataelement.DataElementOperand;
import org.hisp.dhis.dataelement.DataElementOperandService;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.legend.LegendSet;
@@ -443,9 +445,25 @@
{
for ( String uid : uids )
{
- NameableObject dataObject = identifiableObjectManager.get( DataDimensionItem.DATA_DIMENSION_CLASSES, uid );
-
- object.getDataDimensionItems().add( DataDimensionItem.create( dataObject ) );
+ if ( DimensionalObjectUtils.isValidDimensionalOperand( uid ) )
+ {
+ DataElementOperand operand = operandService.getDataElementOperand(
+ splitSafe( uid, DataElementOperand.ESCAPED_SEPARATOR, 0 ), splitSafe( uid, DataElementOperand.ESCAPED_SEPARATOR, 1 ) );
+
+ if ( operand != null )
+ {
+ object.getDataDimensionItems().add( DataDimensionItem.create( operand ) );
+ }
+ }
+ else
+ {
+ NameableObject dataObject = identifiableObjectManager.get( DataDimensionItem.DATA_DIMENSION_CLASSES, uid );
+
+ if ( dataObject != null )
+ {
+ object.getDataDimensionItems().add( DataDimensionItem.create( dataObject ) );
+ }
+ }
}
}
else if ( PERIOD.equals( type ) )