ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/SHTMLMaker.java
Revision: 1.5
Committed: Sun Jan 7 12:49:28 2001 UTC (24 years, 11 months ago) by pjm2
Branch: MAIN
Changes since 1.4: +10 -4 lines
Log Message:
Graphs now relect the time period for which they have been produced.
Axis titles are now used.
Added a missing </tr> tag.

File Contents

# User Rev Content
1 pjm2 1.1 //---PACKAGE DECLARATION---
2    
3     //---IMPORTS---
4     import java.io.*;
5    
6    
7     /**
8 pjm2 1.2 * Produces an SHTML document.
9 pjm2 1.1 *
10     * @author $Author: pjm2 $
11 pjm2 1.5 * @version $Id: SHTMLMaker.java,v 1.4 2000/12/14 17:17:29 pjm2 Exp $
12 pjm2 1.1 */
13     public class SHTMLMaker {
14    
15     //---FINAL ATTRIBUTES---
16    
17     /**
18     * The current CVS revision of this class
19     */
20 pjm2 1.5 public final String REVISION = "$Revision: 1.4 $";
21 pjm2 1.1
22     //---STATIC METHODS---
23    
24     //---CONSTRUCTORS---
25    
26 pjm2 1.5 public SHTMLMaker(String metaDescription, String metaKeywords, String title, String graphFile, int width, int height, PlotData pd, int type, long startDate, long endDate){
27 pjm2 1.1
28     _metaDescription = metaDescription;
29     _metaKeywords = metaKeywords;
30     _title = title;
31     _graphFile = graphFile;
32     _width = width;
33     _height = height;
34     _pd = pd;
35 pjm2 1.5 _type = type;
36     _startDate = startDate;
37     _endDate = endDate;
38 pjm2 1.1
39 pjm2 1.3 }
40 pjm2 1.1
41     public void writePage(String filename) throws IOException{
42    
43     BufferedWriter bw = null;
44     try {
45     bw = new BufferedWriter(new FileWriter(filename));
46     }
47     catch (IOException e){
48     System.out.println("Could not write to the SHTML page: "+e);
49     }
50    
51     // Use the layout functions in SHTMLLayout...
52    
53     IscreamLayout.printDocType(bw);
54    
55     IscreamLayout.printHeader(bw, _title, _metaDescription, _metaKeywords);
56    
57     IscreamLayout.printLeftMenu(bw);
58    
59     IscreamLayout.printTitle(bw, _title);
60    
61 pjm2 1.5 IscreamLayout.printGraph(bw, _graphFile, _width, _height, _type, _startDate, _endDate);
62 pjm2 1.1
63     IscreamLayout.printTable(bw, _pd);
64    
65     IscreamLayout.printBottom(bw);
66    
67     bw.flush();
68     bw.close();
69    
70 pjm2 1.4 System.out.println(" - Written SHTML page");
71 pjm2 1.1
72     }
73    
74     //---PUBLIC METHODS---
75    
76    
77     /**
78     * Overrides the {@link java.lang.Object#toString() Object.toString()}
79     * method to provide clean logging (every class should have this).
80     *
81     * @return the name of this class and its CVS revision
82     */
83     public String toString() {
84     return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
85     }
86    
87     //---PRIVATE METHODS---
88    
89     //---ACCESSOR/MUTATOR METHODS---
90    
91     //---ATTRIBUTES---
92    
93     private String _metaDescription;
94     private String _metaKeywords;
95     private String _title;
96     private String _graphFile;
97     private int _width;
98     private int _height;
99     private PlotData _pd;
100 pjm2 1.5 private int _type;
101     private long _startDate;
102     private long _endDate;
103 pjm2 1.1
104     //---STATIC ATTRIBUTES---
105    
106     }