=== removed directory 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamerge' === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamerge/DataMergeService.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamerge/DataMergeService.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamerge/DataMergeService.java 1970-01-01 00:00:00 +0000 @@ -1,44 +0,0 @@ -package org.hisp.dhis.datamerge; - -/* - * Copyright (c) 2004-2015, 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.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.organisationunit.OrganisationUnit; - -/** - * @author Lars Helge Overland - */ -public interface DataMergeService -{ - void eliminateDuplicateDataElement( DataElement destDataElement, DataElementCategoryOptionCombo destCategoryOptionCombo, - DataElement sourceDataElement, DataElementCategoryOptionCombo sourceCategoryOptionCombo ); - - void mergeOrganisationUnits( OrganisationUnit dest, OrganisationUnit source ); -} === removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamerge/DataMergeStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamerge/DataMergeStore.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datamerge/DataMergeStore.java 1970-01-01 00:00:00 +0000 @@ -1,58 +0,0 @@ -package org.hisp.dhis.datamerge; - -/* - * Copyright (c) 2004-2015, 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.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.organisationunit.OrganisationUnit; - -/** - * @author Lars Helge Overland - */ -public interface DataMergeStore -{ - /** - * Eliminate duplicate data element and its data values. - * - * @param destDataElement the destination data element. - * @param destCategoryOptionCombo the destination category option combo. - * @param sourceDataElement the source data element. - * @param sourceCategoryOptionCombo the source category option combo. - */ - void eliminateDuplicateDataElement( DataElement destDataElement, DataElementCategoryOptionCombo destCategoryOptionCombo, - DataElement sourceDataElement, DataElementCategoryOptionCombo sourceCategoryOptionCombo ); - - /** - * Merge organisation units and their data values. - * - * @param dest the destination organisation unit. - * @param source the source organisation unit. - */ - void mergeOrganisationUnits( OrganisationUnit dest, OrganisationUnit source ); -} === removed directory 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge' === removed file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/DefaultDataMergeService.java' --- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/DefaultDataMergeService.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/DefaultDataMergeService.java 1970-01-01 00:00:00 +0000 @@ -1,137 +0,0 @@ -package org.hisp.dhis.datamerge; - -/* - * Copyright (c) 2004-2015, 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.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hisp.dhis.common.DeleteNotAllowedException; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.dataelement.DataElementService; -import org.hisp.dhis.hierarchy.HierarchyViolationException; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; -import org.springframework.transaction.annotation.Transactional; - -/** - * @author Lars Helge Overland - */ -public class DefaultDataMergeService - implements DataMergeService -{ - private static final Log log = LogFactory.getLog( DefaultDataMergeService.class ); - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private DataMergeStore dataMergeStore; - - public void setDataMergeStore( DataMergeStore dataMergeStore ) - { - this.dataMergeStore = dataMergeStore; - } - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - // ------------------------------------------------------------------------- - // DataMergeService implementation - // ------------------------------------------------------------------------- - - @Override - @Transactional - public void eliminateDuplicateDataElement( DataElement destDataElement, DataElementCategoryOptionCombo destCategoryOptionCombo, - DataElement sourceDataElement, DataElementCategoryOptionCombo sourceCategoryOptionCombo ) - { - // --------------------------------------------------------------------- - // Eliminate duplicates - // --------------------------------------------------------------------- - - dataMergeStore.eliminateDuplicateDataElement( destDataElement, destCategoryOptionCombo, sourceDataElement, sourceCategoryOptionCombo ); - - // --------------------------------------------------------------------- - // Delete source - // --------------------------------------------------------------------- - - try - { - dataElementService.deleteDataElement( sourceDataElement ); - } - catch ( DeleteNotAllowedException ex ) - { - log.info( "Not deleting data element because it has custom dimensions and more data associated with it" ); - } - } - - @Override - @Transactional - public void mergeOrganisationUnits( OrganisationUnit dest, OrganisationUnit source ) - { - // --------------------------------------------------------------------- - // Merge source data with destination - // --------------------------------------------------------------------- - - dataMergeStore.mergeOrganisationUnits( dest, source ); - - // --------------------------------------------------------------------- - // Set parent of children of destination to source - // --------------------------------------------------------------------- - - for ( OrganisationUnit child : source.getChildren() ) - { - child.setParent( dest ); - - organisationUnitService.updateOrganisationUnit( child ); - } - - // --------------------------------------------------------------------- - // Delete source - // --------------------------------------------------------------------- - - try - { - organisationUnitService.deleteOrganisationUnit( source ); - } - catch ( HierarchyViolationException ex ) - { - } - } -} === removed directory 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/jdbc' === removed file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/jdbc/JdbcDataMergeStore.java' --- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/jdbc/JdbcDataMergeStore.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/jdbc/JdbcDataMergeStore.java 1970-01-01 00:00:00 +0000 @@ -1,148 +0,0 @@ -package org.hisp.dhis.datamerge.jdbc; - -/* - * Copyright (c) 2004-2015, 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.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; -import org.hisp.dhis.datamerge.DataMergeStore; -import org.hisp.dhis.jdbc.StatementBuilder; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.springframework.jdbc.core.JdbcTemplate; - -/** - * @author Lars Helge Overland - */ -public class JdbcDataMergeStore - implements DataMergeStore -{ - private static final Log log = LogFactory.getLog( JdbcDataMergeStore.class ); - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private JdbcTemplate jdbcTemplate; - - public void setJdbcTemplate( JdbcTemplate jdbcTemplate ) - { - this.jdbcTemplate = jdbcTemplate; - } - - private StatementBuilder statementBuilder; - - public void setStatementBuilder( StatementBuilder statementBuilder ) - { - this.statementBuilder = statementBuilder; - } - - // ------------------------------------------------------------------------- - // DataMergeStore implementation - // ------------------------------------------------------------------------- - - @Override - public void eliminateDuplicateDataElement( DataElement destDataElement, DataElementCategoryOptionCombo destCategoryOptionCombo, - DataElement sourceDataElement, DataElementCategoryOptionCombo sourceCategoryOptionCombo ) - { - final int destDataElementId = destDataElement.getId(); - final int destCategoryOptionComboId = destCategoryOptionCombo.getId(); - final int sourceDataElementId = sourceDataElement.getId(); - final int sourceCategoryOptionComboId = sourceCategoryOptionCombo.getId(); - - // Move from source to destination where destination does not exist - - String sql = statementBuilder.getMoveFromSourceToDestination( destDataElementId, destCategoryOptionComboId, sourceDataElementId, sourceCategoryOptionComboId ); - log.info( sql ); - jdbcTemplate.execute( sql ); - - // Update destination with source where source is last update - - sql = statementBuilder.getUpdateDestination( destDataElementId, destCategoryOptionComboId, sourceDataElementId, sourceCategoryOptionComboId ); - log.info( sql ); - jdbcTemplate.execute( sql ); - - // Delete remaining source data value audits - - sql = "DELETE FROM datavalueaudit WHERE dataelementid=" + sourceDataElementId + " AND categoryoptioncomboid=" + sourceCategoryOptionComboId + ";"; - - log.info( sql ); - jdbcTemplate.execute( sql ); - - // Delete remaining source data values - - sql = "DELETE FROM datavalue WHERE dataelementid=" + sourceDataElementId + " AND categoryoptioncomboid=" + sourceCategoryOptionComboId + ";"; - - log.info( sql ); - jdbcTemplate.execute( sql ); - } - - @Override - public void mergeOrganisationUnits( OrganisationUnit dest, OrganisationUnit source ) - { - final int destId = dest.getId(); - final int sourceId = source.getId(); - - // Move from source to destination where destination does not exist - - String sql = statementBuilder.getMoveDataValueToDestination( sourceId, destId ); - log.info( sql ); - jdbcTemplate.execute( sql ); - - // Summarize destination and source where matching - - sql = statementBuilder.getSummarizeDestinationAndSourceWhereMatching( sourceId, destId ); - log.info( sql ); - jdbcTemplate.execute( sql ); - - // TODO also deal with bool and string - - // Delete remaining source data value audits - - sql = "DELETE FROM datavalueaudit WHERE organisationunitid=" + sourceId + ";"; - - log.info( sql ); - jdbcTemplate.execute( sql ); - - // Delete remaining source data values - - sql = "DELETE FROM datavalue WHERE sourceid=" + sourceId + ";"; - - log.info( sql ); - jdbcTemplate.execute( sql ); - - // Delete complete data set registrations - - sql = "DELETE FROM completedatasetregistration WHERE sourceid=" + sourceId + ";"; - - log.info( sql ); - jdbcTemplate.execute( sql ); - - } -} === modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml 2015-08-31 08:57:11 +0000 +++ dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml 2015-09-24 07:35:03 +0000 @@ -67,19 +67,6 @@ - - - - - - - - - - - - - === modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/StaticContentController.java' --- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/StaticContentController.java 2015-09-24 07:15:17 +0000 +++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/StaticContentController.java 2015-09-24 07:35:03 +0000 @@ -170,7 +170,6 @@ throw new WebMessageException( (WebMessageUtils .error( "Error saving file, make sure dhis_home envoirement variable is set" )) ); } - } /** === removed directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/duplicatedataelimination' === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/duplicatedataelimination/EliminateDuplicateDataAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/duplicatedataelimination/EliminateDuplicateDataAction.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/duplicatedataelimination/EliminateDuplicateDataAction.java 1970-01-01 00:00:00 +0000 @@ -1,133 +0,0 @@ -package org.hisp.dhis.dataadmin.action.duplicatedataelimination; - -/* - * Copyright (c) 2004-2015, 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.logging.Log; -import org.apache.commons.logging.LogFactory; -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.datamerge.DataMergeService; - -import com.opensymphony.xwork2.Action; - -/** - * @author Lars Helge Overland - */ -public class EliminateDuplicateDataAction - implements Action -{ - private static final Log log = LogFactory.getLog( EliminateDuplicateDataAction.class ); - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private DataMergeService dataMergeService; - - public void setDataMergeService( DataMergeService dataMergeService ) - { - this.dataMergeService = dataMergeService; - } - - private DataElementService dataElementService; - - public void setDataElementService( DataElementService dataElementService ) - { - this.dataElementService = dataElementService; - } - - private DataElementCategoryService categoryService; - - public void setCategoryService( DataElementCategoryService categoryService ) - { - this.categoryService = categoryService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private Integer dataElementToEliminate; - - public void setDataElementToEliminate( Integer dataElementToEliminate ) - { - this.dataElementToEliminate = dataElementToEliminate; - } - - private Integer categoryOptionComboToEliminate; - - public void setCategoryOptionComboToEliminate( Integer categoryOptionComboToEliminate ) - { - this.categoryOptionComboToEliminate = categoryOptionComboToEliminate; - } - - private Integer dataElementToKeep; - - public void setDataElementToKeep( Integer dataElementToKeep ) - { - this.dataElementToKeep = dataElementToKeep; - } - - private Integer categoryOptionComboToKeep; - - public void setCategoryOptionComboToKeep( Integer categoryOptionComboToKeep ) - { - this.categoryOptionComboToKeep = categoryOptionComboToKeep; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - { - DataElement dataElementEliminate = dataElementService.getDataElement( dataElementToEliminate ); - - DataElementCategoryOptionCombo categoryOptionComboEliminate = categoryService.getDataElementCategoryOptionCombo( categoryOptionComboToEliminate ); - - DataElement dataElementKeep = dataElementService.getDataElement( dataElementToKeep ); - - DataElementCategoryOptionCombo categoryOptionComboKeep = categoryService.getDataElementCategoryOptionCombo( categoryOptionComboToKeep ); - - log.info( "Eliminating: " + dataElementEliminate + " " + categoryOptionComboEliminate ); - log.info( "Keeping: " + dataElementKeep + " " + categoryOptionComboKeep ); - - if ( !( dataElementToEliminate == dataElementToKeep && categoryOptionComboEliminate == categoryOptionComboKeep ) ) - { - dataMergeService.eliminateDuplicateDataElement( dataElementKeep, categoryOptionComboKeep, dataElementEliminate, categoryOptionComboEliminate ); - } - - log.info( "Elimination done" ); - - return SUCCESS; - } -} === removed directory 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/organisationunitmerge' === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/organisationunitmerge/MergeOrganisationUnitsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/organisationunitmerge/MergeOrganisationUnitsAction.java 2015-01-17 07:41:26 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/organisationunitmerge/MergeOrganisationUnitsAction.java 1970-01-01 00:00:00 +0000 @@ -1,103 +0,0 @@ -package org.hisp.dhis.dataadmin.action.organisationunitmerge; - -/* - * Copyright (c) 2004-2015, 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.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.hisp.dhis.datamerge.DataMergeService; -import org.hisp.dhis.organisationunit.OrganisationUnit; -import org.hisp.dhis.organisationunit.OrganisationUnitService; - -/** - * @author Lars Helge Overland - */ -public class MergeOrganisationUnitsAction - implements Action -{ - private static final Log log = LogFactory.getLog( MergeOrganisationUnitsAction.class ); - - // ------------------------------------------------------------------------- - // Dependencies - // ------------------------------------------------------------------------- - - private DataMergeService dataMergeService; - - public void setDataMergeService( DataMergeService dataMergeService ) - { - this.dataMergeService = dataMergeService; - } - - private OrganisationUnitService organisationUnitService; - - public void setOrganisationUnitService( OrganisationUnitService organisationUnitService ) - { - this.organisationUnitService = organisationUnitService; - } - - // ------------------------------------------------------------------------- - // Input - // ------------------------------------------------------------------------- - - private String organisationUnitToEliminate; - - public void setOrganisationUnitToEliminate( String organisationUnitToEliminate ) - { - this.organisationUnitToEliminate = organisationUnitToEliminate; - } - - private String organisationUnitToKeep; - - public void setOrganisationUnitToKeep( String organisationUnitToKeep ) - { - this.organisationUnitToKeep = organisationUnitToKeep; - } - - // ------------------------------------------------------------------------- - // Action implementation - // ------------------------------------------------------------------------- - - @Override - public String execute() - { - OrganisationUnit eliminate = organisationUnitService.getOrganisationUnit( organisationUnitToEliminate ); - OrganisationUnit keep = organisationUnitService.getOrganisationUnit( organisationUnitToKeep ); - - log.info( "Merging " + eliminate + " into " + keep ); - - if ( !(organisationUnitToEliminate.equals( organisationUnitToKeep )) ) - { - dataMergeService.mergeOrganisationUnits( keep, eliminate ); - } - - log.info( "Merging complete" ); - - return SUCCESS; - } -} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2015-08-30 14:21:41 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/META-INF/dhis/beans.xml 2015-09-24 07:35:03 +0000 @@ -63,15 +63,6 @@ class="org.hisp.dhis.dataadmin.action.databrowser.ExportResultAction" scope="prototype" /> - - - - - - - - - - - - - - - F_VIEW_DATABROWSER - - - - /main.vm - - /dhis-web-maintenance-dataadmin/organisationUnitMergeForm.vm - - /dhis-web-maintenance-dataadmin/menu.vm - ../dhis-web-commons/oust/oust.js,javascript/organisationUnitMerge.js - F_MERGE_ORGANISATION_UNITS - - - - displayOrganisationUnitMergeForm.action - F_MERGE_ORGANISATION_UNITS - - - - - - /main.vm - /dhis-web-maintenance-dataadmin/duplicateDataEliminationForm.vm - /dhis-web-maintenance-dataadmin/menu.vm - javascript/duplicateDataElimination.js - F_ELIMINATE_DUPLICATE_DATA_ELEMENTS - - - - displayDuplicateDataEliminationForm.action - F_ELIMINATE_DUPLICATE_DATA_ELEMENTS - - === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/duplicateDataEliminationForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/duplicateDataEliminationForm.vm 2011-07-07 10:02:27 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/duplicateDataEliminationForm.vm 1970-01-01 00:00:00 +0000 @@ -1,64 +0,0 @@ - - -

$i18n.getString( "duplicate_data_elimination" ) #openHelp( "duplicateDataElimination" )

- -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1.$i18n.getString( "select_the_data_element_to_eliminate" )
[$i18n.getString( "not_selected" )]
- -
 
2.$i18n.getString( "select_the_data_element_to_keep" )
[$i18n.getString( "not_selected" )]
- -
 
3.$i18n.getString( "eliminate" )
- - -
- -

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm 2015-03-13 18:42:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/index.vm 2015-09-24 07:35:03 +0000 @@ -7,8 +7,6 @@ #introListImgItem( "displayResourceTableForm.action" "resource_table" "resourcetable" ) #introListImgItem( "locale.action" "locale" "datadictionary" ) #introListImgItem( "sqlView.action" "sql_view" "sqlview" ) - #introListImgItem( "displayOrganisationUnitMergeForm.action" "organisation_unit_merge" "organisationunitmerge" ) - #introListImgItem( "displayDuplicateDataEliminationForm.action" "duplicate_data_elimination" "duplicatedataelimination" ) #introListImgItem( "viewStatistics.action" "data_statistics" "datastatistics" ) #introListImgItem( "lockException.action" "lock_exception" "datalocking" ) #introListImgItem( "getMinMaxValidationParams.action" "min_max_value_generation" "minmaxvaluegeneration" ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm 2015-03-13 18:42:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/menu.vm 2015-09-24 07:35:03 +0000 @@ -8,8 +8,6 @@
  • $i18n.getString( "resource_table" ) 
  • $i18n.getString( "locale" ) 
  • $i18n.getString( "sql_view" ) 
  • -
  • $i18n.getString( "organisation_unit_merge" ) 
  • -
  • $i18n.getString( "duplicate_data_elimination" ) 
  • $i18n.getString( "data_statistics" ) 
  • $i18n.getString( "lock_exception" ) 
  • $i18n.getString( "min_max_value_generation") 
  • === removed file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/organisationUnitMergeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/organisationUnitMergeForm.vm 2015-08-03 22:22:21 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/organisationUnitMergeForm.vm 1970-01-01 00:00:00 +0000 @@ -1,65 +0,0 @@ - - - -

    $i18n.getString( "organisation_unit_merge" ) #openHelp( "organisationUnitMerge" )

    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    1.$i18n.getString( "select_the_org_unit_to_eliminate" )
    [$i18n.getString( "not_selected" )]
    - -
     
    2.$i18n.getString( "select_the_org_unit_to_keep" )
    [$i18n.getString( "not_selected" )]
    - -
     
    3.$i18n.getString( "merge" )
    - - -
    - -