dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #00493
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 143: dhis-web-reporting:
------------------------------------------------------------
revno: 143
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-04-02 09:52:56 +0200
message:
dhis-web-reporting:
- Fixed bug: when both parent orgunit and orgunit were selected as report params for a single report table, only orgunit was included.
- Fixed bug: when selecting orgunit as report params, this orgunit was persisted with the report table when executed.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/DefaultReportTableCreator.java
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableCreatorTest.java
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableManagerTest.java
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStatementTest.java
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStoreTest.java
dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableTest.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/CreateTableAction.java
dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java 2009-03-24 10:31:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java 2009-04-02 07:52:56 +0000
@@ -124,11 +124,21 @@
private List<Period> relativePeriods = new ArrayList<Period>();
/**
- * Static periods and relative periods.
+ * Static Periods and relative Periods.
*/
private List<Period> allPeriods = new ArrayList<Period>();
/**
+ * OrganisationUnits relative to a parent unit or current unit.
+ */
+ private List<OrganisationUnit> relativeUnits = new ArrayList<OrganisationUnit>();
+
+ /**
+ * Static OrganisationUnits and relative OrganisationUnits.
+ */
+ private List<OrganisationUnit> allUnits = new ArrayList<OrganisationUnit>();
+
+ /**
* Indicators that will be crosstabulated on the columns axis. Indicators
* comprises dataelements, indicators, datasets.
*/
@@ -241,6 +251,7 @@
* @param periods the periods. These periods cannot have the name property set.
* @param relativePeriods the relative periods. These periods must have the name property set. Not persisted.
* @param units the organisation units.
+ * @param relativeUnits the organisation units. Not persisted.
* @param doIndicators indicating whether indicators should be crosstabulated.
* @param doCategoryOptionCombos indicating whether category option combos should be crosstabulated.
* @param doPeriods indicating whether periods should be crosstabulated.
@@ -259,6 +270,7 @@
List<Period> periods,
List<Period> relativePeriods,
List<OrganisationUnit> units,
+ List<OrganisationUnit> relativeUnits,
boolean doIndicators,
boolean doCategoryOptionCombos,
boolean doPeriods,
@@ -280,6 +292,7 @@
this.periods = periods;
this.relativePeriods = relativePeriods;
this.units = units;
+ this.relativeUnits = relativeUnits;
this.doIndicators = doIndicators;
this.doCategoryOptionCombos = doCategoryOptionCombos;
this.doPeriods = doPeriods;
@@ -307,7 +320,7 @@
}
// ---------------------------------------------------------------------
- // Init tableName and allPeriods
+ // Init tableName, allPeriods and allUnits
// ---------------------------------------------------------------------
this.tableName = generateTableName( name );
@@ -315,6 +328,9 @@
allPeriods.addAll( periods );
allPeriods.addAll( relativePeriods );
+ allUnits.addAll( units );
+ allUnits.addAll( relativeUnits );
+
// ---------------------------------------------------------------------
// Init indexColumns and selectColumns
// ---------------------------------------------------------------------
@@ -371,30 +387,28 @@
if ( isDoPeriods() )
{
- crossTabPeriods = new ArrayList<Period>( periods );
- crossTabPeriods.addAll( relativePeriods );
+ crossTabPeriods = new ArrayList<Period>( allPeriods );
reportPeriods.add( null );
selectColumns.add( PERIOD_ID );
}
else
{
crossTabPeriods.add( null );
- reportPeriods = new ArrayList<Period>( periods );
- reportPeriods.addAll( relativePeriods );
+ reportPeriods = new ArrayList<Period>( allPeriods );
indexColumns.add( PERIOD_ID );
indexNameColumns.add( PERIOD_NAME );
}
if ( isDoUnits() )
{
- crossTabUnits = new ArrayList<OrganisationUnit>( units );
+ crossTabUnits = new ArrayList<OrganisationUnit>( allUnits );
reportUnits.add( null );
selectColumns.add( ORGANISATIONUNIT_ID );
}
else
{
crossTabUnits.add( null );
- reportUnits = new ArrayList<OrganisationUnit>( units );
+ reportUnits = new ArrayList<OrganisationUnit>( allUnits );
indexColumns.add( ORGANISATIONUNIT_ID );
indexNameColumns.add( ORGANISATIONUNIT_NAME );
}
@@ -861,6 +875,21 @@
return allPeriods;
}
+ public List<OrganisationUnit> getRelativeUnits()
+ {
+ return relativeUnits;
+ }
+
+ public void setRelativeUnits( List<OrganisationUnit> relativeUnits )
+ {
+ this.relativeUnits = relativeUnits;
+ }
+
+ public List<OrganisationUnit> getAllUnits()
+ {
+ return allUnits;
+ }
+
public I18nFormat getI18nFormat()
{
return i18nFormat;
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/DefaultReportTableCreator.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/DefaultReportTableCreator.java 2009-03-24 10:31:31 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/reporttable/DefaultReportTableCreator.java 2009-04-02 07:52:56 +0000
@@ -127,13 +127,13 @@
dataMartService.export( getIdentifiers( DataElement.class, reportTable.getDataElements() ),
getIdentifiers( Indicator.class, reportTable.getIndicators() ),
getIdentifiers( Period.class, reportTable.getAllPeriods() ),
- getIdentifiers( OrganisationUnit.class, reportTable.getUnits() ) );
+ getIdentifiers( OrganisationUnit.class, reportTable.getAllUnits() ) );
}
else if ( mode.equals( ReportTable.MODE_DATASETS ) )
{
completenessExportService.exportDataSetCompleteness( getIdentifiers( DataSet.class, reportTable.getDataSets() ),
getIdentifiers( Period.class, reportTable.getAllPeriods() ),
- getIdentifiers( OrganisationUnit.class, reportTable.getUnits() ),
+ getIdentifiers( OrganisationUnit.class, reportTable.getAllUnits() ),
reportTable.getId() );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableCreatorTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableCreatorTest.java 2009-03-31 12:04:28 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableCreatorTest.java 2009-04-02 07:52:56 +0000
@@ -335,7 +335,7 @@
public void testCreateDataElementReportTableA()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -346,7 +346,7 @@
public void testCreateDataElementReportTableB()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -357,7 +357,7 @@
public void testCreateDataElementReportTableC()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -368,7 +368,7 @@
public void testCreateDataElementWithCategoryOptionComboReportTableA()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, true, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -380,7 +380,7 @@
public void testCreateDataElementWithCategoryOptionComboReportTableB()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, true, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -391,7 +391,7 @@
public void testCreateDataElementWithCategoryOptionComboReportTableC()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -402,7 +402,7 @@
public void testCreateIndicatorReportTableA()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -413,7 +413,7 @@
public void testCreateIndicatorReportTableB()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -424,7 +424,7 @@
public void testCreateIndicatorReportTableC()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -435,7 +435,7 @@
public void testCreateDataSetReportTableA()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -446,7 +446,7 @@
public void testCreateDataSetReportTableB()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -457,7 +457,7 @@
public void testCreateDataSetReportTableC()
{
ReportTable reportTable = new ReportTable( "Prescriptions", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableManagerTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableManagerTest.java 2009-03-31 12:04:28 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableManagerTest.java 2009-04-02 07:52:56 +0000
@@ -208,23 +208,23 @@
public void testCreateReportTable()
{
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
- true, false, true, false, relatives, null, i18nFormat, "january_2000" );
-
- reportTable.init();
-
- reportTableManager.createReportTable( reportTable );
-
- reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
- true, false, true, false, relatives, null, i18nFormat, "january_2000" );
-
- reportTable.init();
-
- reportTableManager.createReportTable( reportTable );
-
- reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
+ true, false, true, false, relatives, null, i18nFormat, "january_2000" );
+
+ reportTable.init();
+
+ reportTableManager.createReportTable( reportTable );
+
+ reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
+ true, false, true, false, relatives, null, i18nFormat, "january_2000" );
+
+ reportTable.init();
+
+ reportTableManager.createReportTable( reportTable );
+
+ reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -235,23 +235,23 @@
public void testRemoveReportTable()
{
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
- true, false, true, false, relatives, null, i18nFormat, "january_2000" );
-
- reportTable.init();
-
- reportTableManager.removeReportTable( reportTable );
-
- reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
- true, false, true, false, relatives, null, i18nFormat, "january_2000" );
-
- reportTable.init();
-
- reportTableManager.removeReportTable( reportTable );
-
- reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
+ true, false, true, false, relatives, null, i18nFormat, "january_2000" );
+
+ reportTable.init();
+
+ reportTableManager.removeReportTable( reportTable );
+
+ reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
+ true, false, true, false, relatives, null, i18nFormat, "january_2000" );
+
+ reportTable.init();
+
+ reportTableManager.removeReportTable( reportTable );
+
+ reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -277,7 +277,7 @@
batchHandler.flush();
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -315,7 +315,7 @@
batchHandler.flush();
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -353,7 +353,7 @@
batchHandler.flush();
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, true, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -391,7 +391,7 @@
batchHandler.flush();
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStatementTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStatementTest.java 2009-03-31 12:04:28 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStatementTest.java 2009-04-02 07:52:56 +0000
@@ -142,7 +142,7 @@
public void testCreateReportTableStatement()
{
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -152,7 +152,7 @@
assertNotNull( statement.getStatement() );
reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -162,7 +162,7 @@
assertNotNull( statement.getStatement() );
reportTable = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -175,7 +175,7 @@
public void testGetReportTableDataStatementIndicatorsMode()
{
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false ,true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -192,7 +192,7 @@
public void testGetReportTableDataStatementDataElementsModeWithCategoryOptionCombos()
{
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, true, false, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -209,7 +209,7 @@
public void testGetReportTableDataStatementDataElementsMode()
{
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -226,7 +226,7 @@
public void testGetReportTableDataStatementDataSetsMode()
{
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -243,7 +243,7 @@
public void testRemoveReportTableStatement()
{
ReportTable reportTable = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStoreTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStoreTest.java 2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableStoreTest.java 2009-04-02 07:52:56 +0000
@@ -183,13 +183,13 @@
public void testSaveGetReportTable()
{
ReportTable reportTableA = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
ReportTable reportTableB = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
ReportTable reportTableC = new ReportTable( "Assualt", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
int idA = reportTableStore.saveReportTable( reportTableA );
@@ -234,10 +234,10 @@
public void testDeleteReportTable()
{
ReportTable reportTableA = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
ReportTable reportTableB = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
int idA = reportTableStore.saveReportTable( reportTableA );
@@ -260,10 +260,10 @@
public void testGetAllReportTables()
{
ReportTable reportTableA = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
ReportTable reportTableB = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTableStore.saveReportTable( reportTableA );
@@ -278,10 +278,10 @@
public void testGetReportTableByName()
{
ReportTable reportTableA = new ReportTable( "Immunization", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
ReportTable reportTableB = new ReportTable( "Prescriptions", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTableStore.saveReportTable( reportTableA );
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableTest.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableTest.java 2009-03-31 12:04:28 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/test/java/org/hisp/dhis/reporttable/ReportTableTest.java 2009-04-02 07:52:56 +0000
@@ -189,7 +189,7 @@
public void testIndicatorReportTableA()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -245,7 +245,7 @@
public void testIndicatorReportTableB()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -293,7 +293,7 @@
public void testIndicatorReportTableC()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_INDICATORS, false,
- new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), indicators, new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -345,7 +345,7 @@
public void testDataElementReportTableA()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -401,7 +401,7 @@
public void testDataElementReportTableB()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -450,7 +450,7 @@
public void testDataElementReportTableC()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -502,7 +502,7 @@
public void testDataElementWithCategoryOptionReportTableA()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, true, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -572,7 +572,7 @@
public void testDataElementWithCategoryOptionReportTableB()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, true, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -626,7 +626,7 @@
public void testDataElementWithCategoryOptionReportTableC()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATAELEMENTS, false,
- dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units,
+ dataElements, new ArrayList<Indicator>(), new ArrayList<DataSet>(), categoryOptionCombos, periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -680,7 +680,7 @@
public void testDataSetReportTableA()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, true, false, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -735,7 +735,7 @@
public void testDataSetReportTableB()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
false, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
@@ -783,7 +783,7 @@
public void testDataSetReportTableC()
{
ReportTable reportTable = new ReportTable( "Embezzlement", ReportTable.MODE_DATASETS, false,
- new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units,
+ new ArrayList<DataElement>(), new ArrayList<Indicator>(), dataSets, new ArrayList<DataElementCategoryOptionCombo>(), periods, relativePeriods, units, new ArrayList<OrganisationUnit>(),
true, false, false, true, relatives, null, i18nFormat, "january_2000" );
reportTable.init();
=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/CreateTableAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/CreateTableAction.java 2009-03-24 10:31:31 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/CreateTableAction.java 2009-04-02 07:52:56 +0000
@@ -204,7 +204,7 @@
{
OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( parentOrganisationUnitId );
- reportTable.setUnits( new ArrayList<OrganisationUnit>( organisationUnit.getChildren() ) );
+ reportTable.getRelativeUnits().addAll( new ArrayList<OrganisationUnit>( organisationUnit.getChildren() ) );
log.info( "Parent organisation unit: " + organisationUnit.getName() );
}
@@ -219,7 +219,7 @@
List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
organisationUnits.add( organisationUnit );
- reportTable.setUnits( organisationUnits );
+ reportTable.getRelativeUnits().addAll( organisationUnits );
log.info( "Organisation unit: " + organisationUnit.getName() );
}
=== 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 2009-03-24 10:31:31 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tablecreator/action/SaveTableAction.java 2009-04-02 07:52:56 +0000
@@ -396,7 +396,7 @@
if ( tableId == null )
{
reportTable = new ReportTable( tableName, mode, regression,
- dataElements, indicators, dataSets, categoryOptionCombos, periods, null, organisationUnits,
+ dataElements, indicators, dataSets, categoryOptionCombos, periods, null, organisationUnits, null,
doIndicators, doCategoryOptionCombos, doPeriods, doOrganisationUnits, relatives, reportParams,
null, null );
}
--
Trunk
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.