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

Comparing projects/cms/source/reports/DBReporter/IscreamLayout.java (file contents):
Revision 1.10 by pjm2, Sun Jan 7 13:58:05 2001 UTC vs.
Revision 1.27 by pjm2, Mon Jan 8 10:27:21 2001 UTC

# Line 33 | Line 33 | public class IscreamLayout {
33          bw.write("<html>");
34          bw.write("<head>");
35          bw.write("<title>"+title+"</title>");
36 +        bw.write("<meta http-equiv=\"pragma\" content=\"no-cache\">");
37 +        bw.write("<meta http-equiv=\"cache-control\" content=\"no-cache\">");
38          bw.write("<meta name=\"description\" content=\""+metaDescription+"\">");
39          bw.write("<meta name=\"keywords\" content=\""+metaKeywords+"\">");
40          bw.write("<meta name=\"generator\" content=\"pjm2's DBReporterMain\">");
41          bw.write("</head>");
42          bw.write("<body bgcolor=\"#ffffff\" link=\"#0000ff\" alink=\"#3333cc\" vlink=\"#3333cc\" text=\"#000066\">");
43 <        bw.write("<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\">");
43 >        bw.write("<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" align=\"center\">");
44          bw.write(" <tr>");
45          bw.write("  <td valign=\"top\">");
46          bw.write("");
# Line 50 | Line 52 | public class IscreamLayout {
52          bw.newLine();
53          bw.write("<!--#include virtual=\"../left.inc\" -->");
54          bw.newLine();
53        bw.write("</td><td valign=\"top\">");
54        bw.newLine();
55          bw.flush();
56      }
57      
# Line 65 | Line 65 | public class IscreamLayout {
65          bw.flush();
66      }
67      
68 +    public static void printAllMachines(BufferedWriter bw, LinkedList list) throws IOException{
69 +        bw.write("<table border=\"0\"  align=\"center\">");
70 +        
71 +        Iterator it = list.iterator();
72 +        while (it.hasNext()){
73 +            ReportPage rp = (ReportPage)it.next();            
74 +            bw.write("<tr><td><font size=\"4\"><a href=\"../"+rp.getWhen()+rp.getMachineName()+"."+rp.getReport()+".shtml\">"+rp.getWhen()+rp.getMachineName()+"</a></font></td></tr>");
75 +        }
76 +        
77 +        bw.write("</table>");
78 +        bw.flush();
79 +    }
80 +    
81 +    public static void printMachinesByTime(BufferedWriter bw, LinkedList list, String when) throws IOException{
82 +        bw.write("<table border=\"0\"  align=\"center\">");
83 +        
84 +        Iterator it = list.iterator();
85 +        while (it.hasNext()){
86 +            ReportPage rp = (ReportPage)it.next();
87 +            if (rp.getWhen().equals(when)){
88 +                bw.write("<tr><td><font size=\"4\"><a href=\"../"+rp.getWhen()+rp.getMachineName()+"."+rp.getReport()+".shtml\">"+rp.getMachineName()+"</a></font></td></tr>");
89 +            }
90 +        }
91 +        
92 +        bw.write("</table>");
93 +        bw.flush();
94 +    }
95 +    
96 +    public static void printTimesByMachine(BufferedWriter bw, LinkedList list, String machine_name) throws IOException{
97 +        bw.write("<table border=\"0\"  align=\"center\">");
98 +        
99 +        Iterator it = list.iterator();
100 +        while (it.hasNext()){
101 +            ReportPage rp = (ReportPage)it.next();
102 +            if (rp.getMachineName().equals(machine_name)){
103 +                bw.write("<tr><td><font size=\"4\"><a href=\"../"+rp.getWhen()+rp.getMachineName()+"."+rp.getReport()+".shtml\">"+rp.getWhen()+"</a></font></td></tr>");
104 +            }
105 +        }
106 +        
107 +        bw.write("</table>");
108 +        bw.flush();
109 +    }
110 +
111      public static void printGraph(BufferedWriter bw, String filename, int width, int height, int type, long startDate, long endDate) throws IOException{
112          
113          String graphTitle = "Unknown time period";
# Line 78 | Line 121 | public class IscreamLayout {
121                  graphTitle = "Hourly report from "+DateUtils.dateString(startDate)+" to "+DateUtils.dateString(endDate);
122                  scaleRow = " <tr><td>&nbsp;</td>";
123                  for (long i = startDate; i < endDate; i+=DateUtils.secsPerHour/6){
124 <                    scaleRow += "<td><font size=\"2\">"+DateUtils.timeString(i)+"</font></td>";
124 >                    scaleRow += "<td align=\"left\" width=\""+(100/colspan)+"%\"><font size=\"2\">&gt;"+DateUtils.timeString(i)+"</font></td>";
125                  }
126                  scaleRow += "</tr>";
127                  colspan = 6;
# Line 87 | Line 130 | public class IscreamLayout {
130                  graphTitle = "24 hour report from "+DateUtils.dateString(startDate)+" to "+DateUtils.dateString(endDate);
131                  scaleRow = " <tr><td>&nbsp;</td>";
132                  for (int i = 0; i < 24; i++){
133 <                    scaleRow += "<td><font size=\"2\">"+i+"</font></td>";
133 >                    scaleRow += "<td align=\"center\" width=\""+(100/colspan)+"%\"><font size=\"2\">"+i+"</font></td>";
134                  }
135                  scaleRow += "</tr>";
136                  colspan = 24;
137                  break;
138              case ReportPage.WEEK:
139                  graphTitle = "7 day report from "+DateUtils.shortDateString(startDate)+" to "+DateUtils.shortDateString(endDate);
140 +                colspan = 7;
141                  scaleRow = " <tr><td>&nbsp;</td>";
142                  for (long i = startDate; i < endDate; i+=DateUtils.secsPerDay){
143 <                    scaleRow += "<td>"+DateUtils.dayName(i)+"</td>";
143 >                    scaleRow += "<td align=\"center\" width=\""+(100/colspan)+"%\">"+DateUtils.dayName(i)+"</td>";
144                  }
145                  scaleRow += "</tr>";
102                colspan = 7;
146                  break;
147              case ReportPage.MONTH:
148                  graphTitle = "30 day report from "+DateUtils.shortDateString(startDate)+" to "+DateUtils.shortDateString(endDate);
# Line 112 | Line 155 | public class IscreamLayout {
155          
156          bw.write("<table border=\"0\">");
157          bw.write(" <tr><td>&nbsp;</td><td colspan=\""+colspan+"\"><b>"+graphTitle+"</b></td></tr>");
158 <        bw.write(" <tr><td>"+yAxisTitle+"</td><td colspan=\""+colspan+"\"><img src=\""+filename+"\" width=\""+width+"\" height=\""+height+"\"></td></tr>");
158 >        bw.write(" <tr><td valign=\"top\" align=\"right\">max</td><td colspan=\""+colspan+"\" rowspan=\"3\"><img src=\""+filename+"\" width=\""+width+"\" height=\""+height+"\"></td></tr><tr><td valign=\"middle\" align=\"right\">"+yAxisTitle+"</td></tr><tr><td valign=\"bottom\" align=\"right\">min</td></tr>");
159          bw.write(scaleRow);
160          bw.write("</table>");
161          bw.newLine();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines