dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #36345
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18612: InputUtils, removed unused code
------------------------------------------------------------
revno: 18612
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-03-16 14:56:13 +0100
message:
InputUtils, removed unused code
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/InputUtils.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/utils/InputUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/InputUtils.java 2015-03-16 13:49:22 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/utils/InputUtils.java 2015-03-16 13:56:13 +0000
@@ -34,7 +34,6 @@
import javax.servlet.http.HttpServletResponse;
import org.hisp.dhis.common.IdentifiableObjectManager;
-import org.hisp.dhis.dataelement.CategoryOptionGroup;
import org.hisp.dhis.dataelement.DataElementCategoryCombo;
import org.hisp.dhis.dataelement.DataElementCategoryOption;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
@@ -130,98 +129,4 @@
return attributeOptionCombo;
}
-
- /**
- * Validates and retrieves a single category option group. 409 conflict as
- * status code along with a textual message will be set on the response in
- * case of invalid input.
- *
- * @param response the servlet response.
- * @param cog the category option group query string.
- * @return the set of category option groups, null if the input was
- * missing or an empty set if the input was invalid.
- */
- public Set<CategoryOptionGroup> getAttributeOptionGroup( HttpServletResponse response, String cog )
- {
- Set<String> groups = new HashSet<>();
-
- groups.add(cog);
-
- return getAttributeOptionGroups( response, groups );
- }
-
- /**
- * Validates and retrieves a set of category option groups. 409 conflict as
- * status code along with a textual message will be set on the response in
- * case of invalid input.
- *
- * @param response the servlet response.
- * @param cog the category option group query string set.
- * @return the set of category option groups, null if the input was
- * missing or an empty set if the input was invalid.
- */
- public Set<CategoryOptionGroup> getAttributeOptionGroups( HttpServletResponse response, Set<String> cog )
- {
- Set<CategoryOptionGroup> groups = null;
-
- if ( cog != null )
- {
- groups = new HashSet<>();
-
- for ( String id : cog )
- {
- if ( "undefined".compareTo( id ) != 0 )
- {
- CategoryOptionGroup categoryOptionGroup = categoryService.getCategoryOptionGroup( id );
-
- if ( categoryOptionGroup == null )
- {
- ContextUtils.conflictResponse( response, "Illegal category option group identifier: " + cog );
- return null;
- }
-
- groups.add( categoryOptionGroup );
- }
- }
- }
-
- return groups;
- }
-
- /**
- * Validates and retrieves a set of category options. 409 conflict as
- * status code along with a textual message will be set on the response in
- * case of invalid input.
- *
- * @param response the servlet response.
- * @param cp the category option query string.
- * @return the set of category option groups, null if the input was
- * missing or an empty set if the input was invalid.
- */
- public Set<DataElementCategoryOption> getAttributeOptions( HttpServletResponse response, String cp )
- {
- Set<DataElementCategoryOption> options = null;
-
- if ( cp != null )
- {
- Set<String> opts = ContextUtils.getQueryParamValues( cp );
-
- options = new HashSet<>();
-
- for ( String id : opts )
- {
- DataElementCategoryOption categoryOption = categoryService.getDataElementCategoryOption( id );
-
- if ( categoryOption == null )
- {
- ContextUtils.conflictResponse( response, "Illegal category option identifier: " + id );
- return null;
- }
-
- options.add( categoryOption );
- }
- }
-
- return options;
- }
}