← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7542: Annotated org unit children

 

------------------------------------------------------------
revno: 7542
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-09 12:10:20 +0200
message:
  Annotated org unit children
modified:
  dhis-2/dhis-api/pom.xml
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java
  dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnit.xsl


--
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/pom.xml'
--- dhis-2/dhis-api/pom.xml	2012-05-29 07:58:51 +0000
+++ dhis-2/dhis-api/pom.xml	2012-07-09 10:10:20 +0000
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <project xmlns="http://maven.apache.org/POM/4.0.0";
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2012-06-27 07:38:35 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnit.java	2012-07-09 10:10:20 +0000
@@ -597,6 +597,21 @@
         this.parent = parent;
     }
 
+    @JsonProperty
+    @JsonSerialize( contentAs = BaseIdentifiableObject.class )
+    @JsonView( {DetailedView.class} )
+    @JacksonXmlElementWrapper( localName = "children", namespace = Dxf2Namespace.NAMESPACE )
+    @JacksonXmlProperty( localName = "child", namespace = Dxf2Namespace.NAMESPACE )
+    public Set<OrganisationUnit> getChildren()
+    {
+        return children;
+    }
+
+    public void setChildren( Set<OrganisationUnit> children )
+    {
+        this.children = children;
+    }
+
     public String getAlternativeName()
     {
         return getShortName();
@@ -839,16 +854,6 @@
     // Getters and setters for transient fields
     // -------------------------------------------------------------------------
 
-    public Set<OrganisationUnit> getChildren()
-    {
-        return children;
-    }
-
-    public void setChildren( Set<OrganisationUnit> children )
-    {
-        this.children = children;
-    }
-
     public int getLevel()
     {
         return level;

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2012-07-03 16:43:55 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2012-07-09 10:10:20 +0000
@@ -242,7 +242,7 @@
             chart.setName( indicator.getName() );
         }
 
-        chart.setType( TYPE_BAR );
+        chart.setType( TYPE_COLUMN );
         chart.setDimensions( Chart.DIMENSION_DATA, Chart.DIMENSION_ORGANISATIONUNIT, Chart.DIMENSION_PERIOD );
         chart.setHideLegend( true );
         chart.getIndicators().add( indicator );

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnit.xsl'
--- dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnit.xsl	2012-06-23 09:14:37 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/resources/templates/html/organisationUnit.xsl	2012-07-09 10:10:20 +0000
@@ -48,20 +48,11 @@
 
       </table>
 
-      <xsl:apply-templates select="d:parent|d:organisationUnitGroups|d:dataSets" mode="short" />
+      <xsl:apply-templates select="d:parent|d:children|d:organisationUnitGroups|d:dataSets" mode="short" />
 
     </div>
   </xsl:template>
   
-  <xsl:template match="d:organisationUnits" mode="short">
-    <xsl:if test="count(child::*) > 0">
-      <h3>OrganisationUnits</h3>
-      <table>
-        <xsl:apply-templates select="child::*" mode="row"/>
-      </table>
-    </xsl:if>
-  </xsl:template>
-
   <xsl:template match="d:parent" mode="short">
     <h3>Parent OrganisationUnit</h3>
     <table>
@@ -69,6 +60,15 @@
     </table>
   </xsl:template>
 
+  <xsl:template match="d:children" mode="short">
+    <xsl:if test="count(child::*) > 0">
+      <h3>Child OrganisationUnits</h3>
+      <table>
+        <xsl:apply-templates select="child::*" mode="row"/>
+      </table>
+    </xsl:if>
+  </xsl:template>
+
   <xsl:template match="d:dataSets" mode="short">
     <xsl:if test="count(child::*) > 0">
       <h3>DataSets</h3>