← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21660: minor fix in CategoryOptionComboController, don't need custom getEntityList anymore

 

------------------------------------------------------------
revno: 21660
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-01-08 13:55:43 +0700
message:
  minor fix in CategoryOptionComboController, don't need custom getEntityList anymore
modified:
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/CategoryOptionComboController.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/dataelement/CategoryOptionComboController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/CategoryOptionComboController.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/dataelement/CategoryOptionComboController.java	2016-01-08 06:55:43 +0000
@@ -28,21 +28,12 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
-import org.hisp.dhis.query.Order;
 import org.hisp.dhis.schema.descriptors.CategoryOptionComboSchemaDescriptor;
 import org.hisp.dhis.webapi.controller.AbstractCrudController;
-import org.hisp.dhis.webapi.webdomain.WebMetaData;
-import org.hisp.dhis.webapi.webdomain.WebOptions;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.List;
-
 /**
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
@@ -51,26 +42,4 @@
 public class CategoryOptionComboController
     extends AbstractCrudController<DataElementCategoryOptionCombo>
 {
-    // need custom implementation of this since DataElementCategoryOptionCombo does not persist
-    // name (clashes with getAllOrderedName)
-    // FIXME add paging also for this?
-    @Override
-    protected List<DataElementCategoryOptionCombo> getEntityList( WebMetaData metaData, WebOptions options, List<String> filters, List<Order> orders )
-    {
-        List<DataElementCategoryOptionCombo> entityList;
-
-        Date lastUpdated = options.getLastUpdated();
-
-        if ( lastUpdated != null )
-        {
-            entityList = new ArrayList<>( manager.getByLastUpdated( getEntityClass(), lastUpdated ) );
-        }
-        else
-        {
-            entityList = new ArrayList<>( manager.getAll( getEntityClass() ) );
-            Collections.sort( entityList, new IdentifiableObjectNameComparator() );
-        }
-
-        return entityList;
-    }
 }