dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #37859
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19330: make sure that importService get one fresh ObjectBridge for every import, reuse this bridge for e...
------------------------------------------------------------
revno: 19330
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-06-10 10:15:14 +0700
message:
make sure that importService get one fresh ObjectBridge for every import, reuse this bridge for every dxf2 importer object
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml
--
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/metadata/DefaultImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java 2015-05-30 13:36:07 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultImportService.java 2015-06-10 03:15:14 +0000
@@ -34,9 +34,9 @@
import org.hisp.dhis.cache.HibernateCacheManager;
import org.hisp.dhis.common.IdentifiableObject;
import org.hisp.dhis.common.MergeStrategy;
-import org.hisp.dhis.dxf2.common.ImportOptions;
import org.hisp.dhis.commons.timer.SystemTimer;
import org.hisp.dhis.commons.timer.Timer;
+import org.hisp.dhis.dxf2.common.ImportOptions;
import org.hisp.dhis.importexport.ImportStrategy;
import org.hisp.dhis.scheduling.TaskId;
import org.hisp.dhis.schema.Schema;
@@ -261,7 +261,7 @@
if ( importer != null )
{
- return importer.importObjects( user, objects, importOptions );
+ return importer.importObjects( user, objects, objectBridge, importOptions );
}
else
{
@@ -278,7 +278,7 @@
if ( importer != null )
{
- return importer.importObject( user, object, importOptions );
+ return importer.importObject( user, object, objectBridge, importOptions );
}
else
{
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java 2015-02-17 06:00:52 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/Importer.java 2015-06-10 03:15:14 +0000
@@ -48,7 +48,7 @@
* @param options Import options
* @return ImportConflict instance if a conflict occurred, if not null
*/
- ImportTypeSummary importObject( User user, T object, ImportOptions options );
+ ImportTypeSummary importObjects( User user, List<T> objects, ObjectBridge objectBridge, ImportOptions options );
/**
* Import a collection of objects.
@@ -57,7 +57,7 @@
* @param options Import options
* @return List of all the ImportConflicts encountered
*/
- ImportTypeSummary importObjects( User user, List<T> objects, ImportOptions options );
+ ImportTypeSummary importObject( User user, T object, ObjectBridge objectBridge, ImportOptions options );
/**
* Can this importer handle a certain Class type?
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2015-05-30 13:36:07 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2015-06-10 03:15:14 +0000
@@ -163,8 +163,9 @@
//-------------------------------------------------------------------------------------------------------
@Override
- public ImportTypeSummary importObjects( User user, List<T> objects, ImportOptions options )
+ public ImportTypeSummary importObjects( User user, List<T> objects, ObjectBridge objectBridge, ImportOptions options )
{
+ this.objectBridge = objectBridge;
this.options = options;
this.summaryType = new ImportTypeSummary( importerClass.getSimpleName() );
@@ -193,8 +194,9 @@
}
@Override
- public ImportTypeSummary importObject( User user, T object, ImportOptions options )
+ public ImportTypeSummary importObject( User user, T object, ObjectBridge objectBridge, ImportOptions options )
{
+ this.objectBridge = objectBridge;
this.options = options;
this.summaryType = new ImportTypeSummary( importerClass.getSimpleName() );
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml 2015-06-10 01:56:46 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/resources/META-INF/dhis/beans.xml 2015-06-10 03:15:14 +0000
@@ -24,9 +24,11 @@
<bean id="org.hisp.dhis.dxf2.metadata.ExportService" class="org.hisp.dhis.dxf2.metadata.DefaultExportService" scope="prototype" />
- <bean id="org.hisp.dhis.dxf2.metadata.ImportService" class="org.hisp.dhis.dxf2.metadata.DefaultImportService" scope="prototype" />
+ <bean id="org.hisp.dhis.dxf2.metadata.ImportService" class="org.hisp.dhis.dxf2.metadata.DefaultImportService" scope="prototype">
+ <aop:scoped-proxy proxy-target-class="false" />
+ </bean>
- <bean id="org.hisp.dhis.dxf2.metadata.ObjectBridge" class="org.hisp.dhis.dxf2.metadata.DefaultObjectBridge" />
+ <bean id="org.hisp.dhis.dxf2.metadata.ObjectBridge" class="org.hisp.dhis.dxf2.metadata.DefaultObjectBridge" scope="prototype"/>
<bean id="org.hisp.dhis.dxf2.datavalueset.DataValueSetService"
class="org.hisp.dhis.dxf2.datavalueset.DefaultDataValueSetService" />