← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11829: more fixes for meta-data import/export

 

------------------------------------------------------------
revno: 11829
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-08-28 14:33:54 +0200
message:
  more fixes for meta-data import/export
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/SetSelectedOrganisationUnitAction.java
  dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/SetSelectedOrganisationUnitAction.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	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/importers/DefaultIdentifiableObjectImporter.java	2013-08-28 12:33:54 +0000
@@ -403,7 +403,8 @@
 
         // make sure that the internalId is 0, so that the system will generate a ID
         object.setId( 0 );
-        object.setUser( user );
+        // object.setUser( user );
+        object.setUser( null );
 
         NonIdentifiableObjects nonIdentifiableObjects = new NonIdentifiableObjects();
         nonIdentifiableObjects.extract( object );

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/SetSelectedOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/SetSelectedOrganisationUnitAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/oust/action/SetSelectedOrganisationUnitAction.java	2013-08-28 12:33:54 +0000
@@ -28,14 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
-import java.util.HashSet;
-
+import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.oust.manager.SelectionTreeManager;
 
-import com.opensymphony.xwork2.Action;
+import java.util.Collection;
+import java.util.HashSet;
 
 /**
  * @author Torgeir Lorange Ostby
@@ -87,6 +86,12 @@
     public String execute()
         throws Exception
     {
+        if ( id == 0 )
+        {
+            selectionTreeManager.clearSelectedOrganisationUnits();
+            return SUCCESS;
+        }
+
         OrganisationUnit unit = organisationUnitService.getOrganisationUnit( id );
 
         if ( unit == null )
@@ -94,7 +99,7 @@
             throw new RuntimeException( "OrganisationUnit with id " + id + " doesn't exist" );
         }
 
-        selectedUnits = new HashSet<OrganisationUnit>( 1 );           
+        selectedUnits = new HashSet<OrganisationUnit>( 1 );
         selectedUnits.add( unit );
         selectionTreeManager.setSelectedOrganisationUnits( selectedUnits );
 

=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/SetSelectedOrganisationUnitAction.java'
--- dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/SetSelectedOrganisationUnitAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/main/java/org/hisp/dhis/ouwt/action/SetSelectedOrganisationUnitAction.java	2013-08-28 12:33:54 +0000
@@ -28,14 +28,13 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.Collection;
-import java.util.HashSet;
-
+import com.opensymphony.xwork2.Action;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
 import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
 
-import com.opensymphony.xwork2.Action;
+import java.util.Collection;
+import java.util.HashSet;
 
 /**
  * @author Torgeir Lorange Ostby
@@ -87,6 +86,12 @@
     public String execute()
         throws Exception
     {
+        if ( id == 0 )
+        {
+            selectionManager.clearSelectedOrganisationUnits();
+            return SUCCESS;
+        }
+
         OrganisationUnit unit = organisationUnitService.getOrganisationUnit( id );
 
         if ( unit == null )