=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue' === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValue.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValue.java 2009-09-27 22:30:31 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValue.java 1970-01-01 00:00:00 +0000 @@ -1,216 +0,0 @@ -package org.hisp.dhis.customvalue; - -/* - * Copyright (c) 2004-2009, 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.io.Serializable; - -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataset.DataSet; - -/** - * @author Latifov Murodillo Abdusamadovich - * - * @version $Id$ - */ -public class CustomValue - implements Serializable -{ - /** - * The unique identifier for this CustomValue - */ - private int id; - - /** - * Dataset object value to be assigned to - */ - private DataSet dataSet; - - /** - * DataElement object value to be assigned to - */ - private DataElement dataElement; - - /** - * DataElementCategoryOptionCombo object value to be assigned to - */ - private DataElementCategoryOptionCombo optionCombo; - - /** - * Custom value - */ - private String customValue; - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - public CustomValue() - { - } - - // ------------------------------------------------------------------------- - // Getters and setters - // ------------------------------------------------------------------------- - - public int getId() - { - return id; - } - - public void setId( int id ) - { - this.id = id; - } - - public DataSet getDataSet() - { - return dataSet; - } - - public void setDataSet( DataSet dataSet ) - { - this.dataSet = dataSet; - } - - public DataElement getDataElement() - { - return dataElement; - } - - public void setDataElement( DataElement dataElement ) - { - this.dataElement = dataElement; - } - - public DataElementCategoryOptionCombo getOptionCombo() - { - return optionCombo; - } - - public void setOptionCombo( DataElementCategoryOptionCombo optionCombo ) - { - this.optionCombo = optionCombo; - } - - public String getCustomValue() - { - return customValue; - } - - public void setCustomValue( String customValue ) - { - this.customValue = customValue; - } - - @Override - public int hashCode() - { - final int prime = 31; - - int result = 1; - - result = prime * result + ( ( customValue == null) ? 0 : customValue.hashCode() ); - result = prime * result + ( ( dataElement == null) ? 0 : dataElement.hashCode() ); - result = prime * result + ( ( dataSet == null) ? 0 : dataSet.hashCode() ); - result = prime * result + ( ( optionCombo == null) ? 0 : optionCombo.hashCode() ); - - return result; - } - - @Override - public boolean equals( Object object ) - { - if ( this == object ) - { - return true; - } - - if ( object == null ) - { - return false; - } - - if ( getClass() != object.getClass() ) - { - return false; - } - - final CustomValue other = (CustomValue) object; - - if ( customValue == null ) - { - if ( other.customValue != null ) - { - return false; - } - } - else if ( !customValue.equals( other.customValue ) ) - { - return false; - } - - if ( dataElement == null ) - { - if ( other.dataElement != null ) - { - return false; - } - } - else if ( !dataElement.equals( other.dataElement ) ) - { - return false; - } - - if ( dataSet == null ) - { - if ( other.dataSet != null ) - { - return false; - } - } - else if ( !dataSet.equals( other.dataSet ) ) - { - return false; - } - - if ( optionCombo == null ) - { - if ( other.optionCombo != null ) - { - return false; - } - } - else if ( !optionCombo.equals( other.optionCombo ) ) - { - return false; - } - - return true; - } -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValueService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValueService.java 2009-06-19 14:50:41 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValueService.java 1970-01-01 00:00:00 +0000 @@ -1,103 +0,0 @@ -package org.hisp.dhis.customvalue; - -/* - * Copyright (c) 2004-2009, 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.Collection; - -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryCombo; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataset.DataSet; - -/** - * @author Latifov Murodillo Abdusamadovich - * - * @version $Id$ - */ -public interface CustomValueService -{ - String ID = CustomValue.class.getName(); - - /** - * - * @param customValue - * @return The generated unique identifier for this CustomValue. - */ - int addCustomValue( CustomValue customValue ); - - /** - * Deletes a CustomValue. - * - * @param customValue. The CustomValue to delete. - */ - void deleteCustomValue( CustomValue customValue ); - - /** - * Get all CustomValues by DataSet. - * - * @return A collection containing all CustomValues within given dataset. - */ - Collection getCustomValuesByDataSet( DataSet dataSet ); - - /** - * Get all CustomValues by DataElement. - * - * @return A collection containing all CustomValues within given dataelement. - */ - Collection getCustomValuesByDataElement( DataElement dataElement ); - - /** - * Get all CustomValues by DataElementCategoryCombo. - * - * @return A collection containing all CustomValues within given categorycombo. - */ - Collection getCustomValuesByCategoryCombo( DataElementCategoryCombo categoryCombo ); - - /** - * Get all CustomValues by DataSet, DataElement, DataElementCategoryCombo. - * - * @return A collection containing all CustomValues in a given criteria. - */ - Collection getCustomValues( DataSet dataSet, DataElement dataElement, - DataElementCategoryOptionCombo dataElementCategoryOptionCombo ); - - /** - * Get CustomValue by Id. - * - * @return CustomValue object. - */ - CustomValue getCustomValue( int id ); - - /** - * Get CustomValue by value. - * - * @return A collection containing found CustomValues. - */ - Collection findCustomValues( String searchValue ); - -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValueStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValueStore.java 2009-07-05 20:32:22 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/customvalue/CustomValueStore.java 1970-01-01 00:00:00 +0000 @@ -1,84 +0,0 @@ -package org.hisp.dhis.customvalue; - -/* - * Copyright (c) 2004-2009, 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.Collection; - -import org.hisp.dhis.common.GenericStore; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryCombo; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataset.DataSet; - -/** - * @author Latifov Murodillo Abdusamadovich - * - * @version $Id$ - */ -public interface CustomValueStore - extends GenericStore -{ - String ID = CustomValue.class.getName(); - - /** - * Get all CustomValues by DataSet. - * - * @return A collection containing all CustomValues. - */ - Collection getByDataSet( DataSet dataSet ); - - /** - * Get all CustomValues by DataElement. - * - * @return A collection containing all CustomValues. - */ - Collection getByDataElement( DataElement dataElement ); - - /** - * Get all CustomValues by DataElementCategoryCombo. - * - * @return A collection containing all CustomValues. - */ - Collection getByCategoryCombo( DataElementCategoryCombo categoryCombo ); - - /** - * Get all CustomValues by DataSet, DataElement, DataElementCategoryCombo. - * - * @return A collection containing all CustomValues. - */ - Collection get( DataSet dataSet, DataElement dataElement, - DataElementCategoryOptionCombo dataElementCategoryOptionCombo ); - - /** - * Get CustomValue by value. - * - * @return A collection containing found CustomValues. - */ - Collection find( String searchValue ); - -} === removed directory 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/customvalue' === removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/customvalue/DefaultCustomValueService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/customvalue/DefaultCustomValueService.java 2010-06-03 10:32:02 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/customvalue/DefaultCustomValueService.java 1970-01-01 00:00:00 +0000 @@ -1,107 +0,0 @@ -package org.hisp.dhis.customvalue; - -/* - * Copyright (c) 2004-2009, 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.Collection; - -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryCombo; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataset.DataSet; -import org.springframework.transaction.annotation.Transactional; - -/** - * @author Latifov Murodillo Abdusamadovich - * - * @version $Id$ - */ -@Transactional -public class DefaultCustomValueService - implements CustomValueService -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private CustomValueStore customValueStore; - - public void setCustomValueStore( CustomValueStore customValueStore ) - { - this.customValueStore = customValueStore; - } - - // ------------------------------------------------------------------------- - // CustomValueService implementation - // ------------------------------------------------------------------------- - - public int addCustomValue( CustomValue customValue ) - { - return customValueStore.save( customValue ); - } - - public void deleteCustomValue( CustomValue customValue ) - { - customValueStore.delete( customValue ); - } - - public Collection getCustomValues( DataSet dataSet ) - { - return customValueStore.getByDataSet( dataSet ); - } - - public Collection getCustomValuesByCategoryCombo( DataElementCategoryCombo categoryCombo ) - { - return customValueStore.getByCategoryCombo( categoryCombo ); - } - - public Collection getCustomValuesByDataElement( DataElement dataElement ) - { - return customValueStore.getByDataElement( dataElement ); - } - - public Collection getCustomValuesByDataSet( DataSet dataSet ) - { - return customValueStore.getByDataSet( dataSet ); - } - - public CustomValue getCustomValue( int id ) - { - return customValueStore.get( id ); - } - - public Collection getCustomValues( DataSet dataSet, DataElement dataElement, - DataElementCategoryOptionCombo dataElementCategoryOptionCombo ) - { - return customValueStore.get( dataSet, dataElement, dataElementCategoryOptionCombo ); - } - - public Collection findCustomValues( String searchValue ) - { - return customValueStore.find( searchValue ); - } -} === removed directory 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/customvalue/hibernate' === removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/customvalue/hibernate/HibernateCustomValueStore.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/customvalue/hibernate/HibernateCustomValueStore.java 2009-07-05 20:32:22 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/customvalue/hibernate/HibernateCustomValueStore.java 1970-01-01 00:00:00 +0000 @@ -1,87 +0,0 @@ -package org.hisp.dhis.customvalue.hibernate; - -/* - * Copyright (c) 2004-2009, 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.Collection; - -import org.hibernate.criterion.MatchMode; -import org.hibernate.criterion.Restrictions; -import org.hisp.dhis.customvalue.CustomValue; -import org.hisp.dhis.customvalue.CustomValueStore; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryCombo; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataset.DataSet; -import org.hisp.dhis.hibernate.HibernateGenericStore; - -/** - * @author Latifov Murodillo Abdusamadovich - * - * @version $Id$ - */ -public class HibernateCustomValueStore - extends HibernateGenericStore implements CustomValueStore -{ - // ------------------------------------------------------------------------- - // CustomValueStore implementation - // ------------------------------------------------------------------------- - - @SuppressWarnings( "unchecked" ) - public Collection getByDataSet( DataSet dataSet ) - { - return getCriteria( Restrictions.eq( "dataSet", dataSet ) ).list(); - } - - @SuppressWarnings( "unchecked" ) - public Collection getByCategoryCombo( DataElementCategoryCombo categoryCombo ) - { - return getCriteria( Restrictions.eq( "optionCombo", categoryCombo ) ).list(); - } - - @SuppressWarnings( "unchecked" ) - public Collection getByDataElement( DataElement dataElement ) - { - return getCriteria( Restrictions.eq( "dataElement", dataElement ) ).list(); - } - - @SuppressWarnings( "unchecked" ) - public Collection get( DataSet dataSet, DataElement dataElement, - DataElementCategoryOptionCombo dataElementCategoryOptionCombo ) - { - return getCriteria( - Restrictions.eq( "dataSet", dataSet ), - Restrictions.eq( "dataElement", dataElement ), - Restrictions.eq( "optionCombo", dataElementCategoryOptionCombo ) ).list(); - } - - @SuppressWarnings( "unchecked" ) - public Collection find( String searchValue ) - { - return getCriteria( Restrictions.like( "customValue", searchValue, MatchMode.ANYWHERE ) ).list(); - } -} === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2011-01-21 16:22:50 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2011-01-25 22:15:46 +0000 @@ -83,6 +83,7 @@ executeSql( "DROP TABLE sectionmembers" ); executeSql( "DROP TABLE reporttable_categoryoptioncombos" ); executeSql( "DROP TABLE dashboardcontent_datamartexports" ); + executeSql( "DROP TABLE customvalue" ); executeSql( "ALTER TABLE dataelementcategoryoption drop column categoryid" ); executeSql( "ALTER TABLE reporttable DROP column dimensiontype" ); executeSql( "ALTER TABLE categoryoptioncombo DROP COLUMN displayorder" ); === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2011-01-20 06:23:12 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2011-01-25 22:15:46 +0000 @@ -18,12 +18,6 @@ - - - - - @@ -216,7 +210,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java 2011-01-25 14:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java 2011-01-25 22:15:46 +0000 @@ -35,8 +35,6 @@ import java.util.List; import java.util.Map; -import org.hisp.dhis.customvalue.CustomValue; -import org.hisp.dhis.customvalue.CustomValueService; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementCategory; import org.hisp.dhis.dataelement.DataElementCategoryCombo; @@ -74,18 +72,6 @@ // Dependencies // ------------------------------------------------------------------------- - private CustomValueService customValueService; - - public CustomValueService getCustomValueService() - { - return customValueService; - } - - public void setCustomValueService( CustomValueService customValueService ) - { - this.customValueService = customValueService; - } - private DataElementService dataElementService; public void setDataElementService( DataElementService dataElementService ) @@ -175,13 +161,6 @@ // Output // ------------------------------------------------------------------------- - private List customValues = new ArrayList(); - - public List getCustomValues() - { - return customValues; - } - private Map> orderedDataElements = new HashMap>(); public Map> getOrderedDataElements() @@ -347,8 +326,6 @@ DataSet dataSet = selectedStateManager.getSelectedDataSet(); - customValues = (List) customValueService.getCustomValuesByDataSet( dataSet ); - Period period = selectedStateManager.getSelectedPeriod(); DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period ); === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SectionFormAction.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SectionFormAction.java 2011-01-25 14:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SectionFormAction.java 2011-01-25 22:15:46 +0000 @@ -34,8 +34,6 @@ import java.util.List; import java.util.Map; -import org.hisp.dhis.customvalue.CustomValue; -import org.hisp.dhis.customvalue.CustomValueService; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementCategory; import org.hisp.dhis.dataelement.DataElementCategoryCombo; @@ -69,18 +67,6 @@ // Dependencies // ------------------------------------------------------------------------- - private CustomValueService customValueService; - - public CustomValueService getCustomValueService() - { - return customValueService; - } - - public void setCustomValueService( CustomValueService customValueService ) - { - this.customValueService = customValueService; - } - private DataValueService dataValueService; public void setDataValueService( DataValueService dataValueService ) @@ -127,13 +113,6 @@ // Input/output // ------------------------------------------------------------------------- - private List customValues = new ArrayList(); - - public List getCustomValues() - { - return customValues; - } - private List
sections; public List
getSections() @@ -300,8 +279,6 @@ DataSet dataSet = selectedStateManager.getSelectedDataSet(); - customValues = (List) customValueService.getCustomValuesByDataSet( dataSet ); - Period period = selectedStateManager.getSelectedPeriod(); Collection dataElements = new ArrayList(); === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java 2011-01-25 14:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java 2011-01-25 22:15:46 +0000 @@ -29,19 +29,15 @@ import static org.hisp.dhis.dataelement.DataElement.VALUE_TYPE_BOOL; import static org.hisp.dhis.dataelement.DataElement.VALUE_TYPE_INT; -import static org.hisp.dhis.dataelement.DataElement.VALUE_TYPE_STRING; import java.util.Collection; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.hisp.dhis.customvalue.CustomValue; -import org.hisp.dhis.customvalue.CustomValueService; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataset.DataSet; import org.hisp.dhis.datavalue.DataValue; @@ -60,17 +56,6 @@ private static final String EMPTY = ""; // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private CustomValueService customValueService; - - public void setCustomValueService( CustomValueService customValueService ) - { - this.customValueService = customValueService; - } - - // ------------------------------------------------------------------------- // DataEntryScreenManager implementation // ------------------------------------------------------------------------- @@ -78,12 +63,6 @@ Collection dataValues, Map minMaxMap, String disabled, I18n i18n, DataSet dataSet ) { // --------------------------------------------------------------------- - // Populating Custom Value data - // --------------------------------------------------------------------- - - List customValues = (List) customValueService.getCustomValuesByDataSet( dataSet ); - - // --------------------------------------------------------------------- // Inline Javascript to add to HTML before outputting // --------------------------------------------------------------------- @@ -167,10 +146,7 @@ // Insert value of data element in output code // ------------------------------------------------------------- - boolean customValueExists = customValuesExists( customValues, dataElementId, optionComboId ); - - if ( dataElement.getType().equals( DataElement.VALUE_TYPE_BOOL ) - || (dataElement.getType().equals( VALUE_TYPE_STRING ) && customValueExists) ) + if ( dataElement.getType().equals( DataElement.VALUE_TYPE_BOOL ) ) { dataElementCode = dataElementCode.replace( "input", "select" ); dataElementCode = dataElementCode.replaceAll( "value=\".*?\"", "" ); @@ -259,32 +235,6 @@ appendCode += ""; } - else if ( dataElement.getType().equals( VALUE_TYPE_STRING ) && customValueExists ) - { - appendCode += jsCodeForCombos; - - appendCode += ""; - - for ( CustomValue customValue : customValues ) - { - if ( dataElementId == customValue.getDataElement().getId() - && optionComboId == customValue.getOptionCombo().getId() ) - { - if ( dataElementValue.equalsIgnoreCase( customValue.getCustomValue() ) ) - { - appendCode += ""; - } - else - { - appendCode += ""; - } - } - } - - appendCode += ""; - } else { appendCode += jsCodeForInputs; @@ -330,25 +280,6 @@ // ------------------------------------------------------------------------- /** - * Tests whether the given Collection of CustomValues contains a CustomValue - * with the given data element identifier and category option combo id. - */ - private boolean customValuesExists( Collection customValues, int dataElementId, - int categoryOptionComboId ) - { - for ( CustomValue customValue : customValues ) - { - if ( dataElementId == customValue.getDataElement().getId() - && categoryOptionComboId == customValue.getOptionCombo().getId() ) - { - return true; - } - } - - return false; - } - - /** * Returns the value of the DataValue in the Collection of DataValues with * the given data element identifier and category option combo id. */ === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2011-01-25 14:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/META-INF/dhis/beans.xml 2011-01-25 22:15:46 +0000 @@ -24,9 +24,7 @@ - - - + @@ -66,7 +64,6 @@ - @@ -74,7 +71,6 @@ - === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2011-01-25 14:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2011-01-25 22:15:46 +0000 @@ -63,24 +63,6 @@ - #elseif( $dataElement.type == "string" ) - #set( $coun = 0 ) - #foreach($customValue in $customValues) - #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id) - #set( $coun = $coun +1 ) - #end - #end - #if( $coun > 0 ) - - #else - - #end #else #end === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2011-01-25 14:49:09 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2011-01-25 22:15:46 +0000 @@ -83,25 +83,6 @@ - #elseif( $dataElement.type == "string" ) - #set( $coun = 0 ) - #foreach($customValue in $customValues) - #if($dataElement.id == $customValue.dataElement.id && $optionCombo.id == $customValue.optionCombo.id) - #set( $coun = $coun +1 ) - #end - #end - #if( $coun > 0 ) - - #else - - #end #else #end === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/GetCustomValuesAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/GetCustomValuesAction.java 2009-10-18 22:44:41 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/dataentryform/GetCustomValuesAction.java 1970-01-01 00:00:00 +0000 @@ -1,257 +0,0 @@ -package org.hisp.dhis.dataset.action.dataentryform; - -/* - * Copyright (c) 2004-2009, 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.Iterator; -import java.util.List; - -import org.hisp.dhis.customvalue.CustomValue; -import org.hisp.dhis.customvalue.CustomValueService; -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 org.hisp.dhis.dataset.DataSet; -import org.hisp.dhis.dataset.DataSetService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Latifov Murodillo Abdusamadovich - * - * @version $Id$ - */ -public class GetCustomValuesAction - implements Action -{ - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private DataSetService dataSetService; - - public void setDataSetService( DataSetService dataSetService ) - { - this.dataSetService = dataSetService; - } - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - private DataElementCategoryService dataElementCategoryService; - - public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService ) - { - this.dataElementCategoryService = dataElementCategoryService; - } - - private CustomValueService customValueService; - - public void setCustomValueService( CustomValueService customValueService ) - { - this.customValueService = customValueService; - } - - // ------------------------------------------------------------------------- - // Getters & Setters - // ------------------------------------------------------------------------- - - private int customValueId; - - public int getCustomValueId() - { - return customValueId; - } - - public void setCustomValueId( int customValueId ) - { - this.customValueId = customValueId; - } - - private int dataElementId; - - public void setDataElementId( int dataElementId ) - { - this.dataElementId = dataElementId; - } - - private int dataSetId; - - public void setDataSetId( int dataSetId ) - { - this.dataSetId = dataSetId; - } - - public int getDataSetId() - { - return dataSetId; - } - - private int categoryOptionComboId; - - public int getCategoryOptionComboId() - { - return categoryOptionComboId; - } - - public void setCategoryOptionComboId( int categoryOptionComboId ) - { - this.categoryOptionComboId = categoryOptionComboId; - } - - private List customValueIds; - - public List getCustomValueIds() - { - return customValueIds; - } - - private List customValueNames; - - public List getCustomValueNames() - { - return customValueNames; - } - - private String operation; - - public String getOperation() - { - return operation; - } - - public void setOperation( String operation ) - { - this.operation = operation; - } - - private String value; - - public String getValue() - { - return value; - } - - public void setValue( String value ) - { - this.value = value; - } - - // ------------------------------------------------------------------------- - // Execute - // ------------------------------------------------------------------------- - - public String execute() - throws Exception - { - customValueIds = new ArrayList(); - customValueNames = new ArrayList(); - - DataSet dataSet = dataSetService.getDataSet( dataSetId ); - DataElement dataElement = dataElementService.getDataElement( dataElementId ); - DataElementCategoryOptionCombo dataElementCategoryOptionCombo = dataElementCategoryService - .getDataElementCategoryOptionCombo( categoryOptionComboId ); - - CustomValue customValue = new CustomValue(); - customValue.setDataSet( dataSet ); - customValue.setDataElement( dataElement ); - customValue.setOptionCombo( dataElementCategoryOptionCombo ); - - if ( operation.equalsIgnoreCase( "add" ) ) - { - customValue.setCustomValue( value ); - - customValueService.addCustomValue( customValue ); - } - - if ( operation.equalsIgnoreCase( "delete" ) ) - { - customValue = customValueService.getCustomValue( customValueId ); - customValueService.deleteCustomValue( customValue ); - } - - List customValues = null; - - if ( operation.equalsIgnoreCase( "find" ) ) - { - customValues = new ArrayList( customValueService.findCustomValues( value ) ); - } - else - { - customValues = new ArrayList( customValueService.getCustomValues( dataSet, dataElement, - dataElementCategoryOptionCombo ) ); - } - - Iterator customValueIterator = customValues.iterator(); - - if ( operation.equalsIgnoreCase( "find" ) ) - { - while ( customValueIterator.hasNext() ) - { - CustomValue customVal = customValueIterator.next(); - - if ( !customValueNames.contains( customVal.getCustomValue() ) ) - { - customValueIds.add( String.valueOf( customVal.getId() ) ); - customValueNames.add( customVal.getCustomValue() ); - } - } - } - else - { - while ( customValueIterator.hasNext() ) - { - CustomValue customVal = customValueIterator.next(); - - customValueIds.add( String.valueOf( customVal.getId() ) ); - customValueNames.add( customVal.getCustomValue() ); - } - } - if ( operation.equalsIgnoreCase( "delete" ) ) - { - customValueIds.remove( String.valueOf( customValue.getId() ) ); - customValueNames.remove( customValue.getCustomValue() ); - } - - if ( operation.equalsIgnoreCase( "add" ) ) - { - if ( !customValueNames.contains( customValue.getCustomValue() ) ) - { - customValueIds.remove( String.valueOf( customValue.getId() ) ); - customValueNames.remove( customValue.getCustomValue() ); - } - } - - return SUCCESS; - } -} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml 2011-01-25 21:25:39 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/resources/META-INF/dhis/beans.xml 2011-01-25 22:15:46 +0000 @@ -3,26 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> - - - - - - - - - - - - - - - - - - + /dhis-web-maintenance-dataset/index.vm /dhis-web-maintenance-dataset/menu.vm - - - - - /main.vm - /dhis-web-maintenance-dataset/editCustomValues.vm - javascript/dataSet.js - F_DATASET_UPDATE - - + @@ -290,12 +280,6 @@ /dhis-web-maintenance-dataset/responseOptionCombo.vm javascript/dataEntryForm.js,javascript/FCK/fckeditor.js - - - /dhis-web-maintenance-dataset/responseCustomValue.vm - javascript/dataEntryForm.js,javascript/FCK/fckeditor.js - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm 2011-01-20 05:24:17 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm 2011-01-25 22:15:46 +0000 @@ -14,7 +14,7 @@ - + @@ -29,9 +29,7 @@ $i18n.getString( 'define_associations' )$i18n.getString( 'edit' ) - - $i18n.getString( 'edit_custom_values' ) - + $i18n.getString( 'translation_translate' )$i18n.getString( 'design_data_entry_form' ) === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm 2010-09-25 20:13:04 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editCustomValues.vm 1970-01-01 00:00:00 +0000 @@ -1,746 +0,0 @@ - - - - - - - -

$i18n.getString( "manage_custom_values" )

- -
$i18n.getString( "name" )
- ## selectdataelement - ## select_optioncombo - - - - - - - - - - - - - - - - -
$i18n.getString( "selectdataelement" )$i18n.getString( "select_optioncombo" )
- - - - -
   - - -
- - - ## available_customvalue - ## select_customvalue - - - - - - - - - - - - -
$i18n.getString( "available_customvalue" )$i18n.getString( "select_customvalue" )
- - - -
- - - - - - - -
- - -
- - - === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm 2011-01-21 04:51:55 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm 2011-01-25 22:15:46 +0000 @@ -9,26 +9,19 @@ }); checkValueIsExist( "name", "validateDataSet.action", {dataSetId: function(){return jQuery("#dataSetId").val()}}); - checkValueIsExist( "shortName", "validateDataSet.action", {dataSetId: function(){return jQuery("#dataSetId").val()}} ); - checkValueIsExist( "code", "validateDataSet.action", {dataSetId: function(){return jQuery("#dataSetId").val()}}); }); var previousName = ''; -

$i18n.getString( "edit_dataset" )

-
-
- ## Labels - ## Input @@ -50,9 +43,6 @@
$i18n.getString( "dataset_details" )
-