← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17318: CSV import, supporting code and name for org unit parent

 

------------------------------------------------------------
revno: 17318
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-10-30 16:26:55 -0400
message:
  CSV import, supporting code and name for org unit parent
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/csv/DefaultCsvImportService.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/csv/DefaultCsvImportService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/csv/DefaultCsvImportService.java	2014-10-16 06:17:19 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/csv/DefaultCsvImportService.java	2014-10-30 20:26:55 +0000
@@ -292,7 +292,7 @@
             {
                 OrganisationUnit object = new OrganisationUnit();
                 setIdentifiableObject( object, values );
-                String parentUid = getSafe( values, 3, null, 11 );
+                String parentUid = getSafe( values, 3, null, 230 ); // Could be UID, code, name
                 object.setShortName( getSafe( values, 4, object.getName(), 50 ) );
                 object.setDescription( getSafe( values, 5, null, null ) );
                 object.setUuid( getSafe( values, 6, null, 36 ) );
@@ -312,6 +312,9 @@
                 {
                     OrganisationUnit parent = new OrganisationUnit();
                     parent.setUid( parentUid );
+                    parent.setCode( parentUid );
+                    parent.setName( parentUid );
+                    
                     object.setParent( parent );
                 }