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

# 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.11 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 pjm2 1.1
28     _metaDescription = metaDescription;
29     _metaKeywords = metaKeywords;
30     _title = title;
31 pjm2 1.11 _friendlyName = friendlyName;
32 pjm2 1.1 _graphFile = graphFile;
33     _width = width;
34     _height = height;
35     _pd = pd;
36 pjm2 1.5 _type = type;
37     _startDate = startDate;
38     _endDate = endDate;
39 pjm2 1.1
40 pjm2 1.3 }
41 pjm2 1.1
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 pjm2 1.11 IscreamLayout.printTitle(bw, _title+"<br>"+"("+_friendlyName+")");
61 pjm2 1.1
62 pjm2 1.5 IscreamLayout.printGraph(bw, _graphFile, _width, _height, _type, _startDate, _endDate);
63 pjm2 1.1
64 pjm2 1.6 // Let's leave this bit out for now...
65     //IscreamLayout.printTable(bw, _pd);
66 pjm2 1.1
67     IscreamLayout.printBottom(bw);
68    
69     bw.flush();
70     bw.close();
71    
72 pjm2 1.4 System.out.println(" - Written SHTML page");
73 pjm2 1.1
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 pjm2 1.11 private String _friendlyName;
99 pjm2 1.1 private String _graphFile;
100     private int _width;
101     private int _height;
102     private PlotData _pd;
103 pjm2 1.5 private int _type;
104     private long _startDate;
105     private long _endDate;
106 pjm2 1.1
107     //---STATIC ATTRIBUTES---
108    
109     }