java/cewolf-1.0/src/site/devguide.html
author František Kučera <franta-hg@frantovo.cz>
Sat, 28 Feb 2009 21:36:28 +0100
changeset 2 68cc9b54a153
parent 1 639991d0808a
permissions -rw-r--r--
Mavení problémy
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     2 <html>
     3 <head>
     4   <title></title>
     5   <meta name="author" content="Guido Laures">
     6   <link href="cewolf.css" rel="stylesheet" type="text/css">
     7 </head>
     8 <body>
     9 <h1><a name="Developer Guido">Developer Guide</a></h1>
    10 <p> Let us assume the following (standard) scenario in which Cewolf
    11 might be a solution.<br>
    12 You have a running web application and you want to know which pages are
    13 most visited by your users. You want to have a vertical bar chart which
    14 looks like the one below </p>
    15 <p> <img src="img/guidevbarchart.gif" alt="verticalbar"> </p>
    16 <p> </p>
    17 <h2>1. Prepare Your Application</h2>
    18 <p> If you have not yet downloaded the Cewolf distribution, this is the
    19 point when you should do it (look at <a
    20  href="http://sourceforge.net/project/showfiles.php?group_id=57282"
    21  target="new">Download</a>). Put the <tt>cewolf.jar</tt> file into your
    22 web application's <tt>/WEB-INF/lib</tt> directory.<br>
    23 That should be all you have to do to prepare your application for
    24 Cewolf usage. If you encounter any problems in using the Cewolf tags
    25 (e.g. "No Tags" is displayed in your containers console) you can
    26 additionally put the <tt>cewolf.tld</tt> file from the distribution's <tt>etc</tt>
    27 directory into a directory of your choice under your web application's
    28 root and reference this file as the cewolf tag library from your JSPs. </p>
    29 <h2>2. Provide a DatasetProducer</h2>
    30 <p> As Cewolf uses a MVC (Model-View-Control) approach the data which
    31 are shown in your chart are separated from the view defined in the JSP
    32 page. So you can change them separately. To provide the chart with the
    33 correct data you must provide an object which implements the interface<tt>de.laures.cewolf.DatasetProducer</tt>.
    34 This object is asked to produce data every time a chart is rendered.
    35 Below you see an implementation of a DatasetProducer which could be used
    36 to provide data needed for our example scenario. </p>
    37 <p> </p>
    38 to be continued ...
    39 <h2>3. Install the Cewolf Servlet in your Web App</h2>
    40 tbd.
    41 <h2>4. Define the chart in your JSP</h2>
    42 <pre>&lt;%@page contentType="text/html"%&gt;<br>&lt;%@taglib uri='/WEB-INF/cewolf.tld' prefix='cewolf' %&gt;<br>&lt;jsp:useBean id="pageViews" class="de.laures.cewolf.example.PageViewCountData"/&gt;<br>&lt;cewolf:chart <br>    id="horizontalBarChart" <br>    title="HorizontalBarChart" <br>    renderer="servlet/chart" <br>    width="300" height="300" <br>    type="horizontalBar" <br>    xAxisLabel="Page" <br>    yAxisLabel="Views"&gt;<br>    &lt;cewolf:data producer="pageViews" /&gt;<br>&lt;/cewolf:chart&gt;<br></pre>
    43 <p> <a href="http://sourceforge.net" target="new" height="30"><img
    44  src="http://sourceforge.net/sflogo.php?group_id=57282&amp;type=5"
    45  height="30" border="0" alt="SourceForge Logo"></a> </p>
    46 </body>
    47 </html>