1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
5 <meta name="author" content="Guido Laures">
6 <link href="cewolf.css" rel="stylesheet" type="text/css">
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>
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>
39 <h2>3. Install the Cewolf Servlet in your Web App</h2>
41 <h2>4. Define the chart in your JSP</h2>
42 <pre><%@page contentType="text/html"%><br><%@taglib uri='/WEB-INF/cewolf.tld' prefix='cewolf' %><br><jsp:useBean id="pageViews" class="de.laures.cewolf.example.PageViewCountData"/><br><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"><br> <cewolf:data producer="pageViews" /><br></cewolf:chart><br></pre>
43 <p> <a href="http://sourceforge.net" target="new" height="30"><img
44 src="http://sourceforge.net/sflogo.php?group_id=57282&type=5"
45 height="30" border="0" alt="SourceForge Logo"></a> </p>