← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14662: Minor

 

------------------------------------------------------------
revno: 14662
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-04 15:57:02 +0200
message:
  Minor
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObjectUtils.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventReportController.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/DimensionalObjectUtils.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObjectUtils.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObjectUtils.java	2014-04-04 13:57:02 +0000
@@ -94,6 +94,28 @@
     }
 
     /**
+     * Creates a list of dimension identifiers based on the given list of 
+     * DimensionalObjects.
+     * 
+     * @param dimensions the list of DimensionalObjects.
+     * @return list of dimension identifiers.
+     */
+    public static List<String> getDimensions( List<DimensionalObject> dimensions )
+    {
+        List<String> dims = new ArrayList<String>();
+        
+        if ( dimensions != null )
+        {
+            for ( DimensionalObject dimension : dimensions )
+            {
+                dims.add( dimension.getDimension() );
+            }
+        }
+        
+        return dims;
+    }
+
+    /**
      * Creates a two-dimensional array of dimension items based on the list of
      * DimensionalObjects. I.e. the list of items of each DimensionalObject is
      * converted to an array and inserted into the outer array in the same order.

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventReportController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventReportController.java	2014-04-04 13:06:17 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/event/EventReportController.java	2014-04-04 13:57:02 +0000
@@ -28,7 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.common.DimensionalObjectUtils.getUniqueDimensions;
+import static org.hisp.dhis.common.DimensionalObjectUtils.getDimensions;
 
 import java.io.InputStream;
 
@@ -173,9 +173,9 @@
         report.getRowDimensions().clear();
         report.getFilterDimensions().clear();
         
-        report.getColumnDimensions().addAll( getUniqueDimensions( report.getColumns() ) );
-        report.getRowDimensions().addAll( getUniqueDimensions( report.getRows() ) );
-        report.getFilterDimensions().addAll( getUniqueDimensions( report.getFilters() ) );
+        report.getColumnDimensions().addAll( getDimensions( report.getColumns() ) );
+        report.getRowDimensions().addAll( getDimensions( report.getRows() ) );
+        report.getFilterDimensions().addAll( getDimensions( report.getFilters() ) );
         
         if ( report.getProgram() != null )
         {