velocity.macros
00001 #macro(header)
00002 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
00003 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
00004
00005 <html xmlns="http://www.w3.org/1999/xhtml">
00006 <head><title>Java Web Application Architecture (JWAA)</title>
00007 <meta http-equiv="content-type" content="text/html"/>
00008 <meta name="keywords" content="Java, XML, HTML, XHTML, Servlet"/>
00009 <meta http-equiv="keywords" content="JWAA, Java, XML, HTML, XHTML, Servlet"/>
00010 <meta name="description" content="Java Web Application Architecture"/>
00011 <meta name="author" content="Brad Cox"/>
00012 <meta name="revisit-after" content="20 days"/>
00013 <meta http-equiv="Reply-to" content="bcox@virtualschool.edu" />
00014 <link href="/css/innerPage.css" rel="stylesheet" type="text/css" />
00015 <link href="/css/print.css" rel="stylesheet" type="text/css" media="print" />
00016 </head>
00017
00018 <body>
00019
00020 <div class="top">
00021 <a href="/"><img src="/pix/vs.jpg" alt="logo" height="53" width="420" /></a>
00022 </div>
00023
00024 <div class="navbar">
00025 $self.getNavigationBar()
00026 </div>
00027 #if ($self.page.title)
00028 <div class="title">
00029 <h1 align="center">$self.page.title</h1>
00030 </div>
00031 #end
00032 #end
00033
00034 #macro(footer)
00035 <br clear="all" />
00036 <div class="bottom">
00037 <hr/>
00038 <table width="100%">
00039 <tr>
00040 <td align="left">JWAA 2.0</td>
00041 <td align="center"><a href="/cox">© Copyright 2004 by Brad Cox</a></td>
00042 <td align="right">March 2004</td>
00043 </tr>
00044 <tr>
00045 <td align="center" colspan="3">
00046 Served by <a href="http://JohnCompanies.com">JohnCompanies.com</a>
00047 </td>
00048 </tr>
00049 </table>
00050 </div>
00051 </body>
00052 </html>
00053 #end
00054
00055 #macro(rewriteTickField $name $value $attributes)
00056 #if ($form.getValueList($name).contains($value))
00057 <input $attributes checked="checked" />
00058 #else
00059 <input $attributes />
00060 #end
00061 #end
00062
00063 #macro(rewriteSelectField $name $value $attributes)
00064 #if ($form.getValueList($name).contains($value))
00065 <option $attributes selected="selected">$value</option>
00066 #else
00067 <option $attributes>$value</option>
00068 #end
00069 #end
00070
00071 #macro(redFont $text)
00072 <font color="red">$text</font>
00073 #end
00074
00075 #macro(defaultLogic)
00076 $self.log(op)
00077 #if ($op)
00078 $self.submitPage()
00079 #if ($op eq "Home")
00080 $self.gotoPage($self.findPage("locker"))
00081 #elseif ($op eq "Next")
00082 $self.gotoPage($self.nextPage)
00083 #elseif ($op eq "Prev")
00084 $self.gotoPage($self.prevPage)
00085 #end
00086 #end
00087 #end
00088
00089 #macro(link $key)
00090 #set ($v = "")
00091 #set ($v = $dictionary.get($key))
00092 #if ($v ne "")
00093 <a href="$self.encodeURL($v)">$key</a>
00094 #else
00095 $logger.error("$key not found)
00096 <b>($key not found)</b>
00097 #end
00098 #end
00099