=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java' --- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2012-05-07 14:29:01 +0000 +++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2012-05-07 14:57:43 +0000 @@ -219,6 +219,7 @@ IdentifiableProperty orgUnitIdScheme = dataValueSet.getOrgUnitIdScheme() != null ? IdentifiableProperty.valueOf( dataValueSet.getOrgUnitIdScheme().toUpperCase() ) : importOptions.getOrgUnitIdScheme(); boolean dryRun = dataValueSet.getDryRun() != null ? dataValueSet.getDryRun() : importOptions.isDryRun(); ImportStrategy strategy = dataValueSet.getStrategy() != null ? ImportStrategy.valueOf( dataValueSet.getStrategy() ) : importOptions.getImportStrategy(); + boolean skipExistingCheck = importOptions.isSkipExistingCheck(); Map dataElementMap = identifiableObjectManager.getIdMap( DataElement.class, dataElementIdScheme ); Map orgUnitMap = identifiableObjectManager.getIdMap( OrganisationUnit.class, orgUnitIdScheme ); @@ -312,7 +313,7 @@ internalValue.setComment( dataValue.getComment() ); internalValue.setFollowup( dataValue.getFollowup() ); - if ( batchHandler.objectExists( internalValue ) ) + if ( !skipExistingCheck && batchHandler.objectExists( internalValue ) ) { if ( NEW_AND_UPDATES.equals( strategy ) || UPDATES.equals( strategy ) ) { === modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ImportOptions.java' --- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ImportOptions.java 2012-04-20 18:31:48 +0000 +++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/ImportOptions.java 2012-05-07 14:57:43 +0000 @@ -42,8 +42,10 @@ private boolean dryRun = false; private ImportStrategy importStrategy; + + private boolean skipExistingCheck; - private static final ImportOptions DEFAULT_OPTIONS = new ImportOptions( IdentifiableProperty.UID, IdentifiableProperty.UID, false, ImportStrategy.NEW_AND_UPDATES ); + private static final ImportOptions DEFAULT_OPTIONS = new ImportOptions( IdentifiableProperty.UID, IdentifiableProperty.UID, false, ImportStrategy.NEW_AND_UPDATES, false ); public static ImportOptions getDefaultImportOptions() { @@ -59,12 +61,13 @@ this.importStrategy = importStrategy; } - public ImportOptions( IdentifiableProperty dataElementIdScheme, IdentifiableProperty orgUnitIdScheme, boolean dryRun, ImportStrategy importStrategy ) + public ImportOptions( IdentifiableProperty dataElementIdScheme, IdentifiableProperty orgUnitIdScheme, boolean dryRun, ImportStrategy importStrategy, boolean skipExistingCheck ) { this.dataElementIdScheme = dataElementIdScheme; this.orgUnitIdScheme = orgUnitIdScheme; this.dryRun = dryRun; this.importStrategy = importStrategy; + this.skipExistingCheck = skipExistingCheck; } //-------------------------------------------------------------------------- @@ -91,6 +94,11 @@ return importStrategy != null ? importStrategy : ImportStrategy.NEW_AND_UPDATES; } + public boolean isSkipExistingCheck() + { + return skipExistingCheck; + } + //-------------------------------------------------------------------------- // Set methods //-------------------------------------------------------------------------- @@ -114,11 +122,16 @@ { this.importStrategy = strategy != null ? ImportStrategy.valueOf( strategy.toUpperCase() ) : null; } - + + public void setSkipExistingCheck( boolean skipExistingCheck ) + { + this.skipExistingCheck = skipExistingCheck; + } + @Override public String toString() { return "[data element id scheme: " + dataElementIdScheme + ", org unit id scheme: " + - orgUnitIdScheme + ", dry run: " + dryRun + ", strategy: " + importStrategy + "]"; + orgUnitIdScheme + ", dry run: " + dryRun + ", strategy: " + importStrategy + ", skip check: " + skipExistingCheck + "]"; } } === modified file 'dhis-2/dhis-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java' --- dhis-2/dhis-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java 2012-04-15 20:48:08 +0000 +++ dhis-2/dhis-dxf2/src/test/java/org/hisp/dhis/dxf2/datavalueset/DataValueSetServiceTest.java 2012-05-07 14:57:43 +0000 @@ -203,7 +203,7 @@ public void testImportDataValuesXmlDryRun() throws Exception { - ImportOptions options = new ImportOptions( UID, UID, true, NEW_AND_UPDATES ); + ImportOptions options = new ImportOptions( UID, UID, true, NEW_AND_UPDATES, false ); dataValueSetService.saveDataValueSet( new ClassPathResource( "datavalueset/dataValueSetB.xml" ).getInputStream(), options ); @@ -217,7 +217,7 @@ public void testImportDataValuesXmlUpdatesOnly() throws Exception { - ImportOptions options = new ImportOptions( UID, UID, false, UPDATES ); + ImportOptions options = new ImportOptions( UID, UID, false, UPDATES, false ); dataValueSetService.saveDataValueSet( new ClassPathResource( "datavalueset/dataValueSetB.xml" ).getInputStream(), options ); === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java' --- dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java 2012-04-30 20:10:16 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/java/org/hisp/dhis/importexport/action/datavalue/ImportDataValueAction.java 2012-05-07 14:57:43 +0000 @@ -107,6 +107,13 @@ { this.orgUnitIdScheme = orgUnitIdScheme; } + + private boolean skipExistingCheck; + + public void setSkipExistingCheck( boolean skipExistingCheck ) + { + this.skipExistingCheck = skipExistingCheck; + } private String importFormat; @@ -139,7 +146,7 @@ TaskId taskId = new TaskId( TaskCategory.DATAVALUE_IMPORT, currentUserService.getCurrentUser() ); - ImportOptions options = new ImportOptions( dataElementIdScheme, orgUnitIdScheme, dryRun, strategy ); + ImportOptions options = new ImportOptions( dataElementIdScheme, orgUnitIdScheme, dryRun, strategy, skipExistingCheck ); log.info( options ); === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties 2012-04-30 20:10:16 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties 2012-05-07 14:57:43 +0000 @@ -303,4 +303,7 @@ uid=UID name=Name code=Code -more_options=More options \ No newline at end of file +more_options=More options +existing_record_check=Existing record check +check_safe_recommended=Check (safe + recommended) +skip_check_fast=Skip check (fast) \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importDataValue.vm' --- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importDataValue.vm 2012-04-30 20:10:16 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/importDataValue.vm 2012-05-07 14:57:43 +0000 @@ -12,14 +12,14 @@ $i18n.getString( "dry_run" ) - $i18n.getString( "strategy" ) - @@ -31,7 +31,7 @@ $i18n.getString( "data_element_id_scheme" ) - @@ -39,12 +39,19 @@ $i18n.getString( "org_unit_id_scheme" ) - + + $i18n.getString( "existing_record_check" ) + + === modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importDataValue.js' --- dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importDataValue.js 2012-04-30 20:10:16 +0000 +++ dhis-2/dhis-web/dhis-web-importexport/src/main/webapp/dhis-web-importexport/javascript/importDataValue.js 2012-05-07 14:57:43 +0000 @@ -15,7 +15,7 @@ function toggleOptions() { $( ".moreOptions" ).toggle(); - $.toggleCss( "inputCriteria", "height", "144px", "200px" ); + $.toggleCss( "inputCriteria", "height", "144px", "230px" ); } function pingNotificationsTimeout()