← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17387: Web api, fixed issue, wrong method were overridden for getting entity for IdentifiableObjectContr...

 

------------------------------------------------------------
revno: 17387
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-11-07 19:23:57 +0100
message:
  Web api, fixed issue, wrong method were overridden for getting entity for IdentifiableObjectController and UserController
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.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-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-10-23 09:58:11 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2014-11-07 18:23:57 +0000
@@ -739,7 +739,10 @@
         return entityList;
     }
 
-    protected List<T> getEntity( String uid )
+    /**
+     * Should not be overridden, instead override {@link getEntity(String, WebOptions}.
+     */
+    protected final List<T> getEntity( String uid )
     {
         return getEntity( uid, new WebOptions( new HashMap<String, String>() ) );
     }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java	2014-06-17 10:29:40 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IdentifiableObjectController.java	2014-11-07 18:23:57 +0000
@@ -30,7 +30,9 @@
 
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
+
 import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.webapi.webdomain.WebOptions;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.HttpRequestMethodNotSupportedException;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -38,6 +40,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
 import java.io.InputStream;
 import java.util.List;
 
@@ -52,7 +55,7 @@
     public static final String RESOURCE_PATH = "/identifiableObjects";
 
     @Override
-    public List<IdentifiableObject> getEntity( String uid )
+    public List<IdentifiableObject> getEntity( String uid, WebOptions options )
     {
         List<IdentifiableObject> identifiableObjects = Lists.newArrayList();
         Optional<IdentifiableObject> optional = Optional.fromNullable( manager.get( uid ) );

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java	2014-10-23 10:07:41 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/user/UserController.java	2014-11-07 18:23:57 +0000
@@ -138,7 +138,7 @@
     }
 
     @Override
-    protected List<User> getEntity( String uid )
+    protected List<User> getEntity( String uid, WebOptions options )
     {
         List<User> users = Lists.newArrayList();
         Optional<User> user = Optional.fromNullable( userService.getUser( uid ) );