View Javadoc

1   /*
2    * $Source: /usr/cvsroot/MelatiSite/src/main/java/org/paneris/melati/site/Populate.java,v $
3    * $Revision: 1.4 $
4    *
5    *
6    * Contact details for copyright holder:
7    * 
8    *  Tim Pizey (timp@paneris.org)
9    */
10  package org.paneris.melati.site;
11  
12  import org.melati.Melati;
13  import org.melati.servlet.PoemServlet;
14  import org.melati.util.MelatiWriter;
15  import org.paneris.melati.site.model.Page;
16  import org.paneris.melati.site.model.SiteDatabaseTables;
17  
18  /**
19   *  Url http://localhost/page/org.paneris.melati.site.Populate/site
20   */
21  
22  public class Populate extends PoemServlet {
23  
24    private static final long serialVersionUID = 1L;
25  
26    private SiteDatabaseTables db;
27  
28    protected void doPoemRequest(Melati melati) throws Exception {
29  
30      db = (SiteDatabaseTables)melati.getDatabase();
31  
32      melati.getResponse().setContentType("text/html");
33      MelatiWriter output = melati.getWriter();
34  
35      output.write(
36        "<html>\n"
37          + "<head>\n"
38          + "<title>"
39          + melati.getPoemContext().getLogicalDatabase()
40          + " Database Population</title>\n");
41      output.write("</head>\n" + "<body>\n");
42      output.write(
43        "<h1 align=center>"
44          + melati.getPoemContext().getLogicalDatabase()
45          + " database</h1>\n");
46      // set up our types 
47  
48  
49        db.getUploadedFileTypeTable().ensure("Image");
50        db.getUploadedFileTypeTable().ensure("HTML page");
51        db.getUploadedFileTypeTable().ensure("HTML body");
52        db.getUploadedFileTypeTable().ensure("Word doc");
53        db.getUploadedFileTypeTable().ensure("PDF");
54        db.getUploadedFileTypeTable().ensure("Template");
55  
56        db.getLinkTypeTable().ensure("Normal", "Internal site link");
57        db.getLinkTypeTable().ensure("Popup", "Popup window");
58        db.getLinkTypeTable().ensure("Offsite", "New window");
59  
60        db.getStyleTable().ensure("default");
61  
62  
63      Page home = 
64        db.getPageTable().ensure("Home", null, "Home",
65            "      <h1>Welcome</h1>\n" +
66            "<p>Welcome.</p>\n");
67  
68  
69        db.getPageTable().ensure("About Us", home, 
70                                 "About Us", 
71                                 "<h1>About Us</h1>\n" +
72                                 "<p>\n" +
73                                 "Wemyss Vintage Malts came into being because of the long standing passion\n" + 
74                                 "the family of the same name have for malt whisky.\n" +
75                                 "It's as simple as that.\n" +
76                                 "The name is pronounced <i>Weems</i> and it's the Scots word for caves.\n" +
77                                 "</p>\n" +
78                                 "<p>\n" +
79                                 "The family come from Fife and their home,\n" +
80                                 "since the turn of the 13th century,\n" +
81                                 "is Wemyss Castle which sits on top of an outcrop of rocks and caves\n" +
82                                 "three hundred foot above the Firth of Forth looking back towards Edinburgh.\n" +
83                                 "</p>\n\n" +
84                                 "<p>\n" +
85                                 "Their connections with the industry date back to the turn of the 19th century \n" +
86                                 "when John Haig (founder of Haig's) built his first distillery on Wemyss land.\n" +
87                                 "Even today barley from the Wemyss Estate " + 
88                                 "is prized by many of the leading distillers.\n" +
89                                 "</p>\n");
90  
91  
92  
93  
94        db.getPageTable().ensure("The Malts", home, "The Malts", 
95            "<h1>The Malts</h1>\n" +
96            "<p>\n" +
97            "Each cask of malt has its own unique character,\n" +
98            "so it is not suprising that distilleries blend together many different\n" +
99            "casks to achieve taste consistency for their single malt brands -\n" +
100           "it makes a lot of sense.\n" +
101           "We believe that by doing this something can get lost.\n" + 
102           "</p>\n" +
103           "<p>\n" +
104           "Our malts are from a single cask.\n" +
105           "The casks are meticulously selected,\n" +
106           "with the help of industry expert Charlie Maclean\n" +
107           "(author of eight books on the subject of malt whisky),\n" +
108           "and only the truly exceptional casks are chosen.\n" +
109           "These casks, due to their individuality,\n" +
110           "are not necessarily representative of the distillery make and \n" +
111           "consequently each one is attributed a name based on its own taste and aroma.\n" +
112           "Due to the nature of a single cask selection supply is very limited\n" +
113           "and is usually restricted to between three and four hundred bottles.\n" +
114           "</p>\n" +
115           "<p>\n" +
116           "All are bottled at a minimum of 46% with a select few being bottled at\n" +
117           "cask strength under The Earl's Reserve label.\n" +
118           "None of them are chill-filtered as well as being fee of artificial colouring,\n" +
119           "such as caramel.\n" +
120           "That way they reach you in their natural state.\n" +
121           "</p>\n" +
122           "<p>\n" +
123           "For list of available casks please goto the <a href='Sales.html'>sales</a> page.\n" +
124           "</p>");
125 
126 
127 
128       db.getPageTable().ensure("The Regions", home, "The Regions", 
129     "        <h1>The Regions</h1>\n" +
130     "        <p> The core of our philosophy at Wemyss Vintage Malts is that our malts\n" + 
131     "          should reflect the region from which they come. Consequently, we present\n" + 
132     "          our malts on a regional basis reflecting the different taste profiles. \n" +
133     "        </p><br>\n" +
134     "        <p> Currently, there are four different malts in the range: Speyside,\n" + 
135     "          Highland, Islay and Lowland. </p>\n" +
136     "        <p> The following provides a brief overview of the taste profiles of the\n" + 
137     "          different regions: </p><br>\n" +
138     "        <h2>Islay</h2>\n" +
139     "        <p> The most distinctively flavoured of all malts. The island has a bountiful\n" + 
140     "          supply of peat which is constantly lashed by the wind, rain and sea. \n" +
141     "          All these elements come through strongly in its malts, often described \n" +
142     "          as <i>seaweed</i>, <i>iodine</i> or even <i>peat monsters</i>. In all \n" +
143     "          there are eight distilleries, but not all are working. </p><br>\n" +
144     "        <h2>Highland</h2>\n" +
145     "        <p> The most geographically spread out region which consequently has the \n" + 
146     "          most taste diversity. Many of the more northern malts have spicy or \n" +
147     "          heathery characteristics whilst the Eastern Highlands are more fruity. \n" +
148     "        </p><br>\n" +
149     "        <h2>Speyside</h2>\n" +
150     "        <p> Really a sub region of Highland, but they are noted for their elegance,\n" + 
151     "          complexity and sweetness/mellow characteristics. More than 40 distilleries\n" + 
152     "          are present in this region which stretches from the River Findhorn in \n" +
153     "          the West to the Deveron in the East, and takes in the Livet. </p><br>\n" +
154     "        <h2>Lowland</h2>\n" +
155     "        <p> Tends to produce whiskies which are softer and more approachable,\n" + 
156     "          with a general lack of peatiness of its Highland cousins. The region \n" +
157     "          today has only two operating distilleries. Generally much more mellow. \n" +
158     "        </p><br>\n" +
159     "        <h2>Campbeltown</h2>\n" +
160     "        <p> Briny in character with a hint of peatiness. A connoisseur's region.\n" + 
161     "          The region once had about thirty distilleries, today it has only two. \n" +
162     "        </p>\n");
163 
164  
165       db.getPageTable().ensure("News", home, "News",
166           "<h1>News</h1>\n" +
167           "<p>\n" +
168           "<font color='green'>\n" +
169           "      Same as <a href='http://www.fontyspoolwines.com.au/news/'>" + 
170           "Fonty's Pool web site</a> ie so we can upload Press Releases and \n" +
171           "      also a 'subscribe to our newsletter' as a drop down menu.\n" +
172           "</font>\n" +
173           "</p>");
174 
175  
176       db.getPageTable().ensure("Sales", home, "Sales",
177     "<h1>Sales</h1>\n" +
178     "<p> You can purchase the full range of single casks directly by filling\n" + 
179     "  in the order form below. You will then be contacted for payment. Orders \n" +
180     "  of less than &pound;50 unfortunately necessitate a &pound;6.50 delivery \n" +
181     "  charge to mainland UK. For other destinations please contact us. </p>\n" +
182     "<p><font color='green'>(An online order form as per " + 
183     "<a href='http://www.fontyspoolwines.com.au/sales/'>Fonty's</a>, not secure\n" + 
184     "  e-commerce, which arrives via email to do@wdc.co.uk. Must be changeable)</font>\n" + 
185     "</p>\n" +
186     "<table width='90%' border='1' align='left' " + 
187     "cellpadding='3' cellspacing='2' bordercolor='#FFFFFF' bgcolor='#CCCC99' class='sales'>\n" +
188     "  <tr bgcolor='#CCCC99'> \n" +
189     "    <th class='sales'> Item </th>\n" +
190     "    <th class='sales'> Tasting Note </th>\n" +
191     "    <th class='sales'> Price </th>\n" +
192     "    <th class='sales'> Quantity </th>\n" +
193     "  </tr>\n" +
194     "  <tr align='left' valign='middle' bgcolor='#FFFFCC'>\n" + 
195     "    <td class='sales'> Single Highland Malt, 13 yr old </td>\n" +
196     "    <td class='sales'> Fruity and juicy on the nose, just like the apples.\n" + 
197     "     An all purpose malt. </td>\n" +
198     "    <td class='sales'> &pound;35.00 </td>\n" +
199     "    <td class='sales'>&nbsp; </td>\n" +
200     "  </tr>\n" +
201     "</table>\n");
202 
203  
204       db.getPageTable().ensure("Contact Us", home, "Contact Us", 
205          "<h1>Contact Us</h1>\n" +
206           "<address>\n" +
207           "Wemyss Vintage Malts Ltd,\n" +
208           "<br>\n" +
209           "Mains House,\n" +
210           "<br>\n" +
211           "East Wemyss,\n" +
212           "<br>\n" +
213           "Fife KY1 4TE\n" +
214           "<br>\n" +
215           "<br>\n" +
216           "Tel: 01592-651-316\n" +
217           "<br>\n" +
218           "Fax: 1592-653233\n" +
219           "<br>\n" +
220           "Email: info@W-V-M.co.uk <font color='green'>(needs setting up)</font>\n" +
221           "</address>\n" 
222      );
223       
224      db.getPageTable().ensure("Trade Info", home, "Trade Info",
225         "<h1>Trade Info</h1>\n" +
226         "<p>\n" +
227         "For enquiries relating to distribution of our products please contact:\n" +
228         "</p>\n" +
229         "<h2>United Kingdom</h2>\n" +
230         "<address>\n" +
231         "Boutinot uk\n" +
232         "<br>\n" +
233         "Boutinot Limited, Brook House\n" +
234         "<br>\n" +
235         "Northenden Road, Gatley\n" +
236         "<br>\n" +
237         "Cheshire, SK8 4DN\n" +
238         "<br>\n" +
239         "<br>\n" +
240         "Tel: 0161-908-1300\n" +
241         "<br>\n" +
242         "Email: jeanw@boutinot.com\n" +
243         "</address>\n" +
244         "<h2>EU</h2>\n" +
245         "<address>\n" +
246         "Rimauresq sarl\n" +
247         "<br>\n" +
248         "c/o Rimauresq SA\n" +
249         "<br>\n" +
250         "Quartier Rimaurets\n" +
251         "<br>\n" +
252         "83790 Pignans\n" + 
253         "<br>\n" +
254         "VAR\n" +
255         "<br>\n" +
256         "FRANCE\n" +
257         "<br>\n" +
258         "<br>\n" +
259         "Tel: +33 494-48-80-45\n" +
260         "<br>\n" +
261         "Email: rimauresq@wanadoo.fr\n" +
262         "</address>\n" +
263         "<h2>Australasia</h2>\n" +
264         "<address>\n" +
265         "Fonty's Pool vineyards pty ltd,\n" +
266         "<br>\n" +
267         "PO Box 1709,\n" + 
268         "Manjimup, \n" +
269         "<br>\n" +
270         "WA 6258, \n" +
271         "<br>\n" +
272         "Australia\n" +
273         "<br>\n" +
274         "<br>\n" +
275         "Tel: +61 8 9777 0788\n" +
276         "<br>\n" +
277         "Email: info@fontyspoolwines.com.au\n" +
278         "</address>");
279      
280 /*
281  This must not exist for the template to be found.
282 
283     Page siteMap = 
284       db.getPageTable().ensure("Site Map", home);
285 */
286 
287 
288     output.write(
289       "<h1 align=center><font color='green'>"
290         + " Populated</font></h1>\n");
291     output.write("</body>\n" + "</html>\n");
292 
293     return;
294   }
295 
296 }