dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #41594
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21201: Remved unused method from DimensionService
------------------------------------------------------------
revno: 21201
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-11-26 19:11:05 +0100
message:
Remved unused method from DimensionService
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java
dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/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/common/DimensionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionService.java 2015-11-26 17:25:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionService.java 2015-11-26 18:11:05 +0000
@@ -37,8 +37,6 @@
*/
public interface DimensionService
{
- DimensionalObject getDimension( String uid, DimensionType dimensionType );
-
List<NameableObject> getCanReadDimensionItems( String uid );
<T extends IdentifiableObject> List<T> getCanReadObjects( List<T> objects );
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java 2015-11-26 17:25:40 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionalObject.java 2015-11-26 18:11:05 +0000
@@ -36,7 +36,6 @@
import org.hisp.dhis.analytics.AggregationType;
import org.hisp.dhis.dataelement.CategoryOptionGroup;
import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
-import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategory;
import org.hisp.dhis.dataelement.DataElementCategoryOption;
import org.hisp.dhis.dataelement.DataElementGroup;
@@ -44,7 +43,6 @@
import org.hisp.dhis.legend.LegendSet;
import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -89,14 +87,6 @@
add( OrganisationUnitGroupSet.class ).
add( CategoryOptionGroupSet.class ).build();
- Map<DimensionType, Class<? extends DimensionalObject>> DYNAMIC_DIMENSION_TYPE_CLASS_MAP = ImmutableMap.<DimensionType, Class<? extends DimensionalObject>>builder().
- put( DimensionType.CATEGORY, DataElementCategory.class ).
- put( DimensionType.DATAELEMENT_GROUPSET, DataElementGroupSet.class ).
- put( DimensionType.ORGANISATIONUNIT_GROUPSET, OrganisationUnitGroupSet.class ).
- put( DimensionType.CATEGORYOPTION_GROUPSET, CategoryOptionGroupSet.class ).
- put( DimensionType.PROGRAM_ATTRIBUTE, TrackedEntityAttribute.class ).
- put( DimensionType.PROGRAM_DATAELEMENT, DataElement.class ).build();
-
Map<Class<? extends DimensionalObject>, Class<? extends NameableObject>> DIMENSION_CLASS_ITEM_CLASS_MAP = ImmutableMap.<Class<? extends DimensionalObject>, Class<? extends NameableObject>>builder().
put( DataElementCategory.class, DataElementCategoryOption.class ).
put( DataElementGroupSet.class, DataElementGroup.class ).
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java 2015-11-26 17:25:40 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java 2015-11-26 18:11:05 +0000
@@ -127,24 +127,6 @@
//--------------------------------------------------------------------------
@Override
- public DimensionalObject getDimension( String uid, DimensionType dimensionType )
- {
- if ( uid == null || dimensionType == null )
- {
- return null;
- }
-
- Class<? extends DimensionalObject> clazz = DimensionalObject.DYNAMIC_DIMENSION_TYPE_CLASS_MAP.get( dimensionType );
-
- if ( clazz == null )
- {
- return null;
- }
-
- return identifiableObjectManager.get( clazz, uid );
- }
-
- @Override
public List<NameableObject> getCanReadDimensionItems( String uid )
{
DimensionalObject dimension = identifiableObjectManager.get( DimensionalObject.DYNAMIC_DIMENSION_CLASSES, uid );
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/dimension/DimensionServiceTest.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/dimension/DimensionServiceTest.java 2015-06-26 16:44:31 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/dimension/DimensionServiceTest.java 2015-11-26 18:11:05 +0000
@@ -155,15 +155,7 @@
organisationUnitGroupService.updateOrganisationUnitGroupSet( ouGroupSetA );
}
-
- @Test
- public void testGetDimensionalObjectByType()
- {
- String dim = ouGroupSetA.getUid();
- assertEquals( ouGroupSetA, dimensionService.getDimension( dim, DimensionType.ORGANISATIONUNIT_GROUPSET ) );
- }
-
@Test
public void testMergeAnalyticalObject()
{