dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31165
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15854: Renamed method
------------------------------------------------------------
revno: 15854
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-06-25 17:03:58 +0200
message:
Renamed method
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionService.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.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 2014-06-25 14:38:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/DimensionService.java 2014-06-25 15:03:58 +0000
@@ -41,7 +41,9 @@
List<NameableObject> getCanReadDimensionItems( String uid );
- <T extends IdentifiableObject> List<T> filterCanRead( User user, List<T> objects );
+ <T extends IdentifiableObject> List<T> getCanReadObjects( List<T> objects );
+
+ <T extends IdentifiableObject> List<T> getCanReadObjects( User user, List<T> objects );
DimensionType getDimensionType( String uid );
=== 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 2014-06-25 14:38:50 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/dimension/DefaultDimensionService.java 2014-06-25 15:03:58 +0000
@@ -176,13 +176,20 @@
{
User user = currentUserService.getCurrentUser();
- items.addAll( filterCanRead( user, dimension.getItems() ) );
+ items.addAll( getCanReadObjects( user, dimension.getItems() ) );
}
return items;
}
- public <T extends IdentifiableObject> List<T> filterCanRead( User user, List<T> objects )
+ public <T extends IdentifiableObject> List<T> getCanReadObjects( List<T> objects )
+ {
+ User user = currentUserService.getCurrentUser();
+
+ return getCanReadObjects( user, objects );
+ }
+
+ public <T extends IdentifiableObject> List<T> getCanReadObjects( User user, List<T> objects )
{
List<T> list = new ArrayList<T>( objects );
Iterator<T> iterator = list.iterator();
@@ -274,7 +281,7 @@
User user = currentUserService.getCurrentUser();
- return filterCanRead( user, dimensions );
+ return getCanReadObjects( user, dimensions );
}
public List<DimensionalObject> getDimensionConstraints()
@@ -322,7 +329,7 @@
if ( filterCanRead )
{
User user = currentUserService.getCurrentUser();
- List<NameableObject> items = filterCanRead( user, object.getItems() );
+ List<NameableObject> items = getCanReadObjects( user, object.getItems() );
object.setItems( items );
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java 2014-06-25 14:38:50 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/DimensionController.java 2014-06-25 15:03:58 +0000
@@ -85,7 +85,7 @@
@RequestParam( value = "links", defaultValue = "true", required = false ) Boolean links,
Model model )
{
- DimensionalObject dimension = dimensionService.getDimension( uid );
+ DimensionalObject dimension = dimensionService.getDimensionalObjectCopy( uid, true );
model.addAttribute( "model", dimension );
model.addAttribute( "viewClass", "dimensional" );
@@ -184,6 +184,8 @@
dimensions.addAll( dataSet.getCategoryCombo().getCategories() );
dimensions.addAll( identifiableObjectManager.getAll( CategoryOptionGroupSet.class ) );
+ dimensions = dimensionService.getCanReadObjects( dimensions );
+
for ( DimensionalObject dim : dimensions )
{
metaData.getDimensions().add( dimensionService.getDimensionalObjectCopy( dim.getUid(), true ) );