← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5006: Implemented new relative periods for last 12 months and last 4 quarters

 

------------------------------------------------------------
revno: 5006
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2011-10-23 14:03:50 +0200
message:
  Implemented new relative periods for last 12 months and last 4 quarters
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/MonthlyPeriodType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java
  dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/MonthlyPeriodTypeTest.java
  dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/QuarterlyPeriodTypeTest.java
  dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartExportStoreTest.java
  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/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataSetCompletenessTask.java
  dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/ChartResource.java
  dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/SaveDataMartExportAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java
  dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedDataValuesAction.java
  dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedIndicatorValuesAction.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/ChartService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2011-10-20 09:35:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2011-10-23 12:03:50 +0000
@@ -51,9 +51,9 @@
 
     JFreeChart getJFreeChart( int id, I18nFormat format );
     
-    JFreeChart getPeriodJFreeChart( Indicator indicator, OrganisationUnit unit, boolean title, I18nFormat format );
+    JFreeChart getJFreePeriodChart( Indicator indicator, OrganisationUnit unit, boolean title, I18nFormat format );
     
-    JFreeChart getOrganisationUnitJFreeChart( Indicator indicator, OrganisationUnit parent, boolean title, I18nFormat format );
+    JFreeChart getJFreeOrganisationUnitChart( Indicator indicator, OrganisationUnit parent, boolean title, I18nFormat format );
 
     JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements, List<DataSet> dataSets, List<Period> periods,
         List<OrganisationUnit> organisationUnits, String dimension, boolean regression, I18nFormat format );

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/MonthlyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/MonthlyPeriodType.java	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/MonthlyPeriodType.java	2011-10-23 12:03:50 +0000
@@ -137,6 +137,27 @@
         return periods;
     }
 
+    /**
+     * Generates the last 12 months where the last one is the month
+     * which the given date is inside.
+     */
+    public List<Period> generateRollingPeriods( Date date )
+    {
+        Calendar cal = createCalendarInstance( date );
+        cal.set( Calendar.DAY_OF_MONTH, 1 );
+        cal.add( Calendar.MONTH, -11 );
+
+        ArrayList<Period> periods = new ArrayList<Period>();
+        
+        for ( int i = 0; i < 12; i++ )
+        {
+            periods.add( createPeriod( cal ) );
+            cal.add( Calendar.MONTH, 1 );
+        }
+        
+        return periods;
+    }
+    
     @Override
     public String getIsoDate( Period period )
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java	2011-10-23 12:03:50 +0000
@@ -138,6 +138,27 @@
         return periods;
     }
 
+    /**
+     * Generates the last 4 quarters where the last one is the quarter
+     * which the given date is inside.
+     */
+    public List<Period> generateRollingPeriods( Date date )
+    {
+        Calendar cal = createCalendarInstance( date );
+        cal.set( Calendar.DAY_OF_MONTH, 1 );
+        cal.add( Calendar.MONTH, ( ( cal.get( Calendar.MONTH ) % 3 ) * -1 ) - 9 );
+
+        ArrayList<Period> periods = new ArrayList<Period>();
+        
+        for ( int i = 0; i < 4; i++ )
+        {
+            periods.add( createPeriod( cal ) );
+            cal.add( Calendar.MONTH, 3 );
+        }
+        
+        return periods;
+    }
+    
     @Override
     public String getIsoDate( Period period )
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/RelativePeriods.java	2011-10-23 12:03:50 +0000
@@ -81,6 +81,20 @@
         "november_last_year",
         "december_last_year" };
     
+    public static final String[] MONTHS_LAST_12 = {
+        "month1",
+        "month2",
+        "month3",
+        "month4",
+        "month5",
+        "month6",
+        "month7",
+        "month8",
+        "month9",
+        "month10",
+        "month11",
+        "month12" };
+    
     public static final String[] QUARTERS_THIS_YEAR = {
         "quarter1",
         "quarter2",
@@ -92,7 +106,7 @@
         "quarter2_last_year",
         "quarter3_last_year",
         "quarter4_last_year" };
-    
+        
     public static final String[] LAST_5_YEARS = {
         "year_minus_4",
         "year_minus_3",
@@ -122,6 +136,10 @@
 
     private Boolean last5Years = false;
     
+    private Boolean last12Months = false;
+    
+    private Boolean last4Quarters = false;
+    
     // -------------------------------------------------------------------------
     // Constructors
     // -------------------------------------------------------------------------
@@ -141,10 +159,13 @@
      * @param quartersLastYear quarters last year
      * @param lastYear last year
      * @param last5Years last 5 years
+     * @param last12Months last 12 months
+     * @param last4Quarters last 4 quarters
      */
     public RelativePeriods( boolean reportingMonth, boolean reportingBimonth, boolean reportingQuarter,
         boolean monthsThisYear, boolean quartersThisYear, boolean thisYear,
-        boolean monthsLastYear, boolean quartersLastYear, boolean lastYear, boolean last5Years )
+        boolean monthsLastYear, boolean quartersLastYear, boolean lastYear, boolean last5Years,
+        boolean last12Months, boolean last4Quarters )
     {
         this.reportingMonth = reportingMonth;
         this.reportingBimonth = reportingBimonth;
@@ -156,6 +177,8 @@
         this.quartersLastYear = quartersLastYear;
         this.lastYear = lastYear;
         this.last5Years = last5Years;
+        this.last12Months = last12Months;
+        this.last4Quarters = last4Quarters;
     }
 
     // -------------------------------------------------------------------------
@@ -177,6 +200,8 @@
         this.quartersLastYear = false;
         this.lastYear = false;
         this.last5Years = false;
+        this.last12Months = false;
+        this.last4Quarters = false;
         return this;
     }
 
@@ -299,6 +324,16 @@
             periods.addAll( getRelativePeriodList( new YearlyPeriodType().generateLast5Years( date ), LAST_5_YEARS, dynamicNames, format ) );
         }
         
+        if ( isLast12Months() )
+        {
+            periods.addAll( getRelativePeriodList( new MonthlyPeriodType().generateRollingPeriods( date ), MONTHS_LAST_12, dynamicNames, format ) );
+        }
+        
+        if ( isLast4Quarters() )
+        {
+            periods.addAll( getRelativePeriodList( new QuarterlyPeriodType().generateRollingPeriods( date ), QUARTERS_THIS_YEAR, dynamicNames, format ) );
+        }
+        
         date = getDate( MONTHS_IN_YEAR, date );
         
         if ( isMonthsLastYear() )
@@ -461,6 +496,16 @@
     {
         return last5Years != null && last5Years;
     }
+    
+    public boolean isLast12Months()
+    {
+        return last12Months != null && last12Months;
+    }
+    
+    public boolean isLast4Quarters()
+    {
+        return last4Quarters != null && last4Quarters;
+    }
         
     // -------------------------------------------------------------------------
     // Getters & setters
@@ -566,6 +611,26 @@
         this.last5Years = last5Years;
     }
 
+    public Boolean getLast12Months()
+    {
+        return last12Months;
+    }
+
+    public void setLast12Months( Boolean last12Months )
+    {
+        this.last12Months = last12Months;
+    }
+
+    public Boolean getLast4Quarters()
+    {
+        return last4Quarters;
+    }
+
+    public void setLast4Quarters( Boolean last4Quarters )
+    {
+        this.last4Quarters = last4Quarters;
+    }
+
     // -------------------------------------------------------------------------
     // Equals, hashCode, and toString
     // -------------------------------------------------------------------------
@@ -587,6 +652,8 @@
         result = prime * result + ( ( quartersLastYear == null ) ? 0 : quartersLastYear.hashCode() );
         result = prime * result + ( ( lastYear == null ) ? 0 : lastYear.hashCode() );
         result = prime * result + ( ( last5Years == null ) ? 0 : last5Years.hashCode() );
+        result = prime * result + ( ( last12Months == null ) ? 0 : last12Months.hashCode() );
+        result = prime * result + ( ( last4Quarters == null ) ? 0 : last4Quarters.hashCode() );
         
         return result;
     }
@@ -730,6 +797,30 @@
         {
             return false;
         }
+
+        if ( last12Months == null )
+        {
+            if ( other.last12Months != null )
+            {
+                return false;
+            }
+        }
+        else if ( !last12Months.equals( other.last12Months ) )
+        {
+            return false;
+        }
+
+        if ( last4Quarters == null )
+        {
+            if ( other.last4Quarters != null )
+            {
+                return false;
+            }
+        }
+        else if ( !last4Quarters.equals( other.last4Quarters ) )
+        {
+            return false;
+        }
         
         return true;
     }

=== modified file 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/MonthlyPeriodTypeTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/MonthlyPeriodTypeTest.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/MonthlyPeriodTypeTest.java	2011-10-23 12:03:50 +0000
@@ -42,7 +42,7 @@
     private Cal startCal;
     private Cal endCal;
     private Cal testCal;
-    private CalendarPeriodType periodType;
+    private MonthlyPeriodType periodType;
     
     @Before
     public void before()
@@ -130,6 +130,28 @@
         assertEquals( periodType.createPeriod( new Cal( 2009, 11, 1 ).time() ), periods.get( 10 ) );
         assertEquals( periodType.createPeriod( new Cal( 2009, 12, 1 ).time() ), periods.get( 11 ) );
     }
+
+    @Test
+    public void testGenerateRollingPeriods()
+    {
+        testCal.set( 2009, 8, 15 );
+        
+        List<Period> periods = periodType.generateRollingPeriods( testCal.time() );
+        
+        assertEquals( 12, periods.size() );
+        assertEquals( periodType.createPeriod( new Cal( 2008, 9, 1 ).time() ), periods.get( 0 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2008, 10, 1 ).time() ), periods.get( 1 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2008, 11, 1 ).time() ), periods.get( 2 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2008, 12, 1 ).time() ), periods.get( 3 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 1, 1 ).time() ), periods.get( 4 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 2, 1 ).time() ), periods.get( 5 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 3, 1 ).time() ), periods.get( 6 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 4, 1 ).time() ), periods.get( 7 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 5, 1 ).time() ), periods.get( 8 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 6, 1 ).time() ), periods.get( 9 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 7, 1 ).time() ), periods.get( 10 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 8, 1 ).time() ), periods.get( 11 ) );
+    }
     
     @Test
     public void testGenerateLast5Years()

=== modified file 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/QuarterlyPeriodTypeTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/QuarterlyPeriodTypeTest.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/QuarterlyPeriodTypeTest.java	2011-10-23 12:03:50 +0000
@@ -43,7 +43,7 @@
     private Cal startCal;
     private Cal endCal;
     private Cal testCal;
-    private CalendarPeriodType periodType;
+    private QuarterlyPeriodType periodType;
     
     @Before
     public void before()
@@ -125,6 +125,20 @@
     }
 
     @Test
+    public void testGenerateRollingPeriods()
+    {
+        testCal.set( 2009, 8, 15 );
+        
+        List<Period> periods = periodType.generateRollingPeriods( testCal.time() );
+        
+        assertEquals( 4, periods.size() );
+        assertEquals( periodType.createPeriod( new Cal( 2008, 10, 1 ).time() ), periods.get( 0 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 1, 1 ).time() ), periods.get( 1 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 4, 1 ).time() ), periods.get( 2 ) );
+        assertEquals( periodType.createPeriod( new Cal( 2009, 7, 1 ).time() ), periods.get( 3 ) );
+    }
+
+    @Test
     public void testGenerateLast5Years()
     {
         testCal.set( 2009, 8, 15 );

=== modified file 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/period/RelativePeriodTest.java	2011-10-23 12:03:50 +0000
@@ -56,9 +56,9 @@
     }
     
     @Test
-    public void getRelativePeriodsA()
+    public void getRelativePeriods()
     {        
-        RelativePeriods periods = new RelativePeriods( true, true, true, true, true, true, true, true, true, true );
+        RelativePeriods periods = new RelativePeriods( true, true, true, true, true, true, true, true, true, true, true, true );
         
         Collection<Period> relatives = periods.getRelativePeriods( getDate( 2001, 1, 1 ), i18nFormat, false );
         
@@ -108,6 +108,6 @@
         assertTrue( relatives.contains( new Period( new YearlyPeriodType(), getDate( 2000, 1, 1 ), getDate( 2000, 12, 31 ) ) ) );
         assertTrue( relatives.contains( new Period( new YearlyPeriodType(), getDate( 2001, 1, 1 ), getDate( 2001, 12, 31 ) ) ) );
         
-        assertEquals( 42, relatives.size() );
+        assertEquals( 58, relatives.size() );
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartExportStoreTest.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartExportStoreTest.java	2011-10-11 11:27:38 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/test/java/org/hisp/dhis/datamart/DataMartExportStoreTest.java	2011-10-23 12:03:50 +0000
@@ -134,7 +134,7 @@
         periods.add( periodA );
         periods.add( periodB );
         
-        relatives = new RelativePeriods( true, true, true, true, true, true, false, false, false, false );
+        relatives = new RelativePeriods( true, true, true, true, true, true, false, false, false, false, false, false );
         
         exportA = new DataMartExport( "ExportA", dataElements, indicators, organisationUnits, periods, relatives );
         exportB = new DataMartExport( "ExportB", dataElements, indicators, organisationUnits, periods, relatives );

=== 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	2011-10-21 09:24:04 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2011-10-23 12:03:50 +0000
@@ -251,10 +251,10 @@
         return getJFreeChart( chart, !chart.getHideSubtitle() );
     }
 
-    public JFreeChart getPeriodJFreeChart( Indicator indicator, OrganisationUnit unit, boolean title, I18nFormat format )
+    public JFreeChart getJFreePeriodChart( Indicator indicator, OrganisationUnit unit, boolean title, I18nFormat format )
     {
         RelativePeriods relatives = new RelativePeriods();
-        relatives.setMonthsThisYear( true );
+        relatives.setLast12Months( true );
         List<Period> periods = periodService.reloadPeriods( relatives.getRelativePeriods( format, true ) );
 
         Chart chart = new Chart();
@@ -279,7 +279,7 @@
         return getJFreeChart( chart, title );
     }
 
-    public JFreeChart getOrganisationUnitJFreeChart( Indicator indicator, OrganisationUnit parent, boolean title,
+    public JFreeChart getJFreeOrganisationUnitChart( Indicator indicator, OrganisationUnit parent, boolean title,
         I18nFormat format )
     {
         RelativePeriods relatives = new RelativePeriods();
@@ -827,7 +827,7 @@
     {
         String aggregationStrategy = (String) systemSettingManager.getSystemSetting( KEY_AGGREGATION_STRATEGY,
             DEFAULT_AGGREGATION_STRATEGY );
-
+        
         final DefaultCategoryDataset regularDataSet = new DefaultCategoryDataset();
         final DefaultCategoryDataset regressionDataSet = new DefaultCategoryDataset();
 
@@ -884,7 +884,8 @@
                     shortName = dataSets.get( i ).getShortName();
                 }
 
-                if ( chart.isDimension( DIMENSION_PERIOD_INDICATOR ) || chart.isDimension( DIMENSION_INDICATOR_PERIOD )
+                if ( chart.isDimension( DIMENSION_PERIOD_INDICATOR ) 
+                    || chart.isDimension( DIMENSION_INDICATOR_PERIOD )
                     || chart.isDimension( DIMENSION_PERIOD_DATAELEMENT )
                     || chart.isDimension( DIMENSION_DATAELEMENT_PERIOD )
                     || chart.isDimension( DIMENSION_PERIOD_COMPLETENESS )

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2011-10-21 09:24:04 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2011-10-23 12:03:50 +0000
@@ -346,7 +346,7 @@
         method="intercept" />
       <aop:around pointcut="execution( * org.hisp.dhis.completeness.DataSetCompletenessService.getDataSetCompleteness(..) )"
         method="intercept" />
-      <aop:around pointcut="execution( * org.hisp.dhis.chart.ChartService.getJFreeChart*(..) )" method="intercept" />
+      <aop:around pointcut="execution( * org.hisp.dhis.chart.ChartService.getJFree*(..) )" method="intercept" />
       <aop:around pointcut="execution( * org.hisp.dhis.datasetreport.DataSetReportService.getCustomDataSetReport(..) )"
         method="intercept" />
       <aop:around pointcut="execution( * org.hisp.dhis.datasetreport.DataSetReportService.getSectionDataSetReport(..) )"

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java	2011-10-11 11:27:38 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataMartTask.java	2011-10-23 12:03:50 +0000
@@ -70,7 +70,7 @@
         Collection<Integer> indicatorIds = ConversionUtils.getIdentifiers( Indicator.class, indicatorService.getAllIndicators() );
         Collection<Integer> organisationUnitIds = ConversionUtils.getIdentifiers( OrganisationUnit.class, organisationUnitService.getAllOrganisationUnits() );
         
-        RelativePeriods relatives = new RelativePeriods( false, false, false, true, true, true, false, false, false, false );
+        RelativePeriods relatives = new RelativePeriods( false, false, false, true, true, true, false, false, false, false, false, false );
         
         dataMartService.export( dataElementIds, indicatorIds, new HashSet<Integer>(), organisationUnitIds, relatives, true );
     }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataSetCompletenessTask.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataSetCompletenessTask.java	2011-10-11 11:27:38 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/DataSetCompletenessTask.java	2011-10-23 12:03:50 +0000
@@ -63,7 +63,7 @@
         Collection<Integer> dataSetIds = ConversionUtils.getIdentifiers( DataSet.class, dataSetService.getAllDataSets() );
         Collection<Integer> organisationUnitIds = ConversionUtils.getIdentifiers( OrganisationUnit.class, organisationUnitService.getAllOrganisationUnits() );
 
-        RelativePeriods relatives = new RelativePeriods( false, false, false, true, true, true, false, false, false, false );
+        RelativePeriods relatives = new RelativePeriods( false, false, false, true, true, true, false, false, false, false, false, false );
         
         completenessService.exportDataSetCompleteness( dataSetIds, relatives, organisationUnitIds );        
     }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/ChartResource.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/ChartResource.java	2011-09-22 14:26:27 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/web/api/resources/ChartResource.java	2011-10-23 12:03:50 +0000
@@ -73,7 +73,7 @@
             public void write( OutputStream out )
                 throws IOException, WebApplicationException
             {
-                ChartUtilities.writeChartAsPNG( out, jFreeChart, 600, 400, true, 0 );
+                ChartUtilities.writeChartAsPNG( out, jFreeChart, 460, 330, true, 0 );
             }
         } ).build();
     }

=== modified file 'dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/SaveDataMartExportAction.java'
--- dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/SaveDataMartExportAction.java	2011-10-11 11:27:38 +0000
+++ dhis-2/dhis-web/dhis-web-datamart/src/main/java/org/hisp/dhis/datamart/action/SaveDataMartExportAction.java	2011-10-23 12:03:50 +0000
@@ -208,7 +208,7 @@
 
         RelativePeriods relatives = new RelativePeriods( reportingMonth, reportingBimonth, reportingQuarter,
             monthsThisYear, quartersThisYear, thisYear, 
-            monthsLastYear, quartersLastYear, lastYear, false );
+            monthsLastYear, quartersLastYear, lastYear, false, false, false );
           
         export.setName( name );            
         export.setDataElements( getSet( dataElementService.getDataElements( getIntegerCollection( selectedDataElements ) ) ) );

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-10-20 11:23:55 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-10-23 12:03:50 +0000
@@ -375,7 +375,7 @@
         chart.setOrganisationUnits( organisationUnits );
 
         RelativePeriods relatives = new RelativePeriods( reportingMonth, reportingBimonth, reportingQuarter,
-            monthsThisYear, quartersThisYear, thisYear, monthsLastYear, quartersLastYear, lastYear, false );
+            monthsThisYear, quartersThisYear, thisYear, monthsLastYear, quartersLastYear, lastYear, false, false, false );
 
         chart.setRelatives( relatives );
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java	2011-10-11 11:27:38 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java	2011-10-23 12:03:50 +0000
@@ -364,7 +364,7 @@
         
         RelativePeriods relatives = new RelativePeriods( reportingMonth, reportingBimonth, reportingQuarter,
             monthsThisYear, quartersThisYear, thisYear, 
-            monthsLastYear, quartersLastYear, lastYear, false );
+            monthsLastYear, quartersLastYear, lastYear, false, false, false );
         
         ReportParams reportParams = new ReportParams();
         

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedDataValuesAction.java'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedDataValuesAction.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedDataValuesAction.java	2011-10-23 12:03:50 +0000
@@ -175,7 +175,7 @@
                 || monthsLastYear || quartersLastYear || lastYear || lastFiveYears ) )
         {
             RelativePeriods relativePeriod = new RelativePeriods( lastMonth, false, lastQuarter, monthsThisYear, quartersThisYear,
-                thisYear, monthsLastYear, quartersLastYear, lastYear, lastFiveYears );
+                thisYear, monthsLastYear, quartersLastYear, lastYear, lastFiveYears, false, false );
 
             Collection<Integer> relativePeriods = ConversionUtils.getIdentifiers( Period.class,
                 periodService.reloadPeriods( relativePeriod.getRelativePeriods( format, true ) ) );

=== modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedIndicatorValuesAction.java'
--- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedIndicatorValuesAction.java	2011-10-12 17:32:39 +0000
+++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedIndicatorValuesAction.java	2011-10-23 12:03:50 +0000
@@ -175,7 +175,7 @@
                 || monthsLastYear || quartersLastYear || lastYear || lastFiveYears ) )
         {
             RelativePeriods relativePeriod = new RelativePeriods( lastMonth, false, lastQuarter, monthsThisYear, quartersThisYear,
-                thisYear, monthsLastYear, quartersLastYear, lastYear, lastFiveYears );
+                thisYear, monthsLastYear, quartersLastYear, lastYear, lastFiveYears, false, false );
 
             Collection<Integer> relativePeriods = ConversionUtils.getIdentifiers( Period.class,
                 periodService.reloadPeriods( relativePeriod.getRelativePeriods( format, true ) ) );