← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2473: Updated import/export with changes to RelativePeriods

 

------------------------------------------------------------
revno: 2473
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-01-06 16:40:07 +0100
message:
  Updated import/export with changes to RelativePeriods
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ChartConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ChartImporter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java
  dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.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-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	2011-01-06 13:33:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-01-06 15:40:07 +0000
@@ -205,39 +205,45 @@
         
         // remove outdated relative periods
         
-        executeSql( "ALTER TABLE reporttable DROP COLUMN last3Months" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN last6Months" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN last12Months" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN soFarThisYear" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN last3To6Months" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN last6To9Months" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN last9To12Months" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN last12IndividualMonths" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN individualMonthsThisYear" );
-        executeSql( "ALTER TABLE reporttable DROP COLUMN individualQuartersThisYear" );
-
-        executeSql( "ALTER TABLE chart DROP COLUMN last3Months" );
-        executeSql( "ALTER TABLE chart DROP COLUMN last6Months" );
-        executeSql( "ALTER TABLE chart DROP COLUMN last12Months" );
-        executeSql( "ALTER TABLE chart DROP COLUMN soFarThisYear" );
-        executeSql( "ALTER TABLE chart DROP COLUMN last3To6Months" );
-        executeSql( "ALTER TABLE chart DROP COLUMN last6To9Months" );
-        executeSql( "ALTER TABLE chart DROP COLUMN last9To12Months" );
-        executeSql( "ALTER TABLE chart DROP COLUMN last12IndividualMonths" );
-        executeSql( "ALTER TABLE chart DROP COLUMN individualMonthsThisYear" );
-        executeSql( "ALTER TABLE chart DROP COLUMN individualQuartersThisYear" );
-
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN last3Months" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN last6Months" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN last12Months" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN soFarThisYear" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN last3To6Months" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN last6To9Months" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN last9To12Months" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN last12IndividualMonths" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN individualMonthsThisYear" );
-        executeSql( "ALTER TABLE datamartexport DROP COLUMN individualQuartersThisYear" );
-        
+        executeSql( "ALTER TABLE reporttable DROP COLUMN last3months" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN last6months" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN last9months" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN last12months" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN sofarthisyear" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN sofarthisfinancialyear" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN last3to6months" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN last6to9months" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN last9to12months" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN last12individualmonths" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN individualmonthsthisyear" );
+        executeSql( "ALTER TABLE reporttable DROP COLUMN individualquartersthisyear" );
+
+        executeSql( "ALTER TABLE chart DROP COLUMN last3months" );
+        executeSql( "ALTER TABLE chart DROP COLUMN last6months" );
+        executeSql( "ALTER TABLE chart DROP COLUMN last9months" );
+        executeSql( "ALTER TABLE chart DROP COLUMN last12months" );
+        executeSql( "ALTER TABLE chart DROP COLUMN sofarthisyear" );
+        executeSql( "ALTER TABLE chart DROP COLUMN sofarthisfinancialyear" );
+        executeSql( "ALTER TABLE chart DROP COLUMN last3to6months" );
+        executeSql( "ALTER TABLE chart DROP COLUMN last6to9months" );
+        executeSql( "ALTER TABLE chart DROP COLUMN last9to12months" );
+        executeSql( "ALTER TABLE chart DROP COLUMN last12individualmonths" );
+        executeSql( "ALTER TABLE chart DROP COLUMN individualmonthsthisyear" );
+        executeSql( "ALTER TABLE chart DROP COLUMN individualquartersthisyear" );
+
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN last3months" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN last6months" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN last9months" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN last12months" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN sofarthisyear" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN sofarthisfinancialyear" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN last3to6months" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN last6to9months" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN last9to12months" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN last12individualmonths" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN individualmonthsthisyear" );
+        executeSql( "ALTER TABLE datamartexport DROP COLUMN individualquartersthisyear" );
+
         log.info( "Tables updated" );
     }
 

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ChartConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ChartConverter.java	2010-10-29 14:40:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ChartConverter.java	2011-01-06 15:40:07 +0000
@@ -41,17 +41,13 @@
     private static final String FIELD_ORGANISATION_UNITS = "organisationUnits";
 
     private static final String FIELD_REPORTING_MONTH = "reportingMonth";
-    private static final String FIELD_LAST_3_MONTHS = "last3Months";
-    private static final String FIELD_LAST_6_MONTHS = "last6Months";
-    private static final String FIELD_LAST_12_MONTHS = "last12Months";
-    private static final String FIELD_SO_FAR_THIS_YEAR = "soFarThisYear";
-    private static final String FIELD_LAST_3_TO_6_MONTHS = "last3To6Months";
-    private static final String FIELD_LAST_6_TO_9_MONTHS = "last6To9Months";
-    private static final String FIELD_LAST_9_TO_12_MONTHS = "last9To12Months";
-    private static final String FIELD_LAST_12_INDIVIDUAL_MONHTS = "last12IndividualMonths";
-    private static final String FIELD_INDIVIDUAL_MONTHS_THIS_YEAR = "individualMonthsThisYear";
-    private static final String FIELD_INDIVIDUAL_QUARTERS_THIS_YEAR = "individualQuartersThisYear";
-
+    private static final String FIELD_MONTHS_THIS_YEAR = "monthsThisYear";
+    private static final String FIELD_QUARTERS_THIS_YEAR = "quartersThisYear";
+    private static final String FIELD_THIS_YEAR = "thisYear";
+    private static final String FIELD_MONTHS_LAST_YEAR = "monthsLastYear";
+    private static final String FIELD_QUARTERS_LAST_YEAR = "quartersLastYear";
+    private static final String FIELD_LAST_YEAR = "lastYear";
+    
     private IndicatorService indicatorService;
     private PeriodService periodService;
     private OrganisationUnitService organisationUnitService;
@@ -139,16 +135,12 @@
                 writer.closeElement();                
 
                 writer.writeElement( FIELD_REPORTING_MONTH, String.valueOf( chart.getRelatives().isReportingMonth() ) );
-                writer.writeElement( FIELD_LAST_3_MONTHS, String.valueOf( chart.getRelatives().isLast3Months() ) );
-                writer.writeElement( FIELD_LAST_6_MONTHS, String.valueOf( chart.getRelatives().isLast6Months() ) );
-                writer.writeElement( FIELD_LAST_12_MONTHS, String.valueOf( chart.getRelatives().isLast12Months() ) );
-                writer.writeElement( FIELD_SO_FAR_THIS_YEAR, String.valueOf( chart.getRelatives().isSoFarThisYear() ) );
-                writer.writeElement( FIELD_LAST_3_TO_6_MONTHS, String.valueOf( chart.getRelatives().isLast3To6Months() ) );
-                writer.writeElement( FIELD_LAST_6_TO_9_MONTHS, String.valueOf( chart.getRelatives().isLast6To9Months() ) );
-                writer.writeElement( FIELD_LAST_9_TO_12_MONTHS, String.valueOf( chart.getRelatives().isLast9To12Months() ) );
-                writer.writeElement( FIELD_LAST_12_INDIVIDUAL_MONHTS, String.valueOf( chart.getRelatives().isLast12IndividualMonths() ) );
-                writer.writeElement( FIELD_INDIVIDUAL_MONTHS_THIS_YEAR, String.valueOf( chart.getRelatives().isIndividualMonthsThisYear() ) );
-                writer.writeElement( FIELD_INDIVIDUAL_QUARTERS_THIS_YEAR, String.valueOf( chart.getRelatives().isIndividualQuartersThisYear() ) );
+                writer.writeElement( FIELD_MONTHS_THIS_YEAR, String.valueOf( chart.getRelatives().isMonthsThisYear() ) );
+                writer.writeElement( FIELD_QUARTERS_THIS_YEAR, String.valueOf( chart.getRelatives().isQuartersThisYear() ) );
+                writer.writeElement( FIELD_THIS_YEAR, String.valueOf( chart.getRelatives().isThisYear() ) );
+                writer.writeElement( FIELD_MONTHS_LAST_YEAR, String.valueOf( chart.getRelatives().isMonthsLastYear() ) );
+                writer.writeElement( FIELD_QUARTERS_LAST_YEAR, String.valueOf( chart.getRelatives().isQuartersLastYear() ) );
+                writer.writeElement( FIELD_LAST_YEAR, String.valueOf( chart.getRelatives().isLastYear() ) );
 
                 writer.closeElement();
             }
@@ -212,38 +204,29 @@
                 chart.getOrganisationUnits().add( organisationUnitService.getOrganisationUnit( organisationUnitMapping.get( id ) ) );
             }
             
-            reader.moveToStartElement( FIELD_REPORTING_MONTH );          
-            chart.getRelatives().setReportingMonth( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_3_MONTHS );
-            chart.getRelatives().setLast3Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_6_MONTHS );
-            chart.getRelatives().setLast6Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_12_MONTHS );
-            chart.getRelatives().setLast12Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_SO_FAR_THIS_YEAR );
-            chart.getRelatives().setSoFarThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_3_TO_6_MONTHS );
-            chart.getRelatives().setLast3To6Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_6_TO_9_MONTHS );
-            chart.getRelatives().setLast6To9Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_9_TO_12_MONTHS );
-            chart.getRelatives().setLast9To12Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_12_INDIVIDUAL_MONHTS );
-            chart.getRelatives().setLast12IndividualMonths( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_INDIVIDUAL_MONTHS_THIS_YEAR );
-            chart.getRelatives().setIndividualMonthsThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_INDIVIDUAL_QUARTERS_THIS_YEAR );
-            chart.getRelatives().setIndividualQuartersThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
+            if ( params.minorVersionGreaterOrEqual( DXFConverter.MINOR_VERSION_12 ) )
+            {
+                reader.moveToStartElement( FIELD_REPORTING_MONTH );          
+                chart.getRelatives().setReportingMonth( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_MONTHS_THIS_YEAR );
+                chart.getRelatives().setMonthsThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_QUARTERS_THIS_YEAR );
+                chart.getRelatives().setQuartersThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_THIS_YEAR );
+                chart.getRelatives().setThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_MONTHS_LAST_YEAR );
+                chart.getRelatives().setMonthsLastYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_QUARTERS_LAST_YEAR );
+                chart.getRelatives().setQuartersLastYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_LAST_YEAR );
+                chart.getRelatives().setLastYear( Boolean.parseBoolean( reader.getElementValue() ) );
+            }
             
             importObject( chart, params );
         }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableConverter.java	2010-07-28 13:44:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/ReportTableConverter.java	2011-01-06 15:40:07 +0000
@@ -85,18 +85,14 @@
     private static final String FIELD_DO_INDICATORS = "doIndicators";
     private static final String FIELD_DO_PERIODS = "doPeriods";
     private static final String FIELD_DO_ORGANISATION_UNITS = "doOrganisationUnits";
-    
+
     private static final String FIELD_REPORTING_MONTH = "reportingMonth";
-    private static final String FIELD_LAST_3_MONTHS = "last3Months";
-    private static final String FIELD_LAST_6_MONTHS = "last6Months";
-    private static final String FIELD_LAST_12_MONTHS = "last12Months";
-    private static final String FIELD_SO_FAR_THIS_YEAR = "soFarThisYear";
-    private static final String FIELD_LAST_3_TO_6_MONTHS = "last3To6Months";
-    private static final String FIELD_LAST_6_TO_9_MONTHS = "last6To9Months";
-    private static final String FIELD_LAST_9_TO_12_MONTHS = "last9To12Months";
-    private static final String FIELD_LAST_12_INDIVIDUAL_MONHTS = "last12IndividualMonths";
-    private static final String FIELD_INDIVIDUAL_MONTHS_THIS_YEAR = "individualMonthsThisYear";
-    private static final String FIELD_INDIVIDUAL_QUARTERS_THIS_YEAR = "individualQuartersThisYear";
+    private static final String FIELD_MONTHS_THIS_YEAR = "monthsThisYear";
+    private static final String FIELD_QUARTERS_THIS_YEAR = "quartersThisYear";
+    private static final String FIELD_THIS_YEAR = "thisYear";
+    private static final String FIELD_MONTHS_LAST_YEAR = "monthsLastYear";
+    private static final String FIELD_QUARTERS_LAST_YEAR = "quartersLastYear";
+    private static final String FIELD_LAST_YEAR = "lastYear";
     
     private static final String FIELD_PARAM_REPORTING_MONTH = "paramReportingMonth";
     private static final String FIELD_PARAM_PARENT_ORG_UNIT = "paramParentOrganisationUnit";
@@ -247,19 +243,15 @@
                 writer.writeElement( FIELD_DO_INDICATORS, String.valueOf( reportTable.isDoIndicators() ) );
                 writer.writeElement( FIELD_DO_PERIODS, String.valueOf( reportTable.isDoPeriods() ) );
                 writer.writeElement( FIELD_DO_ORGANISATION_UNITS, String.valueOf( reportTable.isDoUnits() ) );
-                
+
                 writer.writeElement( FIELD_REPORTING_MONTH, String.valueOf( reportTable.getRelatives().isReportingMonth() ) );
-                writer.writeElement( FIELD_LAST_3_MONTHS, String.valueOf( reportTable.getRelatives().isLast3Months() ) );
-                writer.writeElement( FIELD_LAST_6_MONTHS, String.valueOf( reportTable.getRelatives().isLast6Months() ) );
-                writer.writeElement( FIELD_LAST_12_MONTHS, String.valueOf( reportTable.getRelatives().isLast12Months() ) );
-                writer.writeElement( FIELD_SO_FAR_THIS_YEAR, String.valueOf( reportTable.getRelatives().isSoFarThisYear() ) );
-                writer.writeElement( FIELD_LAST_3_TO_6_MONTHS, String.valueOf( reportTable.getRelatives().isLast3To6Months() ) );
-                writer.writeElement( FIELD_LAST_6_TO_9_MONTHS, String.valueOf( reportTable.getRelatives().isLast6To9Months() ) );
-                writer.writeElement( FIELD_LAST_9_TO_12_MONTHS, String.valueOf( reportTable.getRelatives().isLast9To12Months() ) );
-                writer.writeElement( FIELD_LAST_12_INDIVIDUAL_MONHTS, String.valueOf( reportTable.getRelatives().isLast12IndividualMonths() ) );
-                writer.writeElement( FIELD_INDIVIDUAL_MONTHS_THIS_YEAR, String.valueOf( reportTable.getRelatives().isIndividualMonthsThisYear() ) );
-                writer.writeElement( FIELD_INDIVIDUAL_QUARTERS_THIS_YEAR, String.valueOf( reportTable.getRelatives().isIndividualQuartersThisYear() ) );
-                
+                writer.writeElement( FIELD_MONTHS_THIS_YEAR, String.valueOf( reportTable.getRelatives().isMonthsThisYear() ) );
+                writer.writeElement( FIELD_QUARTERS_THIS_YEAR, String.valueOf( reportTable.getRelatives().isQuartersThisYear() ) );
+                writer.writeElement( FIELD_THIS_YEAR, String.valueOf( reportTable.getRelatives().isThisYear() ) );
+                writer.writeElement( FIELD_MONTHS_LAST_YEAR, String.valueOf( reportTable.getRelatives().isMonthsLastYear() ) );
+                writer.writeElement( FIELD_QUARTERS_LAST_YEAR, String.valueOf( reportTable.getRelatives().isQuartersLastYear() ) );
+                writer.writeElement( FIELD_LAST_YEAR, String.valueOf( reportTable.getRelatives().isLastYear() ) );
+
                 writer.writeElement( FIELD_PARAM_REPORTING_MONTH, String.valueOf( reportTable.getReportParams().isParamReportingMonth() ) );
                 writer.writeElement( FIELD_PARAM_PARENT_ORG_UNIT, String.valueOf( reportTable.getReportParams().isParamParentOrganisationUnit() ) );
                 writer.writeElement( FIELD_PARAM_ORG_UNIT, String.valueOf( reportTable.getReportParams().isParamOrganisationUnit() ) ); 
@@ -354,39 +346,33 @@
 
             reader.moveToStartElement( FIELD_DO_ORGANISATION_UNITS );
             reportTable.setDoUnits( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_REPORTING_MONTH );          
-            reportTable.getRelatives().setReportingMonth( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_3_MONTHS );
-            reportTable.getRelatives().setLast3Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_6_MONTHS );
-            reportTable.getRelatives().setLast6Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_12_MONTHS );
-            reportTable.getRelatives().setLast12Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_SO_FAR_THIS_YEAR );
-            reportTable.getRelatives().setSoFarThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_3_TO_6_MONTHS );
-            reportTable.getRelatives().setLast3To6Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_6_TO_9_MONTHS );
-            reportTable.getRelatives().setLast6To9Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_9_TO_12_MONTHS );
-            reportTable.getRelatives().setLast9To12Months( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_LAST_12_INDIVIDUAL_MONHTS );
-            reportTable.getRelatives().setLast12IndividualMonths( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_INDIVIDUAL_MONTHS_THIS_YEAR );
-            reportTable.getRelatives().setIndividualMonthsThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
-            
-            reader.moveToStartElement( FIELD_INDIVIDUAL_QUARTERS_THIS_YEAR );
-            reportTable.getRelatives().setIndividualQuartersThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
+
+            if ( params.minorVersionGreaterOrEqual( DXFConverter.MINOR_VERSION_12 ) )
+            {
+                reader.moveToStartElement( FIELD_REPORTING_MONTH );          
+                reportTable.getRelatives().setReportingMonth( Boolean.parseBoolean( reader.getElementValue() ) );
+    
+                reader.moveToStartElement( FIELD_REPORTING_MONTH );          
+                reportTable.getRelatives().setReportingMonth( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_MONTHS_THIS_YEAR );
+                reportTable.getRelatives().setMonthsThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_QUARTERS_THIS_YEAR );
+                reportTable.getRelatives().setQuartersThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_THIS_YEAR );
+                reportTable.getRelatives().setThisYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_MONTHS_LAST_YEAR );
+                reportTable.getRelatives().setMonthsLastYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_QUARTERS_LAST_YEAR );
+                reportTable.getRelatives().setQuartersLastYear( Boolean.parseBoolean( reader.getElementValue() ) );
+                
+                reader.moveToStartElement( FIELD_LAST_YEAR );
+                reportTable.getRelatives().setLastYear( Boolean.parseBoolean( reader.getElementValue() ) );
+            }
             
             reader.moveToStartElement( FIELD_PARAM_REPORTING_MONTH );
             reportTable.getReportParams().setParamReportingMonth( Boolean.parseBoolean( reader.getElementValue() ) );

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ChartImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ChartImporter.java	2010-07-28 13:44:59 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ChartImporter.java	2011-01-06 15:40:07 +0000
@@ -75,16 +75,12 @@
         match.setRegression( object.isRegression() );        
 
         match.getRelatives().setReportingMonth( object.getRelatives().isReportingMonth() );
-        match.getRelatives().setLast3Months( object.getRelatives().isLast3Months() );
-        match.getRelatives().setLast6Months( object.getRelatives().isLast6Months() );
-        match.getRelatives().setLast12Months( object.getRelatives().isLast12Months() );
-        match.getRelatives().setSoFarThisYear( object.getRelatives().isSoFarThisYear() );
-        match.getRelatives().setLast3To6Months( object.getRelatives().isLast3To6Months() );
-        match.getRelatives().setLast6To9Months( object.getRelatives().isLast6To9Months() );
-        match.getRelatives().setLast9To12Months( object.getRelatives().isLast9To12Months() );
-        match.getRelatives().setLast12IndividualMonths( object.getRelatives().isLast12IndividualMonths() );
-        match.getRelatives().setIndividualMonthsThisYear( object.getRelatives().isIndividualMonthsThisYear() );
-        match.getRelatives().setIndividualQuartersThisYear( object.getRelatives().isIndividualQuartersThisYear() );
+        match.getRelatives().setMonthsThisYear( object.getRelatives().isMonthsThisYear() );
+        match.getRelatives().setQuartersThisYear( object.getRelatives().isQuartersThisYear() );
+        match.getRelatives().setThisYear( object.getRelatives().isThisYear() );
+        match.getRelatives().setMonthsLastYear( object.getRelatives().isMonthsLastYear() );
+        match.getRelatives().setQuartersLastYear( object.getRelatives().isQuartersLastYear() );
+        match.getRelatives().setLastYear( object.getRelatives().isLastYear() );
         
         chartService.saveChart( match );
     }
@@ -130,52 +126,7 @@
         {
             return false;
         }
-        
-        if ( object.getRelatives().isReportingMonth() != existing.getRelatives().isReportingMonth() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast3Months() != existing.getRelatives().isLast3Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast6Months() != existing.getRelatives().isLast6Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast12Months() != existing.getRelatives().isLast12Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isSoFarThisYear() != existing.getRelatives().isSoFarThisYear() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast3To6Months() != existing.getRelatives().isLast3To6Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast6To9Months() != existing.getRelatives().isLast6To9Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast9To12Months() != existing.getRelatives().isLast9To12Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast12IndividualMonths() != existing.getRelatives().isLast12IndividualMonths() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isIndividualMonthsThisYear() != existing.getRelatives().isIndividualMonthsThisYear() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isIndividualQuartersThisYear() != existing.getRelatives().isIndividualQuartersThisYear() )
-        {
-            return false;
-        }
-        
+                
         return true;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java	2010-06-23 17:50:25 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/importer/ReportTableImporter.java	2011-01-06 15:40:07 +0000
@@ -92,18 +92,14 @@
         match.setDoIndicators( match.isDoIndicators() );
         match.setDoPeriods( match.isDoPeriods() );
         match.setDoUnits( match.isDoUnits() );
-        
+
         match.getRelatives().setReportingMonth( object.getRelatives().isReportingMonth() );
-        match.getRelatives().setLast3Months( object.getRelatives().isLast3Months() );
-        match.getRelatives().setLast6Months( object.getRelatives().isLast6Months() );
-        match.getRelatives().setLast12Months( object.getRelatives().isLast12Months() );
-        match.getRelatives().setSoFarThisYear( object.getRelatives().isSoFarThisYear() );
-        match.getRelatives().setLast3To6Months( object.getRelatives().isLast3To6Months() );
-        match.getRelatives().setLast6To9Months( object.getRelatives().isLast6To9Months() );
-        match.getRelatives().setLast9To12Months( object.getRelatives().isLast9To12Months() );
-        match.getRelatives().setLast12IndividualMonths( object.getRelatives().isLast12IndividualMonths() );
-        match.getRelatives().setIndividualMonthsThisYear( object.getRelatives().isIndividualMonthsThisYear() );
-        match.getRelatives().setIndividualQuartersThisYear( object.getRelatives().isIndividualQuartersThisYear() );
+        match.getRelatives().setMonthsThisYear( object.getRelatives().isMonthsThisYear() );
+        match.getRelatives().setQuartersThisYear( object.getRelatives().isQuartersThisYear() );
+        match.getRelatives().setThisYear( object.getRelatives().isThisYear() );
+        match.getRelatives().setMonthsLastYear( object.getRelatives().isMonthsLastYear() );
+        match.getRelatives().setQuartersLastYear( object.getRelatives().isQuartersLastYear() );
+        match.getRelatives().setLastYear( object.getRelatives().isLastYear() );
         
         match.getReportParams().setParamReportingMonth( object.getReportParams().isParamReportingMonth() );
         match.getReportParams().setParamParentOrganisationUnit( object.getReportParams().isParamParentOrganisationUnit() );
@@ -150,65 +146,7 @@
         {
             return false;
         }
-        
-        if ( object.getRelatives().isReportingMonth() != existing.getRelatives().isReportingMonth() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast3Months() != existing.getRelatives().isLast3Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast6Months() != existing.getRelatives().isLast6Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast12Months() != existing.getRelatives().isLast12Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isSoFarThisYear() != existing.getRelatives().isSoFarThisYear() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast3To6Months() != existing.getRelatives().isLast3To6Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast6To9Months() != existing.getRelatives().isLast6To9Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast9To12Months() != existing.getRelatives().isLast9To12Months() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isLast12IndividualMonths() != existing.getRelatives().isLast12IndividualMonths() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isIndividualMonthsThisYear() != existing.getRelatives().isIndividualMonthsThisYear() )
-        {
-            return false;
-        }
-        if ( object.getRelatives().isIndividualQuartersThisYear() != existing.getRelatives().isIndividualQuartersThisYear() )
-        {
-            return false;
-        }
-        
-        if ( object.getReportParams().isParamReportingMonth() != existing.getReportParams().isParamReportingMonth() )
-        {
-            return false;
-        }
-        if ( object.getReportParams().isParamParentOrganisationUnit() != existing.getReportParams().isParamParentOrganisationUnit() )
-        {
-            return false;
-        }
-        if ( object.getReportParams().isParamOrganisationUnit() != existing.getReportParams().isParamOrganisationUnit() )
-        {
-            return false;
-        }
-        
+                
         return true;
     }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java	2010-12-26 21:40:52 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/pdf/converter/DataElementConverter.java	2011-01-06 15:40:07 +0000
@@ -41,8 +41,6 @@
 import org.hisp.dhis.system.util.PDFUtils;
 
 import com.lowagie.text.Document;
-import com.lowagie.text.Font;
-import com.lowagie.text.pdf.BaseFont;
 
 /**
  * @author Lars Helge Overland

=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java	2010-11-23 16:12:57 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java	2011-01-06 15:40:07 +0000
@@ -96,16 +96,12 @@
         statementBuilder.setColumn( "dounits" );
         
         statementBuilder.setColumn( "reportingmonth" );
-        statementBuilder.setColumn( "last3months" );
-        statementBuilder.setColumn( "last6months" );
-        statementBuilder.setColumn( "last12months" );
-        statementBuilder.setColumn( "sofarthisyear" );
-        statementBuilder.setColumn( "last3to6months" );
-        statementBuilder.setColumn( "last6to9months" );
-        statementBuilder.setColumn( "last9to12months" );
-        statementBuilder.setColumn( "last12individualmonths" );
-        statementBuilder.setColumn( "individualmonthsthisyear" );
-        statementBuilder.setColumn( "individualquartersthisyear" );
+        statementBuilder.setColumn( "monthsthisyear" );
+        statementBuilder.setColumn( "quartersthisyear" );
+        statementBuilder.setColumn( "thisyear" );
+        statementBuilder.setColumn( "monthslastyear" );
+        statementBuilder.setColumn( "quarterslastyear" );
+        statementBuilder.setColumn( "lastyear" );
         
         statementBuilder.setColumn( "paramreportingmonth" );
         statementBuilder.setColumn( "paramparentorganisationunit" );
@@ -124,16 +120,12 @@
         statementBuilder.setValue( reportTable.isDoUnits() );
         
         statementBuilder.setValue( reportTable.getRelatives().isReportingMonth() );
-        statementBuilder.setValue( reportTable.getRelatives().isLast3Months() );
-        statementBuilder.setValue( reportTable.getRelatives().isLast6Months() );
-        statementBuilder.setValue( reportTable.getRelatives().isLast12Months() );
-        statementBuilder.setValue( reportTable.getRelatives().isSoFarThisYear() );
-        statementBuilder.setValue( reportTable.getRelatives().isLast3To6Months() );
-        statementBuilder.setValue( reportTable.getRelatives().isLast6To9Months() );
-        statementBuilder.setValue( reportTable.getRelatives().isLast9To12Months() );
-        statementBuilder.setValue( reportTable.getRelatives().isLast12IndividualMonths() );
-        statementBuilder.setValue( reportTable.getRelatives().isIndividualMonthsThisYear() );
-        statementBuilder.setValue( reportTable.getRelatives().isIndividualQuartersThisYear() );
+        statementBuilder.setValue( reportTable.getRelatives().isMonthsThisYear() );
+        statementBuilder.setValue( reportTable.getRelatives().isQuartersThisYear() );
+        statementBuilder.setValue( reportTable.getRelatives().isThisYear() );
+        statementBuilder.setValue( reportTable.getRelatives().isMonthsLastYear() );
+        statementBuilder.setValue( reportTable.getRelatives().isQuartersLastYear() );
+        statementBuilder.setValue( reportTable.getRelatives().isLastYear() );
 
         statementBuilder.setValue( reportTable.getReportParams().isParamReportingMonth() );
         statementBuilder.setValue( reportTable.getReportParams().isParamParentOrganisationUnit() );