dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #26648
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13180: Report table, fixed bug related to operands being used on columns or rows
------------------------------------------------------------
revno: 13180
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-09 17:33:18 +0100
message:
Report table, fixed bug related to operands being used on columns or rows
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.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/BaseAnalyticalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java 2013-11-11 23:01:07 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java 2013-12-09 16:33:18 +0000
@@ -559,17 +559,18 @@
{
List<String> ids = new ArrayList<String>();
- if ( column != null )
+ List<NameableObject> dimensions = new ArrayList<NameableObject>();
+ dimensions.addAll( column != null ? column : new ArrayList<NameableObject>() );
+ dimensions.addAll( row != null ? row : new ArrayList<NameableObject>() );
+
+ for ( NameableObject item : dimensions )
{
- for ( NameableObject item : column )
+ if ( item.getClass().isAssignableFrom( DataElementOperand.class ) )
{
- ids.add( item.getUid() );
+ ids.add( ((DataElementOperand) item).getDataElement().getUid() );
+ ids.add( ((DataElementOperand) item).getCategoryOptionCombo().getUid() );
}
- }
-
- if ( row != null )
- {
- for ( NameableObject item : row )
+ else
{
ids.add( item.getUid() );
}
@@ -579,7 +580,7 @@
return StringUtils.join( ids, DIMENSION_SEP );
}
-
+
/**
* Returns meta-data mapping for this analytical object. Includes a identifier
* to name mapping for dynamic dimensions.