← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6668: Added default values for primitives in Chart to TableAlteror. Removed dataEntryForm (for xml/json...

 

------------------------------------------------------------
revno: 6668
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-04-21 12:33:17 +0300
message:
  Added default values for primitives in Chart to TableAlteror. Removed dataEntryForm (for xml/json) from DataSet since we are still using IDs and not UIDs for internal references in form.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml


--
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/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2012-04-20 18:31:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2012-04-21 09:33:17 +0000
@@ -607,7 +607,7 @@
         return userOrganisationUnit;
     }
 
-    public void setUserOrganisationUnit( boolean userOrganisationUnitChildren )
+    public void setUserOrganisationUnit( boolean userOrganisationUnit )
     {
         this.userOrganisationUnit = userOrganisationUnit;
     }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2012-04-21 08:25:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2012-04-21 09:33:17 +0000
@@ -373,9 +373,11 @@
         this.periodType = periodType;
     }
 
-    @JsonProperty
-    @JsonView( {DetailedView.class, ExportView.class} )
-    @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+    //@JsonProperty
+    //@JsonView( {DetailedView.class, ExportView.class} )
+    //@JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+    // Leaving dataEntryForm out for the moment since we are using IDs there and not UIDs.
+    // At some point it should also be upgraded to idObject (to make it work a bit better with the importer).
     public DataEntryForm getDataEntryForm()
     {
         return dataEntryForm;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2012-04-21 08:25:31 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2012-04-21 09:33:17 +0000
@@ -422,6 +422,9 @@
         executeSql( "update chart set last6bimonths = false where last6bimonths is null" );
         executeSql( "update chart set last4quarters = false where last4quarters is null" );
         executeSql( "update chart set last2sixmonths = false where last2sixmonths is null" );
+        executeSql( "update chart set showdata = false where showdata is null" );
+        executeSql( "update chart set userorganisationunitchildren = false where userorganisationunitchildren is null" );
+        executeSql( "update chart set userorganisationunit = false where userorganisationunit is null" );
 
         // report, reporttable, chart groups
         

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2012-04-20 07:50:59 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2012-04-21 09:33:17 +0000
@@ -1,9 +1,9 @@
 <?xml version="1.0"?>
 <!DOCTYPE hibernate-mapping PUBLIC
-  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
-  [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
+    [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+    >
 
 <hibernate-mapping>
   <class name="org.hisp.dhis.chart.Chart" table="chart">
@@ -16,7 +16,7 @@
 
     <property name="name" column="name" not-null="true" length="230" />
     <property name="uid" column="uid" length="11" />
-    <property name="lastUpdated" type="timestamp"/>
+    <property name="lastUpdated" type="timestamp" />
 
     <property name="domainAxisLabel" />
 
@@ -48,21 +48,24 @@
       <cache usage="read-write" />
       <key column="chartid" foreign-key="fk_chart_indicators_chartid" />
       <list-index column="sort_order" base="0" />
-      <many-to-many column="indicatorid" class="org.hisp.dhis.indicator.Indicator" foreign-key="fk_chart_indicators_indicatorid" />
+      <many-to-many column="indicatorid" class="org.hisp.dhis.indicator.Indicator"
+          foreign-key="fk_chart_indicators_indicatorid" />
     </list>
 
     <list name="dataElements" table="chart_dataelements">
       <cache usage="read-write" />
       <key column="chartid" foreign-key="fk_chart_dataelements_chartid" />
       <list-index column="sort_order" base="0" />
-      <many-to-many column="dataelementid" class="org.hisp.dhis.dataelement.DataElement" foreign-key="fk_chart_dataelements_dataelementid" />
+      <many-to-many column="dataelementid" class="org.hisp.dhis.dataelement.DataElement"
+          foreign-key="fk_chart_dataelements_dataelementid" />
     </list>
 
     <list name="dataSets" table="chart_datasets">
       <cache usage="read-write" />
       <key column="chartid" foreign-key="fk_chart_datasets_chartid" />
       <list-index column="sort_order" base="0" />
-      <many-to-many column="datasetid" class="org.hisp.dhis.dataset.DataSet" foreign-key="fk_chart_datasets_datasetid" />
+      <many-to-many column="datasetid" class="org.hisp.dhis.dataset.DataSet"
+          foreign-key="fk_chart_datasets_datasetid" />
     </list>
 
     <list name="organisationUnits" table="chart_organisationunits">
@@ -70,10 +73,11 @@
       <key column="chartid" foreign-key="fk_chart_organisationunits_chartid" />
       <list-index column="sort_order" base="0" />
       <many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit"
-        foreign-key="fk_chart_organisationunits_organisationunitid" />
+          foreign-key="fk_chart_organisationunits_organisationunitid" />
     </list>
-    
-    <many-to-one name="organisationUnitGroupSet" class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet" column="organisationunitgroupsetid" foreign-key="fk_chart_organisationunitgroupsetid" />       
+
+    <many-to-one name="organisationUnitGroupSet" class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet"
+        column="organisationunitgroupsetid" foreign-key="fk_chart_organisationunitgroupsetid" />
 
     <component name="relatives">
       <property name="reportingMonth" />
@@ -83,16 +87,16 @@
       <property name="last12Months" />
       <property name="last4Quarters" />
       <property name="last2SixMonths" />
-	  <property name="lastYear" />
+      <property name="lastYear" />
       <property name="last5Years" />
     </component>
 
     <property name="userOrganisationUnit" />
-	  
+
     <property name="userOrganisationUnitChildren" />
 
     <property name="showData" />
-    
+
     <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_chart_userid" />
 
   </class>