ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/Template__Report.java
Revision: 1.1
Committed: Sat Jan 6 21:26:02 2001 UTC (24 years, 11 months ago) by pjm2
Branch: MAIN
Log Message:
A template java class for creating reports.

File Contents

# User Rev Content
1 pjm2 1.1 //---PACKAGE DECLARATION---
2    
3     //---IMPORTS---
4     import java.sql.*;
5    
6     /**
7     * This is a report template.
8     *
9     * @author $Author: $
10     * @version $Id: $
11     */
12     public class Template__Report extends Report {
13    
14     //---FINAL ATTRIBUTES---
15    
16     /**
17     * The current CVS revision of this class
18     */
19     public final String REVISION = "$ Revision: $";
20    
21    
22     //---STATIC METHODS---
23    
24     //---CONSTRUCTORS---
25    
26     public Template__Report(String directory, Statement stmt, String machine_name, long startDate, long endDate){
27     super (directory, stmt, machine_name, startDate, endDate);
28    
29     // Use this key value from the parameter table for the report data.
30     _reportField = "packet.template.name";
31    
32     // Use this select query.
33     _sql = "SELECT template_field_name, value FROM "+DBParameters.PACKET_TABLE+" pkt, "+DBParameters.PARAMETER_TABLE+" param WHERE pkt.id=param.packet_id AND pkt.machine_name='"+ _machine_name+"' AND pkt.receipt_date >= "+_startDate+" AND pkt.receipt_date <= "+_endDate+" AND param.name='"+_reportField+"' ORDER BY pkt.receipt_date;";
34    
35     }
36    
37     //---PUBLIC METHODS---
38    
39    
40     /**
41     * This method overrides the superclass. It should be used to provide
42     * special functionality for the report.
43     */
44     public void createReport(){
45    
46     // Perform special functions here.
47     // .....
48    
49     // Or carry on with the normal method for creating reports.
50     super.createReport();
51     }
52    
53    
54     /**
55     * Overrides the {@link java.lang.Object#toString() Object.toString()}
56     * method to provide clean logging (every class should have this).
57     *
58     * @return the name of this class and its CVS revision
59     */
60     public String toString() {
61     return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
62     }
63    
64     //---PRIVATE METHODS---
65    
66     //---ACCESSOR/MUTATOR METHODS---
67    
68     //---ATTRIBUTES---
69    
70     //---STATIC ATTRIBUTES---
71    
72     }