← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1019: Removed some methods from DimensionService.

 

------------------------------------------------------------
revno: 1019
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-11-10 15:02:08 +0100
message:
  Removed some methods from DimensionService.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dimension/DimensionService.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dimension/DefaultDimensionService.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dimension/DimensionServiceTest.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/dimension/DimensionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dimension/DimensionService.java	2009-11-06 11:58:30 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dimension/DimensionService.java	2009-11-10 14:02:08 +0000
@@ -27,7 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
+import java.util.Map;
 
 /**
  * @author Lars Helge Overland
@@ -36,13 +36,5 @@
 {
     final String ID = DimensionService.class.getName();
     
-    Collection<DimensionSet> getAllDimensionSets();
-    
-    Collection<DimensionSet> getDataElementDimensionSets();
-    
-    DimensionSet getDataElementDimensionSetByName( String name );
-    
-    Collection<DimensionSet> getIndicatorDimensionSets();
-
-    DimensionSet getIndicatorDimensionSetByName( String name );
+    Map<String, String> getDimensionSets();
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dimension/DefaultDimensionService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dimension/DefaultDimensionService.java	2009-11-07 13:27:57 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dimension/DefaultDimensionService.java	2009-11-10 14:02:08 +0000
@@ -27,8 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Map;
 
 import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
@@ -70,57 +69,8 @@
     // DimensionService implementation
     // -------------------------------------------------------------------------
     
-    public Collection<DimensionSet> getDataElementDimensionSets()
-    {
-        Collection<DimensionSet> dimensionSets = new ArrayList<DimensionSet>();
-        dimensionSets.addAll( dataElementService.getDataElementsWithGroupSets() );        
-        dimensionSets.addAll( categoryService.getAllDataElementCategoryCombos() );
-        
-        return dimensionSets;
-    }
-    
-    public DimensionSet getDataElementDimensionSetByName( String name )
-    {
-        for ( DimensionSet dimensionSet : getDataElementDimensionSets() )
-        {
-            if ( dimensionSet.getName().equals( name ) )
-            {
-                return dimensionSet;
-            }
-        }
-        
-        return null;
-    }
-
-    public Collection<DimensionSet> getIndicatorDimensionSets()
-    {
-        Collection<DimensionSet> dimensionSets = new ArrayList<DimensionSet>();
-        dimensionSets.addAll( indicatorService.getIndicatorsWithGroupSets() );
-        dimensionSets.addAll( categoryService.getAllDataElementCategoryCombos() );
-        
-        return dimensionSets;
-    }
-    
-    public DimensionSet getIndicatorDimensionSetByName( String name )
-    {
-        for ( DimensionSet dimensionSet : getIndicatorDimensionSets() )
-        {
-            if ( dimensionSet.getName().equals( name ) )
-            {
-                return dimensionSet;
-            }
-        }
-        
-        return null;
-    }
-
-    public Collection<DimensionSet> getAllDimensionSets()
-    {
-        Collection<DimensionSet> dimensionSets = new ArrayList<DimensionSet>();
-        dimensionSets.addAll( dataElementService.getDataElementsWithGroupSets() ); 
-        dimensionSets.addAll( indicatorService.getIndicatorsWithGroupSets() );
-        dimensionSets.addAll( categoryService.getAllDataElementCategoryCombos() );
-        
-        return dimensionSets;
+    public Map<String, String> getDimensionSets()
+    {
+        return null;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dimension/DimensionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dimension/DimensionServiceTest.java	2009-11-07 13:27:57 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/dimension/DimensionServiceTest.java	2009-11-10 14:02:08 +0000
@@ -27,11 +27,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static junit.framework.Assert.assertFalse;
-import static junit.framework.Assert.assertTrue;
-
-import java.util.Collection;
-
 import org.hisp.dhis.DhisSpringTest;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementGroupSet;
@@ -79,9 +74,6 @@
     @Test
     public void getDimensions()
     {
-        Collection<DimensionSet> dimensionSets = dimensionService.getAllDimensionSets();
         
-        assertTrue( dimensionSets.contains( dataElementA ) );
-        assertFalse( dimensionSets.contains( dataElementB ) );
     }
 }