=== removed directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation' === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/AddCaseAggregationConditionAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/AddCaseAggregationConditionAction.java 2016-01-04 02:27:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/AddCaseAggregationConditionAction.java 1970-01-01 00:00:00 +0000 @@ -1,162 +0,0 @@ -package org.hisp.dhis.trackedentity.action.caseaggregation; - -/* - * Copyright (c) 2004-2016, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.apache.commons.lang3.StringUtils; - -import org.hisp.dhis.caseaggregation.CaseAggregationCondition; -import org.hisp.dhis.caseaggregation.CaseAggregationConditionService; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataelement.DataElementCategoryService; -import org.hisp.dhis.dataelement.DataElementService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * - * @version AddCaseAggregationConditionAction.java Nov 18, 2010 10:39:42 AM - */ -public class AddCaseAggregationConditionAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private CaseAggregationConditionService aggregationConditionService; - - private DataElementService dataElementService; - - private DataElementCategoryService dataElementCategoryService; - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String operator; - - private String aggregationCondition; - - private String name; - - private String aggregationDataElementId; - - private Integer deSumId; - - private Integer dataSetId; - - // ------------------------------------------------------------------------- - // Getters && Setters - // ------------------------------------------------------------------------- - - public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService ) - { - this.aggregationConditionService = aggregationConditionService; - } - - public Integer getDataSetId() - { - return dataSetId; - } - - public void setDataSetId( Integer dataSetId ) - { - this.dataSetId = dataSetId; - } - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService ) - { - this.dataElementCategoryService = dataElementCategoryService; - } - - public void setAggregationDataElementId( String aggregationDataElementId ) - { - this.aggregationDataElementId = aggregationDataElementId; - } - - public void setOperator( String operator ) - { - this.operator = operator; - } - - public void setAggregationCondition( String aggregationCondition ) - { - this.aggregationCondition = aggregationCondition; - } - - public void setDeSumId( Integer deSumId ) - { - this.deSumId = deSumId; - } - - public void setName( String name ) - { - this.name = name; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - String[] ids = aggregationDataElementId.split( "\\." ); - - DataElement aggregationDataElement = dataElementService.getDataElement( Integer.parseInt( ids[0] ) ); - - DataElementCategoryOptionCombo optionCombo = dataElementCategoryService - .getDataElementCategoryOptionCombo( Integer.parseInt( ids[1] ) ); - - CaseAggregationCondition condition = new CaseAggregationCondition(); - - condition.setName( StringUtils.trimToNull( name ) ); - condition.setAggregationExpression( aggregationCondition ); - condition.setOperator( operator ); - condition.setAggregationDataElement( aggregationDataElement ); - condition.setOptionCombo( optionCombo ); - - if ( deSumId != null ) - { - DataElement deSum = dataElementService.getDataElement( deSumId ); - condition.setDeSum( deSum ); - } - aggregationConditionService.addCaseAggregationCondition( condition ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggConditionDescriptionAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggConditionDescriptionAction.java 2016-01-04 02:27:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggConditionDescriptionAction.java 1970-01-01 00:00:00 +0000 @@ -1,88 +0,0 @@ -package org.hisp.dhis.trackedentity.action.caseaggregation; - -/* - * Copyright (c) 2004-2016, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.caseaggregation.CaseAggregationConditionService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * @version $ID : GetAggConditionDescriptionAction.java Jan 11, 2011 9:14:19 PM - * $ - */ -public class GetAggConditionDescriptionAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependency - // ------------------------------------------------------------------------- - - private CaseAggregationConditionService aggregationConditionService; - - // ------------------------------------------------------------------------- - // Input && Output - // ------------------------------------------------------------------------- - - private String condition; - - private String description; - - // ------------------------------------------------------------------------- - // Getters && Setters - // ------------------------------------------------------------------------- - - public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService ) - { - this.aggregationConditionService = aggregationConditionService; - } - - public String getDescription() - { - return description; - } - - public void setCondition( String condition ) - { - this.condition = condition; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - description = aggregationConditionService.getConditionDescription( condition ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggPSDataElementsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggPSDataElementsAction.java 2016-01-04 02:27:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAggPSDataElementsAction.java 1970-01-01 00:00:00 +0000 @@ -1,105 +0,0 @@ -package org.hisp.dhis.trackedentity.action.caseaggregation; - -/* - * Copyright (c) 2004-2016, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import com.opensymphony.xwork2.Action; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.program.ProgramStage; -import org.hisp.dhis.program.ProgramStageService; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Iterator; -import java.util.List; - -/** - * @author Chau Thu Tran - * @version $Id: GetAggPSDataElementsAction.java Dec 22, 2011 9:24:49 AM $ - */ -public class GetAggPSDataElementsAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - @Autowired - private ProgramStageService programStageService; - - // ------------------------------------------------------------------------- - // Input & Output - // ------------------------------------------------------------------------- - - private Integer psId; - - public void setPsId( Integer psId ) - { - this.psId = psId; - } - - public Integer getPsId() - { - return psId; - } - - private List dataElementList; - - public List getDataElementList() - { - return dataElementList; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - { - ProgramStage stage = programStageService.getProgramStage( psId ); - - dataElementList = stage.getAllDataElements(); - - if ( dataElementList != null && !dataElementList.isEmpty() ) - { - Iterator deIterator = dataElementList.iterator(); - - while ( deIterator.hasNext() ) - { - DataElement de = deIterator.next(); - - if ( !de.getValueType().isNumeric() ) - { - deIterator.remove(); - } - } - } - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAllCaseAggregationConditionAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAllCaseAggregationConditionAction.java 2016-01-04 02:27:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetAllCaseAggregationConditionAction.java 1970-01-01 00:00:00 +0000 @@ -1,136 +0,0 @@ -package org.hisp.dhis.trackedentity.action.caseaggregation; - -/* - * Copyright (c) 2004-2016, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; - -import org.hisp.dhis.caseaggregation.CaseAggregationCondition; -import org.hisp.dhis.caseaggregation.CaseAggregationConditionService; -import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataset.DataSet; -import org.hisp.dhis.dataset.DataSetService; -import org.hisp.dhis.paging.ActionPagingSupport; - -/** - * @author Chau Thu Tran - * - * @version GetAllCaseAggregationConditionAction.java Nov 18, 2010 10:42:01 AM - */ -public class GetAllCaseAggregationConditionAction - extends ActionPagingSupport -{ - // ------------------------------------------------------------------------- - // Dependency - // ------------------------------------------------------------------------- - - private CaseAggregationConditionService aggregationConditionService; - - public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService ) - { - this.aggregationConditionService = aggregationConditionService; - } - - public DataSetService dataSetService; - - public void setDataSetService( DataSetService dataSetService ) - { - this.dataSetService = dataSetService; - } - - // ------------------------------------------------------------------------- - // Getters && Setters - // ------------------------------------------------------------------------- - - private Integer dataSetId; - - public void setDataSetId( Integer dataSetId ) - { - this.dataSetId = dataSetId; - } - - public Integer getDataSetId() - { - return dataSetId; - } - - private String key; - - public void setKey( String key ) - { - this.key = key; - } - - private Collection aggregationConditions; - - public Collection getAggregationConditions() - { - return aggregationConditions; - } - - private List dataSets; - - public List getDataSets() - { - return dataSets; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - Collection _datasets = new HashSet<>(); - aggregationConditions = aggregationConditionService.getAllCaseAggregationCondition(); - - for ( CaseAggregationCondition aggCondition : aggregationConditions ) - { - DataElement dataElement = aggCondition.getAggregationDataElement(); - - _datasets.addAll( dataElement.getDataSets() ); - } - - dataSets = new ArrayList<>( _datasets ); - Collections.sort( dataSets, IdentifiableObjectNameComparator.INSTANCE ); - - Collection dataElements = ( dataSetId == null ) ? null : dataSetService.getDataSet( dataSetId ).getDataElements(); - this.paging = createPaging( aggregationConditionService.countCaseAggregationCondition( dataElements, key ) ); - aggregationConditions = aggregationConditionService.getCaseAggregationConditions( dataElements, key, - paging.getStartPos(), paging.getPageSize() ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetCaseAggregationConditionAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetCaseAggregationConditionAction.java 2016-01-04 02:27:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetCaseAggregationConditionAction.java 1970-01-01 00:00:00 +0000 @@ -1,98 +0,0 @@ -package org.hisp.dhis.trackedentity.action.caseaggregation; - -/* - * Copyright (c) 2004-2016, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.hisp.dhis.caseaggregation.CaseAggregationCondition; -import org.hisp.dhis.caseaggregation.CaseAggregationConditionService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * - * @version GetCaseAggregationConditionAction.java Nov 18, 2010 10:42:01 AM - */ -public class GetCaseAggregationConditionAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependency - // ------------------------------------------------------------------------- - - private CaseAggregationConditionService aggregationConditionService; - - // ------------------------------------------------------------------------- - // Input && Output - // ------------------------------------------------------------------------- - - private Integer id; - - private CaseAggregationCondition caseAggregation; - - private String description; - - // ------------------------------------------------------------------------- - // Getters && Setters - // ------------------------------------------------------------------------- - - public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService ) - { - this.aggregationConditionService = aggregationConditionService; - } - - public void setId( Integer id ) - { - this.id = id; - } - - public String getDescription() - { - return description; - } - - public CaseAggregationCondition getCaseAggregation() - { - return caseAggregation; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - throws Exception - { - caseAggregation = aggregationConditionService.getCaseAggregationCondition( id ); - - description = aggregationConditionService.getConditionDescription( caseAggregation.getAggregationExpression() ); - - return SUCCESS; - } -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetDataElementsByDataSetAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetDataElementsByDataSetAction.java 2016-01-04 02:27:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetDataElementsByDataSetAction.java 1970-01-01 00:00:00 +0000 @@ -1,118 +0,0 @@ -package org.hisp.dhis.trackedentity.action.caseaggregation; - -/* - * Copyright (c) 2004-2016, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.Collections; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementService; -import org.hisp.dhis.dataset.DataSet; -import org.hisp.dhis.dataset.DataSetService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * - * @version GetDataElementsByDataSetAction.java 9:43:55 PM Jul 6, 2012 $ - */ -public class GetDataElementsByDataSetAction - implements Action -{ - private static Integer MAX_DATAELEMENTS_DISPLAYED = 30; - - // ------------------------------------------------------------------------- - // Dependency - // ------------------------------------------------------------------------- - - private DataSetService dataSetService; - - public void setDataSetService( DataSetService dataSetService ) - { - this.dataSetService = dataSetService; - } - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer id; - - public void setId( Integer id ) - { - this.id = id; - } - - private String query; - - public void setQuery( String query ) - { - this.query = query; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private List dataElements; - - public List getDataElements() - { - return dataElements; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - { - DataSet dataSet = dataSetService.getDataSet( id ); - - query = StringUtils.trimToNull( query ); - - dataElements = dataElementService.getDataElements( dataSet, query, MAX_DATAELEMENTS_DISPLAYED ); - - Collections.sort( dataElements, IdentifiableObjectNameComparator.INSTANCE ); - - return SUCCESS; - } - -} === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetOptionsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetOptionsAction.java 2016-01-04 02:27:49 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/caseaggregation/GetOptionsAction.java 1970-01-01 00:00:00 +0000 @@ -1,115 +0,0 @@ -package org.hisp.dhis.trackedentity.action.caseaggregation; - -/* - * Copyright (c) 2004-2016, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.apache.struts2.ServletActionContext; -import org.hisp.dhis.option.Option; -import org.hisp.dhis.option.OptionService; -import org.hisp.dhis.option.OptionSet; -import org.hisp.dhis.util.ContextUtils; -import org.springframework.beans.factory.annotation.Autowired; - -import com.opensymphony.xwork2.Action; - -/** - * @author Chau Thu Tran - * - * @version $ GetOptionsAction.java Aug 9, 2014 10:31:19 PM $ - */ -public class GetOptionsAction - implements Action -{ - private static Integer MAX_OPTIONS_DISPLAYED = 30; - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private OptionService optionService; - - @Autowired - public void setOptionService( OptionService optionService ) - { - this.optionService = optionService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String id; - - public void setId( String id ) - { - this.id = id; - } - - private String query; - - public void setQuery( String query ) - { - this.query = query; - } - - // ------------------------------------------------------------------------- - // Output - // ------------------------------------------------------------------------- - - private List