Diff test

Java code posted by MagicTonton
created at 10 Jul 15:20

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Modified: trunk/src/com/se/server/events/servlets/EventServiceImpl.java
===================================================================
--- trunk/src/com/se/server/events/servlets/EventServiceImpl.java  2011-07-05 16:16:18 UTC (rev 1104)
+++ trunk/src/com/se/server/events/servlets/EventServiceImpl.java  2011-07-05 20:20:29 UTC (rev 1105)
@@ -33,6 +33,7 @@
 import com.se.server.main.security.Logger;
 import com.se.server.main.settings.ApplicationSettings;
 import com.se.server.main.util.DateConverter;
+import com.se.server.main.util.PDFHeaderFooter;
 import com.se.server.servletpattern.SafeServiceServlet;
 
 @SuppressWarnings("serial")
@@ -493,7 +494,7 @@
           + "<h1 align=\"center\"><b>Master List</b></h1><br /><br />").getBytes());
 
       outputTmp.write(new String("" +
-          "<table border=\"1\" cellspacing=\"0\" width=\"800\" align=\"center\">" +
+          "<table border=\"1\" cellspacing=\"0\" width=\"750\" align=\"center\">" +
           "<thead>" +
           "<tr style=\"background-color: #f3f3f3;\"><td><b>N°</b></td><td><b>Compétitor</b></td><td><b>Horse</b></td><td><b>Category</b></td></tr>" +
           "</thead>").getBytes());
@@ -511,7 +512,9 @@
         }
       }
 
-      outputTmp.write(new String("</table></body></html>").getBytes());
+      outputTmp.write(new String("</table>" +
+          PDFHeaderFooter.getPDFFooter() +
+          "</body></html>").getBytes());
 
       outputTmp.close();
 
@@ -576,7 +579,7 @@
             + "<h2 align=\"center\">" + c.getName() + "</h2>").getBytes());
 
       outputTmp.write(new String("" +
-          "<table style=\"border-collapse:collapse;\" border=\"1\" cellspacing=\"0\" width=\"800\" align=\"center\">" +
+          "<table style=\"border-collapse:collapse;\" border=\"1\" cellspacing=\"0\" width=\"750\" align=\"center\">" +
           "<thead>" +
           "<tr style=\"background-color: #f3f3f3;\"><td><b>N°</b></td><td><b>Compétitor</b></td><td><b>Horse</b></td></tr>" +
           "</thead>").getBytes());
@@ -594,7 +597,9 @@
         }
       }
 
-      outputTmp.write(new String("</table></body></html>").getBytes());
+      outputTmp.write(new String("</table>" +
+          PDFHeaderFooter.getPDFFooter() + 
+          "</body></html>").getBytes());
 
       outputTmp.close();
 

Modified: trunk/src/com/se/server/invoicing/servlets/ShopServiceImpl.java
===================================================================
--- trunk/src/com/se/server/invoicing/servlets/ShopServiceImpl.java  2011-07-05 16:16:18 UTC (rev 1104)
+++ trunk/src/com/se/server/invoicing/servlets/ShopServiceImpl.java  2011-07-05 20:20:29 UTC (rev 1105)
@@ -33,6 +33,7 @@
 import com.se.server.main.rights.Rights;
 import com.se.server.main.security.Logger;
 import com.se.server.main.settings.ApplicationSettings;
+import com.se.server.main.util.PDFHeaderFooter;
 import com.se.server.servletpattern.SafeServiceServlet;
 
 @SuppressWarnings("serial")
@@ -431,7 +432,7 @@
           "</td></tr><tr bgcolor=\"#eeeeee\"><th align=\"left\">TOTAL"
               + " à régler</th><td align=\"right\"><b>"
               + java.text.NumberFormat.getCurrencyInstance(Locale.FRANCE)
-                  .format(total) + "</b></td></tr></table></body></html>")
+                  .format(total) + "</b></td></tr></table>" + PDFHeaderFooter.getPDFFooter() +"</body></html>")
           .getBytes());
 
       outputTmp.close();
@@ -609,7 +610,7 @@
           "</td></tr><tr bgcolor=\"#eeeeee\"><th align=\"left\">TOTAL"
               + " à régler</th><td align=\"right\"><b>"
               + java.text.NumberFormat.getCurrencyInstance(Locale.FRANCE)
-                  .format(total) + "</b></td></tr></table></body></html>")
+                  .format(total) + "</b></td></tr></table>" + PDFHeaderFooter.getPDFFooter() +"</body></html>")
           .getBytes());
 
       outputTmp.close();

Added: trunk/src/com/se/server/main/util/PDFHeaderFooter.java
===================================================================
--- trunk/src/com/se/server/main/util/PDFHeaderFooter.java                          (rev 0)
+++ trunk/src/com/se/server/main/util/PDFHeaderFooter.java  2011-07-05 20:20:29 UTC (rev 1105)
@@ -0,0 +1,9 @@
+package com.se.server.main.util;
+
+public class PDFHeaderFooter {
+
+  public static String getPDFFooter() {
+    return "<style type=\"text/css\">h4{font-size: 14px; font-variant:normal;} </style>" +
+        "<h4><center>Laurent Gallice - Office Rider - Copyright 2011, all rights reserved</center></h4>";
+  }
+}
4.3 KB in 9 ms with coderay