← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2267: Fixed Bugs in NBITS Reports

 

------------------------------------------------------------
revno: 2267
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-09-29 07:34:14 +0530
message:
  Fixed Bugs in NBITS Reports
added:
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/util/Report.java
modified:
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsFormAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/BenificiaryInfoReportsFormAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsFormAction.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 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsFormAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsFormAction.java	2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsFormAction.java	2010-09-29 02:04:14 +0000
@@ -11,9 +11,8 @@
 import org.hisp.dhis.period.MonthlyPeriodType;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reports.ReportService;
-import org.hisp.dhis.reports.Report_in;
+import org.hisp.dhis.reports.util.Report;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -49,9 +48,9 @@
     // Getter & Setter
     // -------------------------------------------------------------------------
 
-    private List<Report_in> reportList;
+    private List<Report> reportList;
 
-    public List<Report_in> getReportList()
+    public List<Report> getReportList()
     {
         return reportList;
     }
@@ -84,7 +83,7 @@
 
         periodList = new ArrayList<Period>( periodService.getPeriodsByPeriodType( new MonthlyPeriodType() ) );
 
-       // reportList = new ArrayList<Report>();
+       reportList = new ArrayList<Report>();
 
         simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
 
@@ -167,8 +166,8 @@
                     NodeList textreportLevelList = reportLevelElement.getChildNodes();
                     reportLevel = ((Node) textreportLevelList.item( 0 )).getNodeValue().trim();
 
-                  //  Report reportObj = new Report( reportId, reportName, reportType, reportModel, reportFileName,reportLevel );
-                   // reportList.add( reportObj );
+                   Report reportObj = new Report( reportId, reportName, reportType, reportModel, reportFileName,reportLevel );
+                   reportList.add( reportObj );
 
                 }
             }// end of for loop with s var

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/BenificiaryInfoReportsFormAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/BenificiaryInfoReportsFormAction.java	2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/benificiaryinfo/action/BenificiaryInfoReportsFormAction.java	2010-09-29 02:04:14 +0000
@@ -11,9 +11,9 @@
 import org.hisp.dhis.period.MonthlyPeriodType;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.report.Report;
 import org.hisp.dhis.reports.ReportService;
 import org.hisp.dhis.reports.Report_in;
+import org.hisp.dhis.reports.util.Report;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -23,7 +23,8 @@
 
 import com.opensymphony.xwork2.Action;
 
-public class BenificiaryInfoReportsFormAction implements Action
+public class BenificiaryInfoReportsFormAction
+    implements Action
 {
 
     // -------------------------------------------------------------------------
@@ -39,20 +40,18 @@
 
     private PeriodService periodService;
 
-    public void setPeriodService(PeriodService periodService)
+    public void setPeriodService( PeriodService periodService )
     {
-		this.periodService = periodService;
-	}
-
+        this.periodService = periodService;
+    }
 
     // -------------------------------------------------------------------------
     // Getter & Setter
     // -------------------------------------------------------------------------
 
-
-private List<Report_in> reportList;
-
-    public List<Report_in> getReportList()
+    private List<Report> reportList;
+
+    public List<Report> getReportList()
     {
         return reportList;
     }
@@ -61,17 +60,17 @@
 
     public List<Period> getPeriodList()
     {
-		return periodList;
-	}
+        return periodList;
+    }
 
     private SimpleDateFormat simpleDateFormat;
 
-	public SimpleDateFormat getSimpleDateFormat()
-	{
-		return simpleDateFormat;
-	}
+    public SimpleDateFormat getSimpleDateFormat()
+    {
+        return simpleDateFormat;
+    }
 
-	private String raFolderName;
+    private String raFolderName;
 
     // -------------------------------------------------------------------------
     // Action implementation
@@ -85,11 +84,11 @@
 
         periodList = new ArrayList<Period>( periodService.getPeriodsByPeriodType( new MonthlyPeriodType() ) );
 
-       // reportList = new ArrayList<Report>();
+        reportList = new ArrayList<Report>();
 
         simpleDateFormat = new SimpleDateFormat( "MMM-yyyy" );
 
-        System.out.println("periodList.size " + periodList.size());
+        System.out.println( "periodList.size " + periodList.size() );
 
         getSelectedReportList();
 
@@ -168,8 +167,9 @@
                     NodeList textreportLevelList = reportLevelElement.getChildNodes();
                     reportLevel = ((Node) textreportLevelList.item( 0 )).getNodeValue().trim();
 
-                   // Report reportObj = new Report(reportId, reportName, reportType, reportModel, reportFileName, reportLevel);
-                   // reportList.add( reportObj );
+                    Report reportObj = new Report( reportId, reportName, reportType, reportModel, reportFileName,
+                        reportLevel );
+                    reportList.add( reportObj );
 
                 }
             }// end of for loop with s var

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsFormAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsFormAction.java	2010-08-28 10:15:38 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsFormAction.java	2010-09-29 02:04:14 +0000
@@ -13,8 +13,7 @@
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
-import org.hisp.dhis.report.Report;
-import org.hisp.dhis.reports.Report_in;
+import org.hisp.dhis.reports.util.Report;
 import org.hisp.dhis.reports.util.ReportService;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -25,7 +24,8 @@
 
 import com.opensymphony.xwork2.Action;
 
-public class PortalReportsFormAction implements Action
+public class PortalReportsFormAction
+    implements Action
 {
 
     // -------------------------------------------------------------------------
@@ -40,40 +40,38 @@
     }
 
     private PeriodService periodService;
-    
-    public void setPeriodService(PeriodService periodService) 
+
+    public void setPeriodService( PeriodService periodService )
     {
-		this.periodService = periodService;
-	}
-    
-    
+        this.periodService = periodService;
+    }
+
     // -------------------------------------------------------------------------
     // Getter & Setter
     // -------------------------------------------------------------------------
 
-
-private List<Report_in> reportList;
-
-    public List<Report_in> getReportList()
+    private List<Report> reportList;
+
+    public List<Report> getReportList()
     {
         return reportList;
     }
-    
+
     private List<Period> periodList;
-    
-    public List<Period> getPeriodList() 
+
+    public List<Period> getPeriodList()
     {
-		return periodList;
-	}
+        return periodList;
+    }
 
     private SimpleDateFormat simpleDateFormat;
-    
-	public SimpleDateFormat getSimpleDateFormat() 
-	{
-		return simpleDateFormat;
-	}
-
-	private String raFolderName;
+
+    public SimpleDateFormat getSimpleDateFormat()
+    {
+        return simpleDateFormat;
+    }
+
+    private String raFolderName;
 
     private Collection<PeriodType> periodTypes;
 
@@ -81,13 +79,14 @@
     {
         return periodTypes;
     }
-    
+
     private Collection<Period> periods = new ArrayList<Period>();
 
     public Collection<Period> getPeriods()
     {
         return periods;
     }
+
     // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
@@ -97,12 +96,12 @@
         throws Exception
     {
         raFolderName = reportService.getRAFolderName();
-        
+
         periodList = new ArrayList<Period>( periodService.getPeriodsByPeriodType( new MonthlyPeriodType() ) );
         periods.addAll( periodList );
-        
-       // reportList = new ArrayList<Report>();
-        
+
+        reportList = new ArrayList<Report>();
+
         getSelectedReportList();
 
         return SUCCESS;
@@ -132,7 +131,7 @@
         String reportType = "";
         String reportLevel = "";
         String reportModel = "";
-        String reportFileName = "";        
+        String reportFileName = "";
 
         try
         {
@@ -179,10 +178,10 @@
                     Element reportLevelElement = (Element) reportLevelList.item( 0 );
                     NodeList textreportLevelList = reportLevelElement.getChildNodes();
                     reportLevel = ((Node) textreportLevelList.item( 0 )).getNodeValue().trim();
- 
-                    //Report reportObj = new Report(reportId, reportName, reportType, reportModel, reportFileName, reportLevel);
-                    //reportList.add( reportObj );       
-                    
+
+                    Report reportObj = new Report(reportId, reportName, reportType, reportModel, reportFileName, reportLevel);
+                    reportList.add( reportObj );
+
                 }
             }// end of for loop with s var
         }// try block end

=== added file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/util/Report.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/util/Report.java	1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/util/Report.java	2010-09-29 02:04:14 +0000
@@ -0,0 +1,148 @@
+package org.hisp.dhis.reports.util;
+
+/**
+ * Report is to store/capture the information regarding one Report which will
+ * available from xml file
+ */
+public class Report
+{
+    /**
+     * Unique Id
+     */
+    private String id;
+
+    /**
+     * Report Name
+     */
+    private String name;
+
+    /**
+     * type is whether it is monthly report, yearly, daily etc
+     */
+    private String type;
+
+    /**
+     * model is whether this report is static or dynamic
+     */
+    private String model;
+
+    /**
+     * fileName is the Template File Name for this report
+     */
+    private String fileName;
+    
+    /**
+     * set is the organization unit group set for this report
+     */
+    private String set;
+
+    /**
+     * level represents for which orgunit level this report corresponds
+     */
+    private String level;
+
+    // -------------------------------------------------------------------------
+    // Constructors
+    // -------------------------------------------------------------------------
+
+    public Report()
+    {
+
+    }
+
+    public Report( String id, String name, String type, String model, String fileName, String level )
+    {
+        this.id = id;
+        this.name = name;
+        this.type = type;
+        this.model = model;
+        this.fileName = fileName;
+        this.level = level;
+    }
+    
+    public Report( String id, String name, String type, String model, String fileName, String set, String level )
+    {
+        this.id = id;
+        this.name = name;
+        this.type = type;
+        this.model = model;
+        this.fileName = fileName;
+        this.set = set;
+        this.level = level;
+    }
+
+    // -------------------------------------------------------------------------
+    // Getters and setters
+    // -------------------------------------------------------------------------
+
+    public String getId()
+    {
+        return id;
+    }
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+
+    public void setType( String type )
+    {
+        this.type = type;
+    }
+
+    public String getModel()
+    {
+        return model;
+    }
+
+    public void setModel( String model )
+    {
+        this.model = model;
+    }
+
+    public String getFileName()
+    {
+        return fileName;
+    }
+
+    public void setFileName( String fileName )
+    {
+        this.fileName = fileName;
+    }
+
+    public String getSet()
+    {
+        return set;
+    }
+
+    public void setSet( String set )
+    {
+        this.set = set;
+    }
+    
+    public void setLevel( String level )
+    {
+        this.level = level;
+    }   
+
+    public String getLevel()
+    {
+        return level;
+    }
+
+}