java/cewolf-1.0/src/site/devguide.html
changeset 1 639991d0808a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/java/cewolf-1.0/src/site/devguide.html	Sat Feb 28 21:31:02 2009 +0100
     1.3 @@ -0,0 +1,47 @@
     1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
     1.5 +<html>
     1.6 +<head>
     1.7 +  <title></title>
     1.8 +  <meta name="author" content="Guido Laures">
     1.9 +  <link href="cewolf.css" rel="stylesheet" type="text/css">
    1.10 +</head>
    1.11 +<body>
    1.12 +<h1><a name="Developer Guido">Developer Guide</a></h1>
    1.13 +<p> Let us assume the following (standard) scenario in which Cewolf
    1.14 +might be a solution.<br>
    1.15 +You have a running web application and you want to know which pages are
    1.16 +most visited by your users. You want to have a vertical bar chart which
    1.17 +looks like the one below </p>
    1.18 +<p> <img src="img/guidevbarchart.gif" alt="verticalbar"> </p>
    1.19 +<p> </p>
    1.20 +<h2>1. Prepare Your Application</h2>
    1.21 +<p> If you have not yet downloaded the Cewolf distribution, this is the
    1.22 +point when you should do it (look at <a
    1.23 + href="http://sourceforge.net/project/showfiles.php?group_id=57282"
    1.24 + target="new">Download</a>). Put the <tt>cewolf.jar</tt> file into your
    1.25 +web application's <tt>/WEB-INF/lib</tt> directory.<br>
    1.26 +That should be all you have to do to prepare your application for
    1.27 +Cewolf usage. If you encounter any problems in using the Cewolf tags
    1.28 +(e.g. "No Tags" is displayed in your containers console) you can
    1.29 +additionally put the <tt>cewolf.tld</tt> file from the distribution's <tt>etc</tt>
    1.30 +directory into a directory of your choice under your web application's
    1.31 +root and reference this file as the cewolf tag library from your JSPs. </p>
    1.32 +<h2>2. Provide a DatasetProducer</h2>
    1.33 +<p> As Cewolf uses a MVC (Model-View-Control) approach the data which
    1.34 +are shown in your chart are separated from the view defined in the JSP
    1.35 +page. So you can change them separately. To provide the chart with the
    1.36 +correct data you must provide an object which implements the interface<tt>de.laures.cewolf.DatasetProducer</tt>.
    1.37 +This object is asked to produce data every time a chart is rendered.
    1.38 +Below you see an implementation of a DatasetProducer which could be used
    1.39 +to provide data needed for our example scenario. </p>
    1.40 +<p> </p>
    1.41 +to be continued ...
    1.42 +<h2>3. Install the Cewolf Servlet in your Web App</h2>
    1.43 +tbd.
    1.44 +<h2>4. Define the chart in your JSP</h2>
    1.45 +<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>
    1.46 +<p> <a href="http://sourceforge.net" target="new" height="30"><img
    1.47 + src="http://sourceforge.net/sflogo.php?group_id=57282&amp;type=5"
    1.48 + height="30" border="0" alt="SourceForge Logo"></a> </p>
    1.49 +</body>
    1.50 +</html>