← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9898: Analytics, renamed class DimensionOption to DimensionItem

 

------------------------------------------------------------
revno: 9898
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-02-25 16:15:07 +0100
message:
  Analytics, renamed class DimensionOption to DimensionItem
renamed:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DimensionOption.java => dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DimensionItem.java
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/Dimension.java
  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/DefaultQueryPlanner.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java
  dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryParamsTest.java
  dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DimensionOptionTest.java
  dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/QueryPlannerTest.java
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DimensionItem.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/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2013-02-25 13:58:25 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2013-02-25 15:15:07 +0000
@@ -76,8 +76,8 @@
     
     private static final List<DimensionType> COMPLETENESS_DIMENSION_TYTPES = Arrays.asList( DATASET, ORGANISATIONUNIT, ORGANISATIONUNIT_GROUPSET );
     
-    private static final DimensionOption[] DIM_OPT_ARR = new DimensionOption[0];
-    private static final DimensionOption[][] DIM_OPT_2D_ARR = new DimensionOption[0][];
+    private static final DimensionItem[] DIM_OPT_ARR = new DimensionItem[0];
+    private static final DimensionItem[][] DIM_OPT_2D_ARR = new DimensionItem[0][];
     
     private List<Dimension> dimensions = new ArrayList<Dimension>();
     
@@ -329,7 +329,7 @@
         
         for ( Dimension dim : dimensions )
         {
-            total *= dim.getOptions().size();
+            total *= dim.getItems().size();
         }
         
         return total;
@@ -439,9 +439,9 @@
      * Generates all permutations of the dimension and filter options for this query.
      * Ignores the data element, category option combo and indicator dimensions.
      */
-    public List<List<DimensionOption>> getDimensionOptionPermutations()
+    public List<List<DimensionItem>> getDimensionItemPermutations()
     {
-        List<DimensionOption[]> dimensionOptions = new ArrayList<DimensionOption[]>();
+        List<DimensionItem[]> dimensionOptions = new ArrayList<DimensionItem[]>();
         
         List<String> ignoreDims = Arrays.asList( DATAELEMENT_DIM_ID, CATEGORYOPTIONCOMBO_DIM_ID, INDICATOR_DIM_ID );
         
@@ -449,20 +449,20 @@
         {
             if ( !ignoreDims.contains( dimension.getDimension() ) )
             {
-                List<DimensionOption> options = new ArrayList<DimensionOption>();
+                List<DimensionItem> options = new ArrayList<DimensionItem>();
                 
-                for ( IdentifiableObject option : dimension.getOptions() )
+                for ( IdentifiableObject option : dimension.getItems() )
                 {
-                    options.add( new DimensionOption( dimension.getDimension(), option ) );
+                    options.add( new DimensionItem( dimension.getDimension(), option ) );
                 }
                 
                 dimensionOptions.add( options.toArray( DIM_OPT_ARR ) );
             }
         }
                 
-        CombinationGenerator<DimensionOption> generator = new CombinationGenerator<DimensionOption>( dimensionOptions.toArray( DIM_OPT_2D_ARR ) );
+        CombinationGenerator<DimensionItem> generator = new CombinationGenerator<DimensionItem>( dimensionOptions.toArray( DIM_OPT_2D_ARR ) );
         
-        List<List<DimensionOption>> permutations = generator.getCombinations();
+        List<List<DimensionItem>> permutations = generator.getCombinations();
         
         return permutations;
     }
@@ -507,7 +507,7 @@
     {
         int index = dimensions.indexOf( new Dimension( dimension ) );
         
-        return index != -1 ? dimensions.get( index ).getOptions() : null;
+        return index != -1 ? dimensions.get( index ).getItems() : null;
     }
 
     /**
@@ -534,7 +534,7 @@
     {
         int index = filters.indexOf( new Dimension( filter ) );
         
-        return index != -1 ? filters.get( index ).getOptions() : null;
+        return index != -1 ? filters.get( index ).getItems() : null;
     }
     
     /**
@@ -580,7 +580,7 @@
      * name separator does not exist an empty list is returned, indicating that
      * all dimension options should be used.
      */
-    public static List<String> getDimensionOptionsFromParam( String param )
+    public static List<String> getDimensionItemsFromParam( String param )
     {
         if ( param == null )
         {

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/Dimension.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/Dimension.java	2013-01-30 13:46:01 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/Dimension.java	2013-02-25 15:15:07 +0000
@@ -40,7 +40,7 @@
 
     private String dimensionName;
 
-    private List<IdentifiableObject> options = new ArrayList<IdentifiableObject>();
+    private List<IdentifiableObject> items = new ArrayList<IdentifiableObject>();
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -57,11 +57,11 @@
         this.type = type;
     }
 
-    public Dimension( String dimension, DimensionType type, List<IdentifiableObject> options )
+    public Dimension( String dimension, DimensionType type, List<IdentifiableObject> items )
     {
         this.dimension = dimension;
         this.type = type;
-        this.options = options;
+        this.items = items;
     }
 
     // -------------------------------------------------------------------------
@@ -74,7 +74,7 @@
      */
     public boolean isAllOptions()
     {
-        return options != null && options.isEmpty();
+        return items != null && items.isEmpty();
     }
     
     // -------------------------------------------------------------------------
@@ -111,14 +111,14 @@
         this.dimensionName = dimensionName;
     }
 
-    public List<IdentifiableObject> getOptions()
+    public List<IdentifiableObject> getItems()
     {
-        return options;
+        return items;
     }
 
-    public void setOptions( List<IdentifiableObject> options )
+    public void setItems( List<IdentifiableObject> items )
     {
-        this.options = options;
+        this.items = items;
     }
 
     // -------------------------------------------------------------------------
@@ -157,6 +157,6 @@
     @Override
     public String toString()
     {
-        return "[Dimension: " + dimension + ", type: " + type + ", name: " + dimensionName + ", options: " + options + "]";
+        return "[Dimension: " + dimension + ", type: " + type + ", name: " + dimensionName + ", items: " + items + "]";
     }
 }

=== renamed file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DimensionOption.java' => 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DimensionItem.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DimensionOption.java	2013-02-07 13:00:56 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DimensionItem.java	2013-02-25 15:15:07 +0000
@@ -33,20 +33,20 @@
 import org.hisp.dhis.common.IdentifiableObject;
 import org.hisp.dhis.system.util.CollectionUtils;
 
-public class DimensionOption
+public class DimensionItem
 {
     private String dimension;
     
-    private IdentifiableObject option;
+    private IdentifiableObject item;
 
     // -------------------------------------------------------------------------
     // Constructor
     // -------------------------------------------------------------------------
 
-    public DimensionOption( String dimension, IdentifiableObject option )
+    public DimensionItem( String dimension, IdentifiableObject item )
     {
         this.dimension = dimension;
-        this.option = option;
+        this.item = item;
     }
 
     // -------------------------------------------------------------------------
@@ -63,14 +63,14 @@
         this.dimension = dimension;
     }
 
-    public IdentifiableObject getOption()
+    public IdentifiableObject getItem()
     {
-        return option;
+        return item;
     }
 
-    public void setOption( IdentifiableObject option )
+    public void setItem( IdentifiableObject item )
     {
-        this.option = option;
+        this.item = item;
     }
 
     // -------------------------------------------------------------------------
@@ -78,19 +78,19 @@
     // -------------------------------------------------------------------------
 
     /**
-     * Returns a string key for dimension options in the given list. The key is 
-     * a concatenation of the dimension options separated by the dimension separator.
-     * If no options are given or options is null, an empty string is returned.
+     * Returns a string key for dimension items in the given list. The key is 
+     * a concatenation of the dimension items separated by the dimension separator.
+     * If no items are given or items is null, an empty string is returned.
      */
-    public static String asOptionKey( List<DimensionOption> options )
+    public static String asItemKey( List<DimensionItem> items )
     {
         StringBuilder builder = new StringBuilder();
         
-        if ( options != null && !options.isEmpty() )
+        if ( items != null && !items.isEmpty() )
         {
-            for ( DimensionOption option : options )
+            for ( DimensionItem item : items )
             {
-                builder.append( option.getOption().getUid() ).append( DataQueryParams.DIMENSION_SEP );
+                builder.append( item.getItem().getUid() ).append( DataQueryParams.DIMENSION_SEP );
             }
             
             builder.deleteCharAt( builder.length() - 1 );
@@ -100,38 +100,38 @@
     }
 
     /**
-     * Returns an array of identifiers of the dimension options in the given list.
-     * If no options are given or options is null, an empty array is returned.
+     * Returns an array of identifiers of the dimension items in the given list.
+     * If no items are given or items are null, an empty array is returned.
      */
-    public static String[] getOptionIdentifiers( List<DimensionOption> options )
+    public static String[] getItemIdentifiers( List<DimensionItem> items )
     {
-        List<String> optionUids = new ArrayList<String>();
+        List<String> itemUids = new ArrayList<String>();
         
-        if ( options != null && !options.isEmpty() )
+        if ( items != null && !items.isEmpty() )
         {
-            for ( DimensionOption option : options )
+            for ( DimensionItem item : items )
             {
-                optionUids.add( option != null ? option.getOption().getUid() : null );
+                itemUids.add( item != null ? item.getItem().getUid() : null );
             }
         }
         
-        return optionUids.toArray( CollectionUtils.STRING_ARR );
+        return itemUids.toArray( CollectionUtils.STRING_ARR );
     }
 
     /**
-     * Returns the period dimension option object from the given list of
-     * dimension options. If no options are given, options is null or there is 
+     * Returns the period dimension item object from the given list of
+     * dimension items. If no items are given, items are null or there are 
      * no period dimension, null is returned.
      */
-    public static IdentifiableObject getPeriodOption( List<DimensionOption> options )
+    public static IdentifiableObject getPeriodItem( List<DimensionItem> items )
     {
-        if ( options != null && !options.isEmpty() )
+        if ( items != null && !items.isEmpty() )
         {
-            for ( DimensionOption option : options )
+            for ( DimensionItem item : items )
             {
-                if ( DataQueryParams.PERIOD_DIM_ID.equals( option.getDimension() ) )
+                if ( DataQueryParams.PERIOD_DIM_ID.equals( item.getDimension() ) )
                 {
-                    return option.getOption();
+                    return item.getItem();
                 }
             }
         }
@@ -149,7 +149,7 @@
         final int prime = 31;
         int result = 1;
         result = prime * result + ( ( dimension == null ) ? 0 : dimension.hashCode() );
-        result = prime * result + ( ( option == null ) ? 0 : option.hashCode() );
+        result = prime * result + ( ( item == null ) ? 0 : item.hashCode() );
         return result;
     }
 
@@ -171,7 +171,7 @@
             return false;
         }
         
-        DimensionOption other = (DimensionOption) object;
+        DimensionItem other = (DimensionItem) object;
         
         if ( dimension == null )
         {
@@ -185,14 +185,14 @@
             return false;
         }
         
-        if ( option == null )
+        if ( item == null )
         {
-            if ( other.option != null )
+            if ( other.item != null )
             {
                 return false;
             }
         }
-        else if ( !option.equals( other.option ) )
+        else if ( !item.equals( other.item ) )
         {
             return false;
         }
@@ -203,6 +203,6 @@
     @Override
     public String toString()
     {
-        return "[" + dimension + ", " + option + "]";
+        return "[" + dimension + ", " + item + "]";
     }
 }

=== 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	2013-02-25 13:58:25 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2013-02-25 15:15:07 +0000
@@ -40,7 +40,7 @@
 import static org.hisp.dhis.analytics.DataQueryParams.ORGUNIT_DIM_ID;
 import static org.hisp.dhis.analytics.DataQueryParams.PERIOD_DIM_ID;
 import static org.hisp.dhis.analytics.DataQueryParams.getDimensionFromParam;
-import static org.hisp.dhis.analytics.DataQueryParams.getDimensionOptionsFromParam;
+import static org.hisp.dhis.analytics.DataQueryParams.getDimensionItemsFromParam;
 import static org.hisp.dhis.common.IdentifiableObjectUtils.asList;
 import static org.hisp.dhis.common.IdentifiableObjectUtils.asTypedList;
 
@@ -63,7 +63,7 @@
 import org.hisp.dhis.analytics.AnalyticsService;
 import org.hisp.dhis.analytics.DataQueryParams;
 import org.hisp.dhis.analytics.Dimension;
-import org.hisp.dhis.analytics.DimensionOption;
+import org.hisp.dhis.analytics.DimensionItem;
 import org.hisp.dhis.analytics.DimensionType;
 import org.hisp.dhis.analytics.IllegalQueryException;
 import org.hisp.dhis.analytics.QueryPlanner;
@@ -188,32 +188,32 @@
 
             Map<String, Map<DataElementOperand, Double>> permutationOperandValueMap = dataSourceParams.getPermutationOperandValueMap( aggregatedDataMap );
             
-            List<List<DimensionOption>> dimensionOptionPermutations = dataSourceParams.getDimensionOptionPermutations();
+            List<List<DimensionItem>> dimensionItemPermutations = dataSourceParams.getDimensionItemPermutations();
 
             Map<String, Double> constantMap = constantService.getConstantMap();
 
             for ( Indicator indicator : indicators )
             {
-                for ( List<DimensionOption> options : dimensionOptionPermutations )
+                for ( List<DimensionItem> options : dimensionItemPermutations )
                 {
-                    String permKey = DimensionOption.asOptionKey( options );
+                    String permKey = DimensionItem.asItemKey( options );
 
                     Map<DataElementOperand, Double> valueMap = permutationOperandValueMap.get( permKey );
                     
                     if ( valueMap != null )
                     {
-                        Period period = (Period) DimensionOption.getPeriodOption( options );
+                        Period period = (Period) DimensionItem.getPeriodItem( options );
                         
                         Double value = expressionService.getIndicatorValue( indicator, period, valueMap, constantMap, null );
                         
                         if ( value != null )
                         {
-                            List<DimensionOption> row = new ArrayList<DimensionOption>( options );
+                            List<DimensionItem> row = new ArrayList<DimensionItem>( options );
                             
-                            row.add( indicatorIndex, new DimensionOption( INDICATOR_DIM_ID, indicator ) );
+                            row.add( indicatorIndex, new DimensionItem( INDICATOR_DIM_ID, indicator ) );
                                                         
                             grid.addRow();
-                            grid.addValues( DimensionOption.getOptionIdentifiers( row ) );
+                            grid.addValues( DimensionItem.getItemIdentifiers( row ) );
                             grid.addValue( MathUtils.getRounded( value, 1 ) );
                         }
                     }
@@ -395,7 +395,7 @@
             for ( String param : dimensionParams )
             {
                 String dimension = getDimensionFromParam( param );
-                List<String> options = getDimensionOptionsFromParam( param );
+                List<String> options = getDimensionItemsFromParam( param );
                 
                 if ( dimension != null && options != null )
                 {
@@ -409,7 +409,7 @@
             for ( String param : filterParams )
             {
                 String dimension = DataQueryParams.getDimensionFromParam( param );
-                List<String> options = DataQueryParams.getDimensionOptionsFromParam( param );
+                List<String> options = DataQueryParams.getDimensionItemsFromParam( param );
                 
                 if ( dimension != null && options != null )
                 {
@@ -593,7 +593,7 @@
         
         for ( Dimension dimension : dimensions )
         {
-            List<IdentifiableObject> options = new ArrayList<IdentifiableObject>( dimension.getOptions() );
+            List<IdentifiableObject> options = new ArrayList<IdentifiableObject>( dimension.getItems() );
 
             // -----------------------------------------------------------------
             // If dimension is not fixed and has no options, insert all options

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java	2013-02-25 13:58:25 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultQueryPlanner.java	2013-02-25 15:15:07 +0000
@@ -278,7 +278,7 @@
         }
         else
         {
-            throw new IllegalQueryException( "Query does not contain any period dimension options" );
+            throw new IllegalQueryException( "Query does not contain any period dimension items" );
         }
         
         return queries;
@@ -322,7 +322,7 @@
         }
         else
         {
-            throw new IllegalQueryException( "Query does not contain any period dimension options" );
+            throw new IllegalQueryException( "Query does not contain any period dimension items" );
         }
         
         return queries;        
@@ -389,7 +389,7 @@
      * meaningful to split on multiple data element group sets.
      * 
      * If the aggregation type is already set/overridden in the request, the
-     * query will be returned unchanged. If there are no dimension options specified
+     * query will be returned unchanged. If there are no dimension items specified
      * the aggregation type will fall back to sum.
      */
     private List<DataQueryParams> groupByAggregationType( DataQueryParams params )
@@ -419,11 +419,11 @@
             }
         }
         else if ( params.getDataElementGroupSets() != null && !params.getDataElementGroupSets().isEmpty() &&
-            ( groupSet = params.getDataElementGroupSets().iterator().next() ).getOptions() != null && !groupSet.getOptions().isEmpty() )
+            ( groupSet = params.getDataElementGroupSets().iterator().next() ).getItems() != null && !groupSet.getItems().isEmpty() )
         {
             PeriodType periodType = PeriodType.getPeriodTypeByName( params.getPeriodType() );
             
-            ListMap<AggregationType, IdentifiableObject> aggregationTypeDataElementGroupMap = getAggregationTypeDataElementGroupMap( groupSet.getOptions(), periodType );
+            ListMap<AggregationType, IdentifiableObject> aggregationTypeDataElementGroupMap = getAggregationTypeDataElementGroupMap( groupSet.getItems(), periodType );
 
             for ( AggregationType aggregationType : aggregationTypeDataElementGroupMap.keySet() )
             {

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java	2013-02-21 18:18:15 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/JdbcAnalyticsManager.java	2013-02-25 15:15:07 +0000
@@ -126,7 +126,7 @@
         {
             if ( !dim.isAllOptions() )
             {
-                sql += sqlHelper.whereAnd() + " " + dim.getDimensionName() + " in (" + getQuotedCommaDelimitedString( getUids( dim.getOptions() ) ) + " ) ";
+                sql += sqlHelper.whereAnd() + " " + dim.getDimensionName() + " in (" + getQuotedCommaDelimitedString( getUids( dim.getItems() ) ) + " ) ";
             }
         }
 
@@ -134,7 +134,7 @@
         {
             if ( !filter.isAllOptions() )
             {
-                sql += sqlHelper.whereAnd() + " " + filter.getDimensionName() + " in (" + getQuotedCommaDelimitedString( getUids( filter.getOptions() ) ) + " ) ";
+                sql += sqlHelper.whereAnd() + " " + filter.getDimensionName() + " in (" + getQuotedCommaDelimitedString( getUids( filter.getItems() ) ) + " ) ";
             }
         }
         

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryParamsTest.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryParamsTest.java	2013-01-31 10:59:22 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DataQueryParamsTest.java	2013-02-25 15:15:07 +0000
@@ -52,7 +52,7 @@
     {
         List<String> expected = new ArrayList<String>( Arrays.asList( "D348asd782j", "kj78HnH6hgT", "9ds9dS98s2" ) );
         
-        assertEquals( expected, DataQueryParams.getDimensionOptionsFromParam( "de:D348asd782j;kj78HnH6hgT;9ds9dS98s2" ) );        
+        assertEquals( expected, DataQueryParams.getDimensionItemsFromParam( "de:D348asd782j;kj78HnH6hgT;9ds9dS98s2" ) );        
     }
     
     @Test

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DimensionOptionTest.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DimensionOptionTest.java	2013-01-17 14:26:35 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/DimensionOptionTest.java	2013-02-25 15:15:07 +0000
@@ -48,7 +48,7 @@
     private Period peA;
     private OrganisationUnit ouA;
     
-    private List<DimensionOption> options;
+    private List<DimensionItem> options;
     
     @Before
     public void before()
@@ -57,10 +57,10 @@
         peA = createPeriod( "2000Q1" );
         ouA = createOrganisationUnit( 'A' );
         
-        options = new ArrayList<DimensionOption>();
-        options.add( new DimensionOption( DATAELEMENT_DIM_ID, deA ) );
-        options.add( new DimensionOption( PERIOD_DIM_ID, peA ) );
-        options.add( new DimensionOption( ORGUNIT_DIM_ID, ouA ) );
+        options = new ArrayList<DimensionItem>();
+        options.add( new DimensionItem( DATAELEMENT_DIM_ID, deA ) );
+        options.add( new DimensionItem( PERIOD_DIM_ID, peA ) );
+        options.add( new DimensionItem( ORGUNIT_DIM_ID, ouA ) );
     }
     
     @Test
@@ -68,8 +68,8 @@
     {
         String expected = deA.getUid() + DIMENSION_SEP + peA.getUid() + DIMENSION_SEP + ouA.getUid();
         
-        assertEquals( expected, DimensionOption.asOptionKey( options ) );
-        assertEquals( EMPTY, DimensionOption.asOptionKey( null ) );
+        assertEquals( expected, DimensionItem.asItemKey( options ) );
+        assertEquals( EMPTY, DimensionItem.asItemKey( null ) );
     }
     
     @Test
@@ -77,14 +77,14 @@
     {
         String[] expected = { deA.getUid(), peA.getUid(), ouA.getUid() };
         
-        assertArrayEquals( expected, DimensionOption.getOptionIdentifiers( options ) );
-        assertArrayEquals( new String[0], DimensionOption.getOptionIdentifiers( null ) );
+        assertArrayEquals( expected, DimensionItem.getItemIdentifiers( options ) );
+        assertArrayEquals( new String[0], DimensionItem.getItemIdentifiers( null ) );
     }
     
     @Test
     public void testGetPeriodOption()
     {
-        assertEquals( peA, DimensionOption.getPeriodOption( options ) );
-        assertEquals( null, DimensionOption.getPeriodOption( null ) );
+        assertEquals( peA, DimensionItem.getPeriodItem( options ) );
+        assertEquals( null, DimensionItem.getPeriodItem( null ) );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/QueryPlannerTest.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/QueryPlannerTest.java	2013-02-19 13:19:21 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/data/QueryPlannerTest.java	2013-02-25 15:15:07 +0000
@@ -45,7 +45,7 @@
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.analytics.DataQueryParams;
 import org.hisp.dhis.analytics.Dimension;
-import org.hisp.dhis.analytics.DimensionOption;
+import org.hisp.dhis.analytics.DimensionItem;
 import org.hisp.dhis.analytics.IllegalQueryException;
 import org.hisp.dhis.analytics.QueryPlanner;
 import org.hisp.dhis.common.IdentifiableObject;
@@ -278,12 +278,12 @@
         params.setOrganisationUnits( getList( ouA, ouB, ouC ) );
         params.setPeriods( getList( createPeriod( "2000Q1" ), createPeriod( "2000Q2" ) ) );
         
-        List<List<DimensionOption>> permutations = params.getDimensionOptionPermutations();
+        List<List<DimensionItem>> permutations = params.getDimensionItemPermutations();
         
         assertNotNull( permutations );
         assertEquals( 6, permutations.size() );
         
-        for ( List<DimensionOption> permutation : permutations )
+        for ( List<DimensionItem> permutation : permutations )
         {
             assertNotNull( permutation );
             assertEquals( 2, permutation.size() );