← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19709: Analytics, removed obsolete method

 

------------------------------------------------------------
revno: 19709
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-08-04 14:59:15 +0200
message:
  Analytics, removed obsolete method
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/webapi/controller/ChartController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportTableController.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	2015-08-03 10:39:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObjectUtils.java	2015-08-04 12:59:15 +0000
@@ -63,33 +63,6 @@
     private static final Pattern DIMENSIONAL_OPERAND_PATTERN = Pattern.compile( "([a-zA-Z]\\w{10})\\.([a-zA-Z]\\w{10})" );
     
     public static final String TITLE_ITEM_SEP = ", ";
-        
-    /**
-     * Creates a unique 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> getUniqueDimensions( List<DimensionalObject> dimensions )
-    {
-        List<String> dims = new ArrayList<>();
-        
-        if ( dimensions != null )
-        {
-            for ( DimensionalObject dimension : dimensions )
-            {
-                String dim = dimension.getDimension();
-                
-                if ( dim != null && !dims.contains( dim ) )
-                {
-                    dims.add( dim );
-                }
-            }
-        }
-        
-        return dims;
-    }
 
     public static List<DimensionalObject> getCopies( List<DimensionalObject> dimensions )
     {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ChartController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ChartController.java	2015-07-21 13:47:18 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ChartController.java	2015-08-04 12:59:15 +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.IOException;
 import java.util.Date;
@@ -312,6 +312,6 @@
             chart.setCategory( chart.getRows().get( 0 ).getDimension() );
         }
 
-        chart.getFilterDimensions().addAll( getUniqueDimensions( chart.getFilters() ) );
+        chart.getFilterDimensions().addAll( getDimensions( chart.getFilters() ) );
     }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportTableController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportTableController.java	2015-07-21 13:47:18 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/ReportTableController.java	2015-08-04 12:59:15 +0000
@@ -61,7 +61,7 @@
 import java.util.Date;
 import java.util.Set;
 
-import static org.hisp.dhis.common.DimensionalObjectUtils.getUniqueDimensions;
+import static org.hisp.dhis.common.DimensionalObjectUtils.getDimensions;
 import static org.hisp.dhis.commons.util.CodecUtils.filenameEncode;
 
 /**
@@ -298,9 +298,9 @@
         reportTable.getRowDimensions().clear();
         reportTable.getFilterDimensions().clear();
 
-        reportTable.getColumnDimensions().addAll( getUniqueDimensions( reportTable.getColumns() ) );
-        reportTable.getRowDimensions().addAll( getUniqueDimensions( reportTable.getRows() ) );
-        reportTable.getFilterDimensions().addAll( getUniqueDimensions( reportTable.getFilters() ) );
+        reportTable.getColumnDimensions().addAll( getDimensions( reportTable.getColumns() ) );
+        reportTable.getRowDimensions().addAll( getDimensions( reportTable.getRows() ) );
+        reportTable.getFilterDimensions().addAll( getDimensions( reportTable.getFilters() ) );
 
         if ( reportTable.getLegendSet() != null )
         {