ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/SHTMLMaker.java
Revision: 1.10
Committed: Sun Jan 7 19:54:03 2001 UTC (24 years, 11 months ago) by pjm2
Branch: MAIN
Changes since 1.9: +0 -0 lines
Log Message:
Now including an initial revision of IndexMaker - class that can be
extended to produce a index of several reports.

File Contents

# Content
1 //---PACKAGE DECLARATION---
2
3 //---IMPORTS---
4 import java.io.*;
5
6
7 /**
8 * Produces an SHTML document.
9 *
10 * @author $Author: pjm2 $
11 * @version $Id: SHTMLMaker.java,v 1.4 2000/12/14 17:17:29 pjm2 Exp $
12 */
13 public class SHTMLMaker {
14
15 //---FINAL ATTRIBUTES---
16
17 /**
18 * The current CVS revision of this class
19 */
20 public final String REVISION = "$Revision: 1.4 $";
21
22 //---STATIC METHODS---
23
24 //---CONSTRUCTORS---
25
26 public SHTMLMaker(String metaDescription, String metaKeywords, String title, String graphFile, int width, int height, PlotData pd, int type, long startDate, long endDate){
27
28 _metaDescription = metaDescription;
29 _metaKeywords = metaKeywords;
30 _title = title;
31 _graphFile = graphFile;
32 _width = width;
33 _height = height;
34 _pd = pd;
35 _type = type;
36 _startDate = startDate;
37 _endDate = endDate;
38
39 }
40
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 IscreamLayout.printGraph(bw, _graphFile, _width, _height, _type, _startDate, _endDate);
62
63 // Let's leave this bit out for now...
64 //IscreamLayout.printTable(bw, _pd);
65
66 IscreamLayout.printBottom(bw);
67
68 bw.flush();
69 bw.close();
70
71 System.out.println(" - Written SHTML page");
72
73 }
74
75 //---PUBLIC METHODS---
76
77
78 /**
79 * Overrides the {@link java.lang.Object#toString() Object.toString()}
80 * method to provide clean logging (every class should have this).
81 *
82 * @return the name of this class and its CVS revision
83 */
84 public String toString() {
85 return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
86 }
87
88 //---PRIVATE METHODS---
89
90 //---ACCESSOR/MUTATOR METHODS---
91
92 //---ATTRIBUTES---
93
94 private String _metaDescription;
95 private String _metaKeywords;
96 private String _title;
97 private String _graphFile;
98 private int _width;
99 private int _height;
100 private PlotData _pd;
101 private int _type;
102 private long _startDate;
103 private long _endDate;
104
105 //---STATIC ATTRIBUTES---
106
107 }