← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19712: Chart, analytics: removed rewind relative periods, not in use

 

------------------------------------------------------------
revno: 19712
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-08-04 15:40:59 +0200
message:
  Chart, analytics: removed rewind relative periods, not in use
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.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	2015-07-13 12:34:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2015-08-04 13:40:59 +0000
@@ -28,10 +28,10 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
 import org.hisp.dhis.common.AnalyticsType;
 import org.hisp.dhis.common.DimensionalObject;
 import org.hisp.dhis.common.DxfNamespaces;
@@ -39,16 +39,16 @@
 import org.hisp.dhis.common.MergeStrategy;
 import org.hisp.dhis.common.NameableObject;
 import org.hisp.dhis.common.view.DetailedView;
-import org.hisp.dhis.common.view.DimensionalView;
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.i18n.I18nFormat;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.user.User;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 
 /**
  * @author Lars Helge Overland
@@ -225,21 +225,6 @@
         this.category = category;
     }
 
-    @Override
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public boolean isRewindRelativePeriods()
-    {
-        return rewindRelativePeriods;
-    }
-
-    @Override
-    public void setRewindRelativePeriods( boolean rewindRelativePeriods )
-    {
-        this.rewindRelativePeriods = rewindRelativePeriods;
-    }
-
     // -------------------------------------------------------------------------
     // Merge with
     // -------------------------------------------------------------------------
@@ -253,8 +238,6 @@
         {
             Chart chart = (Chart) other;
 
-            rewindRelativePeriods = chart.isRewindRelativePeriods();
-
             if ( strategy.isReplace() )
             {
                 series = chart.getSeries();

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2015-07-15 16:44:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseAnalyticalObject.java	2015-08-04 13:40:59 +0000
@@ -158,8 +158,6 @@
     @Scanned
     protected List<OrganisationUnitGroup> itemOrganisationUnitGroups = new ArrayList<>();
 
-    protected boolean rewindRelativePeriods;
-
     protected String digitGroupSeparator;
 
     protected int sortOrder;
@@ -361,14 +359,7 @@
 
             if ( hasRelativePeriods() )
             {
-                if ( rewindRelativePeriods )
-                {
-                    items.addAll( relatives.getRewindedRelativePeriods( 1, date, format, dynamicNames ) );
-                }
-                else
-                {
-                    items.addAll( relatives.getRelativePeriods( date, format, dynamicNames ) );
-                }
+                items.addAll( relatives.getRelativePeriods( date, format, dynamicNames ) );
             }
 
             type = DimensionType.PERIOD;
@@ -891,7 +882,6 @@
             userOrganisationUnitChildren = object.isUserOrganisationUnitChildren();
             userOrganisationUnitGrandChildren = object.isUserOrganisationUnitGrandChildren();
             itemOrganisationUnitGroups = object.getItemOrganisationUnitGroups();
-            rewindRelativePeriods = object.isRewindRelativePeriods();
             digitGroupSeparator = object.getDigitGroupSeparator();
             userOrganisationUnit = object.isUserOrganisationUnit();
             sortOrder = object.getSortOrder();
@@ -1129,19 +1119,6 @@
     @JsonProperty
     @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
     @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
-    public boolean isRewindRelativePeriods()
-    {
-        return rewindRelativePeriods;
-    }
-
-    public void setRewindRelativePeriods( boolean rewindRelativePeriods )
-    {
-        this.rewindRelativePeriods = rewindRelativePeriods;
-    }
-
-    @JsonProperty
-    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
-    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
     public String getDigitGroupSeparator()
     {
         return digitGroupSeparator;

=== 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	2015-08-02 13:30:47 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-08-04 13:40:59 +0000
@@ -315,7 +315,6 @@
         executeSql( "UPDATE chart SET type='line' where type='line3d'" );
         executeSql( "UPDATE chart SET type='pie' where type='pie'" );
         executeSql( "UPDATE chart SET type='pie' where type='pie3d'" );
-        executeSql( "UPDATE chart SET rewindRelativePeriods = false WHERE rewindRelativePeriods is null" );
 
         executeSql( "UPDATE chart SET type=lower(type), series=lower(series), category=lower(category), filter=lower(filter)" );
 
@@ -334,6 +333,7 @@
         executeSql( "ALTER TABLE chart DROP CONSTRAINT chart_name_key" );
 
         executeSql( "ALTER TABLE chart DROP COLUMN domainaxixlabel" );
+        executeSql( "ALTER TABLE chart DROP COLUMN rewindrelativeperiods" );
 
         executeSql( "ALTER TABLE chart ALTER hideLegend DROP NOT NULL" );
         executeSql( "ALTER TABLE chart ALTER regression DROP NOT NULL" );

=== 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	2015-07-12 15:21:01 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2015-08-04 13:40:59 +0000
@@ -146,8 +146,6 @@
 
     <property name="hideEmptyRows" />
 
-    <property name="rewindRelativePeriods" />
-
     <property name="rangeAxisMaxValue" />
 
     <property name="rangeAxisMinValue" />