ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/SHTMLMaker.java
Revision: 1.11
Committed: Sun Jan 7 21:09:31 2001 UTC (24 years, 11 months ago) by pjm2
Branch: MAIN
Changes since 1.10: +4 -2 lines
Log Message:
Included a friendly report name on the 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 friendlyName, 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 _friendlyName = friendlyName;
32 _graphFile = graphFile;
33 _width = width;
34 _height = height;
35 _pd = pd;
36 _type = type;
37 _startDate = startDate;
38 _endDate = endDate;
39
40 }
41
42 public void writePage(String filename) throws IOException{
43
44 BufferedWriter bw = null;
45 try {
46 bw = new BufferedWriter(new FileWriter(filename));
47 }
48 catch (IOException e){
49 System.out.println("Could not write to the SHTML page: "+e);
50 }
51
52 // Use the layout functions in SHTMLLayout...
53
54 IscreamLayout.printDocType(bw);
55
56 IscreamLayout.printHeader(bw, _title, _metaDescription, _metaKeywords);
57
58 IscreamLayout.printLeftMenu(bw);
59
60 IscreamLayout.printTitle(bw, _title+"<br>"+"("+_friendlyName+")");
61
62 IscreamLayout.printGraph(bw, _graphFile, _width, _height, _type, _startDate, _endDate);
63
64 // Let's leave this bit out for now...
65 //IscreamLayout.printTable(bw, _pd);
66
67 IscreamLayout.printBottom(bw);
68
69 bw.flush();
70 bw.close();
71
72 System.out.println(" - Written SHTML page");
73
74 }
75
76 //---PUBLIC METHODS---
77
78
79 /**
80 * Overrides the {@link java.lang.Object#toString() Object.toString()}
81 * method to provide clean logging (every class should have this).
82 *
83 * @return the name of this class and its CVS revision
84 */
85 public String toString() {
86 return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
87 }
88
89 //---PRIVATE METHODS---
90
91 //---ACCESSOR/MUTATOR METHODS---
92
93 //---ATTRIBUTES---
94
95 private String _metaDescription;
96 private String _metaKeywords;
97 private String _title;
98 private String _friendlyName;
99 private String _graphFile;
100 private int _width;
101 private int _height;
102 private PlotData _pd;
103 private int _type;
104 private long _startDate;
105 private long _endDate;
106
107 //---STATIC ATTRIBUTES---
108
109 }