ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/SHTMLMaker.java
Revision: 1.3
Committed: Mon Dec 11 21:24:10 2000 UTC (25 years ago) by pjm2
Branch: MAIN
Changes since 1.2: +3 -3 lines
Log Message:
Altered the main method to produce 30-day, 7-day and hourly reports as
well as the original daily reports.  The daily reports should be
archived(?)

Included generation of a list of links.

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.2 2000/12/11 16:42:04 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.2 $";
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){
27
28 _metaDescription = metaDescription;
29 _metaKeywords = metaKeywords;
30 _title = title;
31 _graphFile = graphFile;
32 _width = width;
33 _height = height;
34 _pd = pd;
35
36 }
37
38 public void writePage(String filename) throws IOException{
39
40 BufferedWriter bw = null;
41 try {
42 bw = new BufferedWriter(new FileWriter(filename));
43 }
44 catch (IOException e){
45 System.out.println("Could not write to the SHTML page: "+e);
46 }
47
48 // Use the layout functions in SHTMLLayout...
49
50 IscreamLayout.printDocType(bw);
51
52 IscreamLayout.printHeader(bw, _title, _metaDescription, _metaKeywords);
53
54 IscreamLayout.printLeftMenu(bw);
55
56 IscreamLayout.printTitle(bw, _title);
57
58 IscreamLayout.printGraph(bw, _graphFile, _width, _height);
59
60 IscreamLayout.printTable(bw, _pd);
61
62 IscreamLayout.printBottom(bw);
63
64 bw.flush();
65 bw.close();
66
67 System.out.println(" - Written SHTML page");
68
69 }
70
71 //---PUBLIC METHODS---
72
73
74 /**
75 * Overrides the {@link java.lang.Object#toString() Object.toString()}
76 * method to provide clean logging (every class should have this).
77 *
78 * @return the name of this class and its CVS revision
79 */
80 public String toString() {
81 return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
82 }
83
84 //---PRIVATE METHODS---
85
86 //---ACCESSOR/MUTATOR METHODS---
87
88 //---ATTRIBUTES---
89
90 private String _metaDescription;
91 private String _metaKeywords;
92 private String _title;
93 private String _graphFile;
94 private int _width;
95 private int _height;
96 private PlotData _pd;
97
98 //---STATIC ATTRIBUTES---
99
100 }