KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cowsultants > itracker > web > reports > ITrackerReport


1 /*
2  * This software was designed and created by Jason Carroll.
3  * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4  * The author can be reached at jcarroll@cowsultants.com
5  * ITracker website: http://www.cowsultants.com
6  * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it only under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  */

18
19 package cowsultants.itracker.web.reports;
20
21 import java.util.*;
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletResponse JavaDoc;
24 import javax.servlet.http.HttpSession JavaDoc;
25
26 import org.apache.struts.action.ActionMapping;
27
28 import cowsultants.itracker.ejb.client.exceptions.ReportException;
29 import cowsultants.itracker.ejb.client.models.IssueModel;
30 import cowsultants.itracker.ejb.client.models.ReportModel;
31
32 public interface ITrackerReport {
33
34     /**
35       * Initializes the report. It will be called immediately after the ITrackerReport
36       * object is created.
37       * @param issues an array of issues that is supplied as the data
38       * @param report the report as a ReportModel
39       * @param locale the locale to be used for the report output
40       * @param reportOutput the requested output method
41       * @param session the session of the user who ran the report. Can be used for storage, or to determine user attributes
42       * @exception ReportException thrown if the report has not been properly initialized
43       */

44     public void initializeReport(IssueModel[] issues, ReportModel report, Locale locale, String JavaDoc reportOutput, HttpSession JavaDoc session) throws ReportException;
45
46     /**
47       * This method should be called after initializeReport. It is provided so that the abstract
48       * class can have a default initialization, and still allow subclasses to add their own
49       * logic.
50       * @exception ReportException thrown if the report has not been properly augmented
51       */

52     public void augmentReport() throws ReportException;
53
54     /**
55       * Outputs the report as PDF. It can be assumed that the initializeReport and augementReport have
56       * already been called prior to this method.
57       * @param request the HttpServletRequest for the report request
58       * @param response the HttpServletResponse to send the report output
59       * @param mapping the ActionMapping for the display report action
60       * @exception ReportException thrown if there is an error outputing the report as PDF
61       */

62     public void outputPDF(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, ActionMapping mapping) throws ReportException;
63
64     /**
65       * Outputs the report as HTML. It can be assumed that the initializeReport and augementReport have
66       * already been called prior to this method.
67       * @param request the HttpServletRequest for the report request
68       * @param response the HttpServletResponse to send the report output
69       * @param mapping the ActionMapping for the display report action
70       * @exception ReportException thrown if there is an error outputing the report as HTML
71       */

72     public void outputHTML(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, ActionMapping mapping) throws ReportException;
73
74     /**
75       * Outputs the report as an Excel spreadsheet (XLS). It can be assumed that the initializeReport and augementReport have
76       * already been called prior to this method.
77       * @param request the HttpServletRequest for the report request
78       * @param response the HttpServletResponse to send the report output
79       * @param mapping the ActionMapping for the display report action
80       * @exception ReportException thrown if there is an error outputing the report as XLS
81       */

82     public void outputXLS(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, ActionMapping mapping) throws ReportException;
83
84     /**
85       * Outputs the report as CSV. It can be assumed that the initializeReport and augementReport have
86       * already been called prior to this method.
87       * @param request the HttpServletRequest for the report request
88       * @param response the HttpServletResponse to send the report output
89       * @param mapping the ActionMapping for the display report action
90       * @exception ReportException thrown if there is an error outputing the report as CSV
91       */

92     public void outputCSV(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, ActionMapping mapping) throws ReportException;
93
94     /**
95       * Returns the current report object. The class of the report depends on underlying framework
96       * the report is based upon.
97       * @exception ReportException thrown if the report has not been properly initialized
98       */

99     public Object JavaDoc getReport() throws ReportException;
100 }
101
Popular Tags