← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8791: Added transient property mapView.parentLevel

 

------------------------------------------------------------
revno: 8791
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-31 13:43:37 +0300
message:
  Added transient property mapView.parentLevel
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/mapping/MapController.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-api/src/main/java/org/hisp/dhis/mapping/MapView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2012-10-31 08:09:02 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java	2012-10-31 10:43:37 +0000
@@ -113,6 +113,8 @@
     private OrganisationUnitGroupSet organisationUnitGroupSet;
 
     private transient String parentGraph;
+    
+    private transient int parentLevel;
 
     public MapView()
     {
@@ -434,6 +436,19 @@
         this.parentGraph = parentGraph;
     }
 
+    @JsonProperty
+    @JsonView( {DetailedView.class, ExportView.class} )
+    @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+    public int getParentLevel()
+    {
+        return parentLevel;
+    }
+
+    public void setParentLevel( int parentLevel )
+    {
+        this.parentLevel = parentLevel;
+    }
+
     @Override
     public String toString()
     {

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/mapping/MapController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/mapping/MapController.java	2012-10-31 08:03:54 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/controller/mapping/MapController.java	2012-10-31 10:43:37 +0000
@@ -183,6 +183,7 @@
             if ( view != null && view.getParentOrganisationUnit() != null )
             {
                 view.setParentGraph( view.getParentOrganisationUnit().getParentGraph() );
+                view.setParentLevel( organisationUnitService.getLevelOfOrganisationUnit( view.getParentOrganisationUnit().getId() ) );
             }
         }
     }