dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #34757
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17829: minor importer fixes
------------------------------------------------------------
revno: 17829
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-12-29 16:51:39 +0100
message:
minor importer fixes
modified:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.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/metadata/importers/DefaultIdentifiableObjectImporter.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2014-12-29 14:05:40 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java 2014-12-29 15:51:39 +0000
@@ -40,8 +40,10 @@
import org.hisp.dhis.attribute.AttributeValue;
import org.hisp.dhis.common.BaseIdentifiableObject;
import org.hisp.dhis.common.IdentifiableObject;
+import org.hisp.dhis.common.IdentifiableObjectManager;
import org.hisp.dhis.common.NameableObject;
import org.hisp.dhis.dashboard.DashboardItem;
+import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryDimension;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementOperand;
@@ -69,7 +71,6 @@
import org.hisp.dhis.program.ProgramTrackedEntityAttribute;
import org.hisp.dhis.program.ProgramValidation;
import org.hisp.dhis.schema.SchemaService;
-import org.hisp.dhis.security.PasswordManager;
import org.hisp.dhis.system.util.ReflectionUtils;
import org.hisp.dhis.trackedentity.TrackedEntity;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
@@ -144,6 +145,9 @@
@Autowired
private DataElementCategoryService categoryService;
+ @Autowired
+ private IdentifiableObjectManager manager;
+
//-------------------------------------------------------------------------------------------------------
// Constructor
//-------------------------------------------------------------------------------------------------------
@@ -896,7 +900,7 @@
saveDataElementOperands( object, "compulsoryDataElementOperands", compulsoryDataElementOperands );
saveDataElementOperands( object, "greyedFields", greyedFields );
saveDataElementOperands( object, "dataElementOperands", dataElementOperands );
- // saveProgramStageDataElements( object, programStageDataElements );
+ saveProgramStageDataElements( object, programStageDataElements );
saveProgramTrackedEntityAttributes( object, programTrackedEntityAttributes );
saveCategoryDimensions( object, categoryDimensions );
}
@@ -1243,7 +1247,10 @@
if ( persisted == null )
{
- programStageDataElementService.addProgramStageDataElement( programStageDataElement );
+ if ( programStageDataElement.getDataElement() != null && programStageDataElement.getProgramStage() != null )
+ {
+ programStageDataElementService.addProgramStageDataElement( programStageDataElement );
+ }
}
else
{