dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #43265
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21966: Add importMode to ObjectBundle/Params
------------------------------------------------------------
revno: 21966
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-02-15 12:57:10 +0700
message:
Add importMode to ObjectBundle/Params
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundle.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.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
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundle.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundle.java 2016-02-11 09:13:07 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundle.java 2016-02-15 05:57:10 +0000
@@ -30,6 +30,7 @@
import org.hisp.dhis.common.IdentifiableObject;
import org.hisp.dhis.common.MergeMode;
+import org.hisp.dhis.importexport.ImportStrategy;
import org.hisp.dhis.preheat.Preheat;
import org.hisp.dhis.preheat.PreheatIdentifier;
import org.hisp.dhis.preheat.PreheatMode;
@@ -50,6 +51,8 @@
private final PreheatMode preheatMode;
+ private final ImportStrategy importMode;
+
private final MergeMode mergeMode;
private Preheat preheat = new Preheat();
@@ -60,6 +63,7 @@
{
this.objectBundleMode = params.getObjectBundleMode();
this.preheatIdentifier = params.getPreheatIdentifier();
+ this.importMode = params.getImportMode();
this.preheatMode = params.getPreheatMode();
this.mergeMode = params.getMergeMode();
}
@@ -79,6 +83,11 @@
return preheatMode;
}
+ public ImportStrategy getImportMode()
+ {
+ return importMode;
+ }
+
public MergeMode getMergeMode()
{
return mergeMode;
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.java 2016-02-11 09:13:07 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata2/objectbundle/ObjectBundleParams.java 2016-02-15 05:57:10 +0000
@@ -30,6 +30,7 @@
import org.hisp.dhis.common.IdentifiableObject;
import org.hisp.dhis.common.MergeMode;
+import org.hisp.dhis.importexport.ImportStrategy;
import org.hisp.dhis.preheat.PreheatIdentifier;
import org.hisp.dhis.preheat.PreheatMode;
import org.hisp.dhis.preheat.PreheatParams;
@@ -50,6 +51,8 @@
private PreheatMode preheatMode = PreheatMode.REFERENCE;
+ private ImportStrategy importMode = ImportStrategy.CREATE_AND_UPDATE;
+
private MergeMode mergeMode = MergeMode.MERGE;
private Map<Class<? extends IdentifiableObject>, List<IdentifiableObject>> objects = new HashMap<>();
@@ -90,6 +93,16 @@
this.preheatMode = preheatMode;
}
+ public ImportStrategy getImportMode()
+ {
+ return importMode;
+ }
+
+ public void setImportMode( ImportStrategy importMode )
+ {
+ this.importMode = importMode;
+ }
+
public MergeMode getMergeMode()
{
return mergeMode;