ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/reports/DBReporter/SHTMLMaker.java
(Generate patch)

Comparing projects/cms/source/reports/DBReporter/SHTMLMaker.java (file contents):
Revision 1.5 by pjm2, Sun Jan 7 12:49:28 2001 UTC vs.
Revision 1.12 by pjm2, Thu Jan 11 19:03:04 2001 UTC

# Line 1 | Line 1
1 < //---PACKAGE DECLARATION---
2 <
3 < //---IMPORTS---
4 < import java.io.*;
5 <
6 <
7 < /**
8 < * Produces an SHTML document.
9 < *
10 < * @author  $Author$
11 < * @version $Id$
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$";
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 <        IscreamLayout.printTable(bw, _pd);
64 <        
65 <        IscreamLayout.printBottom(bw);
66 <        
67 <        bw.flush();
68 <        bw.close();
69 <        
70 <        System.out.println("            - Written SHTML page");
71 <        
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 <    private int _type;
101 <    private long _startDate;
102 <    private long _endDate;
103 <
104 < //---STATIC ATTRIBUTES---
105 <
106 < }
1 > //---PACKAGE DECLARATION---
2  
3 +
4  
5 + //---IMPORTS---
6  
7 + import java.io.*;
8  
9 +
10  
11 +
12  
13 + /**
14  
15 + * Produces an SHTML document.
16  
17 + *
18  
19 + * @author  $Author$
20  
21 + * @version $Id$
22  
23 + */
24  
25 + public class SHTMLMaker {
26  
27 +
28  
29 + //---FINAL ATTRIBUTES---
30  
31 +
32  
33 +    /**
34  
35 +     * The current CVS revision of this class
36  
37 +     */
38  
39 +    public final String REVISION = "$Revision$";
40  
41 +
42  
43 + //---STATIC METHODS---
44  
45 +
46  
47 + //---CONSTRUCTORS---
48  
49 +
50  
51 +    public SHTMLMaker(String metaDescription, String metaKeywords, String title, String friendlyName, String graphFile, int width, int height, PlotData pd, int type, long startDate, long endDate){
52  
53 +    
54  
55 +        _metaDescription = metaDescription;
56  
57 +        _metaKeywords = metaKeywords;
58  
59 +        _title = title;
60  
61 +        _friendlyName = friendlyName;
62  
63 +        _graphFile = graphFile;
64  
65 +        _width = width;
66  
67 +        _height = height;
68  
69 +        _pd = pd;
70  
71 +        _type = type;
72  
73 +        _startDate = startDate;
74  
75 +        _endDate = endDate;
76  
77 +    
78  
79 +    }
80  
81 +
82  
83 +    public void writePage(String filename) throws IOException{
84  
85 +
86  
87 +        BufferedWriter bw = null;
88  
89 +        try {
90  
91 +            bw = new BufferedWriter(new FileWriter(filename));
92  
93 +        }
94  
95 +        catch (IOException e){
96  
97 +            System.out.println("Could not write to the SHTML page: "+e);
98  
99 +        }
100  
101 +        
102  
103 +        // Use the layout functions in SHTMLLayout...
104  
105 +        
106  
107 +        IscreamLayout.printDocType(bw);
108  
109 +        
110  
111 +        IscreamLayout.printHeader(bw, _title, _metaDescription, _metaKeywords);
112  
113 +        
114  
115 +        IscreamLayout.printLeftMenu(bw);
116  
117 +        
118  
119 +        IscreamLayout.printTitle(bw, _title+"<br>"+"("+_friendlyName+")");
120  
121 +        
122  
123 +        IscreamLayout.printGraph(bw, _graphFile, _width, _height, _type, _startDate, _endDate);
124  
125 +        
126  
127 +        // Let's leave this bit out for now...
128  
129 +        //IscreamLayout.printTable(bw, _pd);
130  
131 +        
132  
133 +        IscreamLayout.printBottom(bw);
134  
135 +        
136  
137 +        bw.flush();
138  
139 +        bw.close();
140  
141 +        
142  
143 +        System.out.println("            - Written SHTML page");
144  
145 +        
146  
147 +    }
148  
149 +        
150  
151 + //---PUBLIC METHODS---
152  
153 +
154  
155 +
156  
157 +    /**
158  
159 +     * Overrides the {@link java.lang.Object#toString() Object.toString()}
160  
161 +     * method to provide clean logging (every class should have this).
162  
163 +     *
164  
165 +     * @return the name of this class and its CVS revision
166  
167 +     */
168  
169 +    public String toString() {
170  
171 +        return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")";
172  
173 +    }
174  
175 +
176  
177 + //---PRIVATE METHODS---
178  
179 +
180  
181 + //---ACCESSOR/MUTATOR METHODS---
182  
183 +
184  
185 + //---ATTRIBUTES---
186  
187 +
188  
189 +    private String _metaDescription;
190  
191 +    private String _metaKeywords;
192  
193 +    private String _title;
194  
195 +    private String _friendlyName;
196  
197 +    private String _graphFile;
198  
199 +    private int _width;
200  
201 +    private int _height;
202  
203 +    private PlotData _pd;
204  
205 +    private int _type;
206  
207 +    private long _startDate;
208  
209 +    private long _endDate;
210  
211 +
212  
213 + //---STATIC ATTRIBUTES---
214  
215 +
216  
217 + }
218  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines