dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02130
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 727: Minor fixes in reportexcel api.
------------------------------------------------------------
revno: 727
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-09-15 15:18:11 +0200
message:
Minor fixes in reportexcel api.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/DataElementGroupOrder.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcel.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelCategory.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelNormal.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelOganiztionGroupListing.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelPeriodColumnListing.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelService.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportLocationManager.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/reportexcel/DataElementGroupOrder.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/DataElementGroupOrder.java 2009-09-14 03:19:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/DataElementGroupOrder.java 2009-09-15 13:18:11 +0000
@@ -42,10 +42,28 @@
private List<DataElement> dataElements;
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
public DataElementGroupOrder()
{
}
+ // -------------------------------------------------------------------------
+ // Getters and setters
+ // -------------------------------------------------------------------------
+
+ public int getId()
+ {
+ return id;
+ }
+
+ public void setId( int id )
+ {
+ this.id = id;
+ }
+
public String getName()
{
return name;
@@ -66,15 +84,9 @@
this.dataElements = dataElements;
}
- public int getId()
- {
- return id;
- }
-
- public void setId( int id )
- {
- this.id = id;
- }
+ // -------------------------------------------------------------------------
+ // hashCode and equals
+ // -------------------------------------------------------------------------
@Override
public int hashCode()
@@ -99,5 +111,4 @@
return false;
return true;
}
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcel.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcel.java 2009-09-15 04:10:48 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcel.java 2009-09-15 13:18:11 +0000
@@ -37,17 +37,27 @@
*/
public abstract class ReportExcel
{
- public static class TYPE
- {
-
- public static final String NORMAL = "NORMAL";
-
- public static final String CATEGORY = "CATEGORY";
-
- public static final String PERIOD_COLUMN_LISTING = "PERIOD_COLUMN_LISTING";
-
- public static final String ORGANIZATION_GROUP_LISTING = "ORGANIZATION_GROUP_LISTING";
- }
+ private int id;
+
+ private String name;
+
+ private int periodRow;
+
+ private int periodColumn;
+
+ private int organisationRow;
+
+ private int organisationColumn;
+
+ private Set<ReportExcelItem> reportExcelItems = new HashSet<ReportExcelItem>();
+
+ private Set<OrganisationUnit> organisationAssocitions = new HashSet<OrganisationUnit>();
+
+ private Set<UserAuthorityGroup> userRoles = new HashSet<UserAuthorityGroup>();
+
+ private String group;
+
+ private String excelTemplateFile;
// ----------------------------------------------------------------------
// Constructors
@@ -75,6 +85,10 @@
this.group = group;
}
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
public boolean isCategory()
{
return this.getReportType().equalsIgnoreCase( TYPE.CATEGORY );
@@ -93,20 +107,36 @@
public boolean isNormal()
{
return this.getReportType().equalsIgnoreCase( TYPE.NORMAL );
+ }
+
+ // -------------------------------------------------------------------------
+ // Abstract methods
+ // -------------------------------------------------------------------------
+
+ public abstract String getReportType();
+
+ // -------------------------------------------------------------------------
+ // Internal classes
+ // -------------------------------------------------------------------------
+
+ public static class TYPE
+ {
+ public static final String NORMAL = "NORMAL";
+ public static final String CATEGORY = "CATEGORY";
+ public static final String PERIOD_COLUMN_LISTING = "PERIOD_COLUMN_LISTING";
+ public static final String ORGANIZATION_GROUP_LISTING = "ORGANIZATION_GROUP_LISTING";
}
-
- // ----------------------------------------------------------------------
+ // -------------------------------------------------------------------------
// hashCode and equals
- // ----------------------------------------------------------------------
-
+ // -------------------------------------------------------------------------
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
- result = prime * result + id;
+ result = prime * result + name.hashCode();
return result;
}
@@ -129,8 +159,6 @@
// Getters and setters
// ----------------------------------------------------------------------
- private int id;
-
public int getId()
{
return id;
@@ -141,8 +169,6 @@
this.id = id;
}
- private String name;
-
public String getName()
{
return name;
@@ -153,8 +179,6 @@
this.name = name;
}
- private int periodRow;
-
public int getPeriodRow()
{
return periodRow;
@@ -165,8 +189,6 @@
this.periodRow = periodRow;
}
- private int periodColumn;
-
public int getPeriodColumn()
{
return periodColumn;
@@ -177,8 +199,6 @@
this.periodColumn = periodColumn;
}
- private int organisationRow;
-
public int getOrganisationRow()
{
return organisationRow;
@@ -189,8 +209,6 @@
this.organisationRow = organisationRow;
}
- private int organisationColumn;
-
public int getOrganisationColumn()
{
return organisationColumn;
@@ -201,8 +219,6 @@
this.organisationColumn = organisationColumn;
}
- private Set<ReportExcelItem> reportExcelItems = new HashSet<ReportExcelItem>();
-
public Set<ReportExcelItem> getReportExcelItems()
{
return reportExcelItems;
@@ -213,8 +229,6 @@
this.reportExcelItems = reportExcelItems;
}
- private Set<OrganisationUnit> organisationAssocitions = new HashSet<OrganisationUnit>();
-
public Set<OrganisationUnit> getOrganisationAssocitions()
{
return organisationAssocitions;
@@ -225,8 +239,6 @@
this.organisationAssocitions = organisationAssocitions;
}
- private Set<UserAuthorityGroup> userRoles = new HashSet<UserAuthorityGroup>();
-
public Set<UserAuthorityGroup> getUserRoles()
{
return userRoles;
@@ -237,8 +249,6 @@
this.userRoles = userRoles;
}
- private String group;
-
public String getGroup()
{
return group;
@@ -249,8 +259,6 @@
this.group = group;
}
- private String excelTemplateFile;
-
public String getExcelTemplateFile()
{
return excelTemplateFile;
@@ -260,7 +268,4 @@
{
this.excelTemplateFile = excelTemplateFile;
}
-
- public abstract String getReportType();
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelCategory.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelCategory.java 2009-09-14 03:19:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelCategory.java 2009-09-15 13:18:11 +0000
@@ -11,6 +11,10 @@
{
private List<DataElementGroupOrder> dataElementOrders;
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
public ReportExcelCategory()
{
super();
@@ -24,6 +28,10 @@
organisationAssocitions, userRoles, group );
}
+ // -------------------------------------------------------------------------
+ // Getters and setters
+ // -------------------------------------------------------------------------
+
public List<DataElementGroupOrder> getDataElementOrders()
{
return dataElementOrders;
@@ -39,5 +47,4 @@
{
return ReportExcel.TYPE.CATEGORY;
}
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java 2009-09-14 13:32:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelItem.java 2009-09-15 13:18:11 +0000
@@ -48,34 +48,27 @@
private String periodType;
private int sheetNo;
-
+
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
public ReportExcelItem()
{
- super();
}
public ReportExcelItem( String name, String itemType, int row, int column, String expression )
- {
- super();
+ {
this.itemType = itemType;
this.row = row;
this.column = column;
this.expression = expression;
this.name = name;
}
-
-
-
- public int getSheetNo()
- {
- return sheetNo;
- }
-
- public void setSheetNo( int sheetNo )
- {
- this.sheetNo = sheetNo;
- }
+
+ // -------------------------------------------------------------------------
+ // Getters and setters
+ // -------------------------------------------------------------------------
public int getId()
{
@@ -87,22 +80,20 @@
this.id = id;
}
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
public String getItemType()
{
return itemType;
}
-
-
-
- public String getPeriodType()
- {
- return periodType;
- }
-
- public void setPeriodType( String periodType )
- {
- this.periodType = periodType;
- }
public void setItemType( String itemType )
{
@@ -138,18 +129,30 @@
{
this.expression = expression;
}
-
-
-
- public String getName()
- {
- return name;
- }
-
- public void setName( String name )
- {
- this.name = name;
- }
+
+ public String getPeriodType()
+ {
+ return periodType;
+ }
+
+ public void setPeriodType( String periodType )
+ {
+ this.periodType = periodType;
+ }
+
+ public int getSheetNo()
+ {
+ return sheetNo;
+ }
+
+ public void setSheetNo( int sheetNo )
+ {
+ this.sheetNo = sheetNo;
+ }
+
+ // -------------------------------------------------------------------------
+ // hashCode and equals
+ // -------------------------------------------------------------------------
@Override
public int hashCode()
@@ -175,41 +178,30 @@
return true;
}
+ // -------------------------------------------------------------------------
+ // Internal classes
+ // -------------------------------------------------------------------------
+
public static class TYPE
{
public static final String DATAELEMENT = "dataelement";
-
- public static final String ORGANISATION = "organisation";
-
+ public static final String ORGANISATION = "organisation";
public static final String INDICATOR = "indicator";
-
- public static final String CALCULATION = "calculation";
-
- public static final String DATAELEMENT_CODE = "dataelement_code";
-
- public static final String DATAELEMENT_NAME = "dataelement_name";
-
- public static final String SERIAL = "serial";
-
- public static final String FORMULA_EXCEL = "formulaexcel";
-
+ public static final String CALCULATION = "calculation";
+ public static final String DATAELEMENT_CODE = "dataelement_code";
+ public static final String DATAELEMENT_NAME = "dataelement_name";
+ public static final String SERIAL = "serial";
+ public static final String FORMULA_EXCEL = "formulaexcel";
}
public static class PERIODTYPE
{
public static final String SELECTED_MONTH = "selected_month";
-
public static final String LAST_3_MONTH = "last_3_month";
-
- public static final String SO_FAR_THIS_YEAR = "so_far_this_year";
-
- public static final String LAST_6_MONTH = "last_6_month";
-
- public static final String QUATERLY = "quaterly";
-
- public static final String SIX_MONTH = "6_month";
-
+ public static final String SO_FAR_THIS_YEAR = "so_far_this_year";
+ public static final String LAST_6_MONTH = "last_6_month";
+ public static final String QUATERLY = "quaterly";
+ public static final String SIX_MONTH = "6_month";
public static final String YEARLY = "yealy";
}
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelNormal.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelNormal.java 2009-09-14 13:32:34 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelNormal.java 2009-09-15 13:18:11 +0000
@@ -8,6 +8,10 @@
public class ReportExcelNormal
extends ReportExcel
{
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
public ReportExcelNormal()
{
super();
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelOganiztionGroupListing.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelOganiztionGroupListing.java 2009-09-14 03:19:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelOganiztionGroupListing.java 2009-09-15 13:18:11 +0000
@@ -43,6 +43,10 @@
{
private List<OrganisationUnitGroup> organisationUnitGroups;
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
+
public ReportExcelOganiztionGroupListing()
{
super();
@@ -56,6 +60,10 @@
organisationAssocitions, userRoles, group );
}
+ // -------------------------------------------------------------------------
+ // Getters and setters
+ // -------------------------------------------------------------------------
+
public List<OrganisationUnitGroup> getOrganisationUnitGroups()
{
return organisationUnitGroups;
@@ -71,5 +79,4 @@
{
return ReportExcel.TYPE.ORGANIZATION_GROUP_LISTING;
}
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelPeriodColumnListing.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelPeriodColumnListing.java 2009-09-14 03:19:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelPeriodColumnListing.java 2009-09-15 13:18:11 +0000
@@ -38,11 +38,13 @@
public class ReportExcelPeriodColumnListing
extends ReportExcel
{
+ // -------------------------------------------------------------------------
+ // Constructors
+ // -------------------------------------------------------------------------
public ReportExcelPeriodColumnListing()
{
super();
- // TODO Auto-generated constructor stub
}
public ReportExcelPeriodColumnListing( String name, String excelTemplateFile, int periodRow, int periodColumn,
@@ -51,7 +53,6 @@
{
super( name, excelTemplateFile, periodRow, periodColumn, organisationRow, organisationColumn, reportItems,
organisationAssocitions, userRoles, group );
- // TODO Auto-generated constructor stub
}
@Override
@@ -59,5 +60,4 @@
{
return ReportExcel.TYPE.PERIOD_COLUMN_LISTING;
}
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelService.java 2009-09-14 05:20:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelService.java 2009-09-15 13:18:11 +0000
@@ -113,7 +113,4 @@
Collection<DataEntryStatus> getDataEntryStatusDefaultByDataSets( Collection<DataSet> dataSets );
public int countDataValueOfDataSet( DataSet dataSet, OrganisationUnit organisationUnit, Period period );
-
-
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelStore.java 2009-09-14 05:20:54 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportExcelStore.java 2009-09-15 13:18:11 +0000
@@ -110,6 +110,4 @@
Collection<DataEntryStatus> getDataEntryStatusDefaultByDataSets( Collection<DataSet> dataSets );
public int countDataValueOfDataSet( DataSet dataSet, OrganisationUnit organisationUnit, Period period );
-
-
}
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportLocationManager.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportLocationManager.java 2009-09-14 16:35:26 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reportexcel/ReportLocationManager.java 2009-09-15 13:18:11 +0000
@@ -50,7 +50,4 @@
public File getReportExcelDirectory();
public File getReportExcelTemplateDirectory();
-
-
-
}