dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16724
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6433: Moved ImportStrategy from import-export-service to dhis-api
------------------------------------------------------------
revno: 6433
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-03-29 09:45:12 +0200
message:
Moved ImportStrategy from import-export-service to dhis-api
renamed:
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportStrategy.java => dhis-2/dhis-api/src/main/java/org/hisp/dhis/importexport/ImportStrategy.java
modified:
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalue/DataValueService.java
dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalue/DefaultDataValueService.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/importexport/ImportStrategy.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== renamed file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportStrategy.java' => 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/importexport/ImportStrategy.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/ImportStrategy.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/importexport/ImportStrategy.java 2012-03-29 07:45:12 +0000
@@ -34,5 +34,6 @@
public enum ImportStrategy
{
NEW_AND_UPDATES,
- NEW_NO_UPDATES
+ NEW_NO_UPDATES,
+ UPDATES_NO_NEW
}
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalue/DataValueService.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalue/DataValueService.java 2012-03-28 18:27:56 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalue/DataValueService.java 2012-03-29 07:45:12 +0000
@@ -31,5 +31,5 @@
public interface DataValueService
{
- void saveDataValues( DataValues dataValues, IdentifiableProperty idScheme );
+ void saveDataValues( DataValues dataValues, IdentifiableProperty idScheme, boolean dryRun );
}
=== modified file 'dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalue/DefaultDataValueService.java'
--- dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalue/DefaultDataValueService.java 2012-03-29 07:25:53 +0000
+++ dhis-2/dhis-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalue/DefaultDataValueService.java 2012-03-29 07:45:12 +0000
@@ -63,7 +63,7 @@
private BatchHandlerFactory batchHandlerFactory;
@Transactional
- public void saveDataValues( DataValues dataValues, IdentifiableProperty idScheme )
+ public void saveDataValues( DataValues dataValues, IdentifiableProperty idScheme, boolean dryRun )
{
Map<String, DataElement> dataElementMap = identifiableObjectManager.getIdMap( DataElement.class, idScheme );
Map<String, OrganisationUnit> orgUnitMap = identifiableObjectManager.getIdMap( OrganisationUnit.class, idScheme );
@@ -114,11 +114,17 @@
if ( batchHandler.objectExists( internalValue ) )
{
- batchHandler.updateObject( internalValue );
+ if ( !dryRun )
+ {
+ batchHandler.updateObject( internalValue );
+ }
}
else
{
- batchHandler.addObject( internalValue );
+ if ( !dryRun )
+ {
+ batchHandler.addObject( internalValue );
+ }
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java 2012-03-28 18:28:57 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/DataValueController.java 2012-03-29 07:45:12 +0000
@@ -59,7 +59,7 @@
{
DataValues dataValues = JacksonUtils.fromXml( input, DataValues.class );
- dataValueService.saveDataValues( dataValues, IdentifiableObject.IdentifiableProperty.UID );
+ dataValueService.saveDataValues( dataValues, IdentifiableObject.IdentifiableProperty.UID, false );
ContextUtils.okResponse( response, "Data values saved successfully" );
}