=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetOptionsByDataElementAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetOptionsByDataElementAction.java 2013-08-23 16:05:01 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetOptionsByDataElementAction.java 2013-09-11 09:50:12 +0000 @@ -32,8 +32,6 @@ import org.apache.commons.lang.StringUtils; import org.apache.struts2.ServletActionContext; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementService; import org.hisp.dhis.option.OptionService; import org.hisp.dhis.option.OptionSet; import org.hisp.dhis.util.ContextUtils; @@ -49,18 +47,11 @@ implements Action { private static Integer MAX_OPTIONS_DISPLAYED = 30; + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - private OptionService optionService; public void setOptionService( OptionService optionService ) @@ -104,23 +95,22 @@ public String execute() { query = StringUtils.trimToNull( query ); - - DataElement dataElement = dataElementService.getDataElement( id ); - OptionSet optionSet = dataElement.getOptionSet(); + OptionSet optionSet = optionService.getOptionSet( id ); // --------------------------------------------------------------------- // If the query is null and the option set has not changed since last // request we can tell the client to use its cached response (304) // --------------------------------------------------------------------- - boolean isNotModified = ( query == null && ContextUtils.isNotModified( ServletActionContext.getRequest(), ServletActionContext.getResponse(), optionSet ) ); - + boolean isNotModified = (query == null && ContextUtils.isNotModified( ServletActionContext.getRequest(), + ServletActionContext.getResponse(), optionSet )); + if ( !isNotModified && optionSet != null ) { options = optionService.getOptions( optionSet.getId(), query, MAX_OPTIONS_DISPLAYED ); } - + return SUCCESS; } } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2013-09-10 18:29:50 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2013-09-11 09:50:12 +0000 @@ -149,7 +149,6 @@ id="org.hisp.dhis.caseentry.action.caseentry.GetOptionsByDataElementAction" class="org.hisp.dhis.caseentry.action.caseentry.GetOptionsByDataElementAction" scope="prototype"> -