← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5797: Chart target line fix

 

------------------------------------------------------------
revno: 5797
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-01-23 20:44:06 +0100
message:
  Chart target line fix
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.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
  dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.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/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2012-01-23 16:05:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2012-01-23 19:44:06 +0000
@@ -106,8 +106,6 @@
 
     private boolean regression;
 
-    private boolean targetLine;
-
     private boolean hideSubtitle;
 
     private Double targetLineValue;
@@ -298,6 +296,11 @@
         return this.type != null && this.type.equals( type );
     }
 
+    public boolean isTargetLine()
+    {
+        return targetLineValue != null;
+    }
+
     public int getWidth()
     {
         return 700;
@@ -410,18 +413,6 @@
 
     @XmlElement
     @JsonProperty
-    public boolean isTargetLine()
-    {
-        return targetLineValue != null;
-    }
-
-    public void setTargetLine( boolean targetLine )
-    {
-        this.targetLine = targetLine;
-    }
-
-    @XmlElement
-    @JsonProperty
     public Double getTargetLineValue()
     {
         return targetLineValue;

=== 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-01-20 09:47:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2012-01-23 19:44:06 +0000
@@ -258,6 +258,7 @@
         executeSql( "ALTER TABLE chart ALTER COLUMN dimension DROP NOT NULL" );
         executeSql( "ALTER TABLE chart DROP COLUMN size" );
         executeSql( "ALTER TABLE chart DROP COLUMN verticallabels" );
+        executeSql( "ALTER TABLE chart DROP COLUMN targetline" );
         executeSql( "ALTER TABLE chart DROP COLUMN horizontalplotorientation" );
         executeSql( "ALTER TABLE chart ADD COLUMN targetline boolean NOT NULL DEFAULT false" );
         executeSql( "ALTER TABLE chart ADD COLUMN hidesubtitle boolean NOT NULL DEFAULT false" );

=== 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	2011-12-25 16:41:27 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2012-01-23 19:44:06 +0000
@@ -34,8 +34,6 @@
 
     <property name="regression" not-null="true" />
 
-    <property name="targetLine" not-null="true" />
-
     <property name="hideSubtitle" not-null="true" />
 
     <property name="targetLineValue" />

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java	2012-01-23 16:05:43 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/AddOrUpdateChartAction.java	2012-01-23 19:44:06 +0000
@@ -280,7 +280,7 @@
 
     public String execute()
         throws Exception
-    {
+    {        
         Chart chart = null;
 
         if ( uid != null )
@@ -383,18 +383,9 @@
             chart.setRangeAxisLabel( rangeAxisLabel );
         }
 
-        if ( targetLineValue != null )
-        {
-            chart.setTargetLineValue( targetLineValue );
-        }
-
-        if ( targetLineLabel != null )
-        {
-            chart.setTargetLineLabel( targetLineLabel );
-        }
+        chart.setTargetLineValue( targetLineValue );
+        chart.setTargetLineLabel( targetLineLabel );
         
-        chart.setTargetLine( targetLineValue != null );
-
         chartService.saveOrUpdate( chart );
 
         return SUCCESS;