leosimons    2002/10/27 13:42:22

  Modified:    docs/excalibur/tweety avalon-for-beginners.html
  Log:
  updating beginner guide to be of at least some use until it is properly 
finished.
  
  Revision  Changes    Path
  1.9       +91 -34    
jakarta-avalon-site/docs/excalibur/tweety/avalon-for-beginners.html
  
  Index: avalon-for-beginners.html
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-site/docs/excalibur/tweety/avalon-for-beginners.html,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- avalon-for-beginners.html 10 Aug 2002 22:05:29 -0000      1.8
  +++ avalon-for-beginners.html 27 Oct 2002 21:42:22 -0000      1.9
  @@ -1,14 +1,71 @@
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
   <html><head><META http-equiv="Content-Type" content="text/html; 
charset=ISO-8859-1"><link rel="stylesheet" href="skin/tigris.css" 
type="text/css"><link rel="stylesheet" href="skin/site.css" 
type="text/css"><link media="print" rel="stylesheet" href="skin/print.css" 
type="text/css"><meta value="Avalon Documentation Team" name="author"><meta 
value="[email protected]" name="email"><title>Avalon for Beginners 
- Overview</title></head><body bgcolor="white" class="composite" 
marginheight="0" marginwidth="0"><div id="banner"><table width="100%" 
cellpadding="8" cellspacing="0" border="0"><tbody><tr><td align="left"><a 
href="http://jakarta.apache.org/";><img border="0" 
src="images/jakarta-logo.gif"></a></td><td align="right"><a 
href="http://jakarta.apache.org/avalon/";><img border="0" 
src="images/header.gif"></a></td></tr></tbody></table></div><table width="100%" 
cellpadding="0" cellspacing="0" border="0" id="breadcrumbs"><td><a 
href="http://jakarta.apache.org/";>Jakarta Main</a> |
               <a href="http://jakarta.apache.org/avalon";>Avalon Main</a> |
  -            <a href="../">Up</a></td><td style="text-align: right" 
align="right"><a 
href="http://jakarta.apache.org/avalon/framework/";>Framework</a> |
  +            <a href="../index.html">Up</a></td><td style="text-align: right" 
align="right"><a 
href="http://jakarta.apache.org/avalon/framework/";>Framework</a> |
               <a 
href="http://jakarta.apache.org/avalon/excalibur/";>Excalibur</a> |
               <a 
href="http://jakarta.apache.org/avalon/cornerstone/";>Cornerstone</a> |
               <a href="http://jakarta.apache.org/avalon/phoenix/";>Phoenix</a> |
               <a href="http://jakarta.apache.org/avalon/apps/";>Apps</a> |
  -            <a 
href="http://jakarta.apache.org/avalon/logkit/";>Logkit</a></td></table><table 
id="main" width="100%" cellpadding="8" cellspacing="0" border="0"><tbody><tr 
valign="top"><td id="leftcol"><div 
id="navcolumn"><div><strong>Essentials</strong><div><a 
href="index.html">Overview</a></div><div><a 
href="features.html">Features</a></div><div><a 
href="getting-started.html">Getting Started</a></div><div><a 
href="http://jakarta.apache.org/builds/jakarta-avalon-excalibur/release";>Download</a></div><div><a
 href="install.html">Install</a></div><div><a 
href="faq.html">FAQ</a></div></div><div><strong>Related</strong><div><a 
href="http://jakarta.apache.org/avalon/";>Avalon Home</a></div><div><a 
href="http://jakarta.apache.org/avalon/excalibur/";>Excalibur 
Home</a></div><div><a href="http://jakarta.apache.org/avalon/phoenix";>Avalon 
Phoenix</a></div><div><a 
href="http://jakarta.apache.org/avalon/excalibur/component";>ECM</a></div><div><a
 
href="http://jakarta.apache.org/avalon/excalibur/fortress";>Fortress</a></div></div><div><strong>Avalon
 for Beginners</strong><div><a 
href="avalon-for-beginners.html">Introduction</a></div></div><div><strong>Container
 HOWTO</strong><div><a 
href="avalon-container-howto.html">Introduction</a></div></div><div><strong>Reference</strong><div><a
 href="api/">API Docs</a></div></div></div></td><td><div id="bodycol"><div 
class="app"><div align="center"><h1>Avalon for Beginners - 
Overview</h1><h2></h2></div><div class="h3">
  +            <a 
href="http://jakarta.apache.org/avalon/logkit/";>Logkit</a></td></table><table 
id="main" width="100%" cellpadding="8" cellspacing="0" border="0"><tbody><tr 
valign="top"><td id="leftcol"><div 
id="navcolumn"><div><strong>Essentials</strong><div><a 
href="index.html">Overview</a></div><div><a 
href="features.html">Features</a></div><div><a 
href="getting-started.html">Getting Started</a></div><div><a 
href="http://jakarta.apache.org/builds/jakarta-avalon-excalibur/release";>Download</a></div><div><a
 href="install.html">Install</a></div><div><a 
href="faq.html">FAQ</a></div></div><div><strong>Related</strong><div><a 
href="http://jakarta.apache.org/avalon/";>Avalon Home</a></div><div><a 
href="http://jakarta.apache.org/avalon/excalibur/";>Excalibur 
Home</a></div><div><a href="http://jakarta.apache.org/avalon/phoenix";>Avalon 
Phoenix</a></div><div><a 
href="http://jakarta.apache.org/avalon/excalibur/component";>ECM</a></div><div><a
 
href="http://jakarta.apache.org/avalon/excalibur/fortress";>Fortress</a></div></div><div><strong>Avalon
 for Beginners</strong><div><a 
href="avalon-for-beginners.html">Introduction</a></div></div><div><strong>Container
 HOWTO</strong><div><a 
href="avalon-container-howto.html">Introduction</a></div></div><div><strong>Reference</strong><div><a
 href="api/index.html">API Docs</a></div></div></div></td><td><div 
id="bodycol"><div class="app"><div align="center"><h1>Avalon for Beginners - 
Overview</h1><h2></h2></div><div class="h3">
     
     
  +     <div class="h3"><h3>Until these docs form...</h3></div>
  +             <p>This manual is not finished yet. In the meantime, a few 
steps to get you started
  +             quickly follow below.</p>
  +
  +             <div class="h4"><h4>Introducing: phoenix</h4></div>
  +
  +             <p>Phoenix is what is called a container. It allows you to 
build any kind of server application
  +             following avalon patterns and concepts.</p>
  +
  +             <blockquote><ol>
  +                     <li>Download <a 
href="http://jakarta.apache.org/builds/jakarta-avalon-phoenix/release/latest/";>Phoenix</a>
 (the binary version)</li>
  +                     <li>Extract the archive. I'll assume you extracted into 
a directory named $PHOENIX.</li>
  +                     <li>Download <a 
href="http://jakarta.apache.org/builds/jakarta-avalon-apps/nightly/2002-10-27/";>The
 Demo applications</a> (demo-x.x-bin.extension)</li>
  +                     <li>Extract the archive. I'll assume you extracted into 
a directory named $DEMOS.</li>
  +                     <li>copy the files with an extension of .sar from 
$DEMOS to $PHOENIX/apps.</li>
  +                     <li>change to the $PHOENIX/bin directory.</li>
  +                     <li>Run the startup script (run.bat or run.sh depending 
on your platform)</li>
  +                     <li>Hit CTRL+C to shut down phoenix again</li>
  +                     <li>Download <a 
href="http://jakarta.apache.org/builds/jakarta-avalon-apps/nightly/2002-10-27/";>The
 Demo application sources</a> (demo-x.x-src.extension)</li>
  +                     <li>Extract the archive. Take a look at the sources for 
the demo apps and play with them a bit.</li>
  +                     <li>Take a look at the build.xml file from the demo 
application sources. Don't worry if you don't understand.</li>
  +             </ol></blockquote>
  +
  +             
  +
  +             <div class="h4"><h4>Introducing: tweety</h4></div>
  +
  +             <p>If you figured out what happens in the process outlined 
above and you managed to modify and
  +             recompile the demo applications and get them running, you might 
not need to look at this. If you
  +                found it all rather complex, this is for you :)</p>
  +
  +             <p>Tweety is a very simple toy for playing around with avalon 
concepts.</p>
  +
  +             <blockquote><ol>
  +                     <li>Download <a 
href="http://cvs.apache.org/~leosimons/excalibur/tweety/";>Tweety</a> (the 
beta)</li>
  +                     <li>Extract the archive. I'll assume you extracted into 
a directory named $TWEETY.</li>
  +                     <li>read <a 
href="http://jakarta.apache.org/avalon/excalibur/tweety/getting-started.html";>The
 Tweety getting started docs</a></li>
  +                     <li>Take a look at the 
<code>$TWEETY/src/java/org/apache/avalon/excalibur/tweety/demos/ChirpWorld.java</code>
 file.</li>
  +                     <li>Change some stuff, then recompile (tip: you need to 
have the <code>$TWEETY/avalon-framework.jar</code> on your classpath)</li>
  +                     <li>Create a directory $TWEETY/classes</li>
  +                     <li>Put the recompiled sources into that directory</li>
  +                     <li>Run tweety again</li>
  +             </ol></blockquote>
  +
  +             
  +
  +             <div class="h4"><h4>The documentation</h4></div>
  +                     <p>Now is the time for you to delve a little deeper. 
Browse the avalon website.
  +                     There's loads of stuff here :)</p>
  +             
  +
  +             <div class="h4"><h4>Getting more help</h4></div>
  +                     <p>We've got a mailing list dedicated to avalon users. 
Read
  +                     <a 
href="http://jakarta.apache.org/site/mail.html";>This</a> for info
  +                     on how to subscribe.</p>
  +             
  +     
        <div class="h3"><h3>Work in Progress!</h3></div>
                <p>This manual is quite far from finished. While you are free 
to read it, I recommend
                you don't.</p>
  @@ -72,14 +129,14 @@
        private String m_chilpMessage;
        private String m_chilpSeparator;
   
  -     public void BirdSong1( int numberOfChilps, chilpMessage, chilpSeparator 
)
  +     public BirdSong1( int numberOfChilps, String chilpMessage, String 
chilpSeparator )
        {
                m_numberOfChilps = numberOfChilps;
                m_chilpMessage = chilpMessage;
                m_chilpSeparator = chilpSeparator;
        }
   
  -     public sing()
  +     public void sing()
        {
                for( int i = 0; i != m_numberOfChilps; i++ )
                {
  @@ -90,12 +147,12 @@
                }
        }
   
  -     public static void main(String args[])
  +     public static void main( String args[] )
        {
                BirdSong1 birdSong = new BirdSong1( new Integer( args[0] 
).intValue(),
                                args[1], args[2] );
   
  -             BirdSong.sing();
  +             birdSong.sing();
        }
   }
                </pre>
  @@ -125,10 +182,11 @@
   
   import org.apache.avalon.framework.parameters.Parameterizable;
   import org.apache.avalon.framework.parameters.Parameters;
  +import org.apache.avalon.framework.parameters.ParameterException;
   import org.apache.avalon.framework.activity.Startable;
   import org.apache.avalon.framework.logger.LogEnabled;
   
  -public interface BirdSong extends Parameterizable, Startable, LogEnabled;
  +public interface BirdSong extends Parameterizable, Startable, LogEnabled
   {
        public static final String PARAM_NUMBER_OF_CHILPS = "numberOfChilps";
        public static final String PARAM_CHILP_MESSAGE = "chilpMessage";
  @@ -136,15 +194,14 @@
   
        /**
        * Provide us with the parameters it needs to work. Required are:
  -     * &gt;ul&lt;
  -     * &gt;li&lt;numberOfChilps&gt;/li&lt;
  -     * &gt;li&lt;chilpMessage&gt;/li&lt;
  -     * &gt;li&lt;chilpSeparator&gt;/li&lt;
  -     * &gt;/ul&lt;
  -     * &gt;/pre&lt;
  +     * <blockquote><ul>
  +     * <li>numberOfChilps</li>
  +     * <li>chilpMessage</li>
  +     * <li>chilpSeparator</li>
  +     * </ul></blockquote>
        *
        */
  -     public void parameterize( Parameters parameters );
  +     void parameterize( Parameters parameters ) throws ParameterException;
   }
                </pre>
                
  @@ -155,12 +212,12 @@
   
   import org.apache.avalon.framework.parameters.Parameters;
   import org.apache.avalon.framework.parameters.ParameterException;
  -import org.apache.avalon.logger.AbstractLoggable;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   
   import avalon.tutorial.BirdSong;
   import avalon.tutorial.BirdSongRunner;
   
  -public class BirdSongImpl extends AbstractLoggable implements BirdSong
  +public class BirdSongImpl extends AbstractLogEnabled implements BirdSong
   {
        private int m_numberOfChilps;
        private String m_chilpMessage;
  @@ -168,8 +225,7 @@
   
        private Thread m_runnerThread;
   
  -
  -     public void BirdSongImpl()
  +     public BirdSongImpl()
        {
        }
   
  @@ -177,15 +233,15 @@
        {
                getLogger().debug( "got parameters" );
   
  -             m_numberOfChilps = m_parameters.getParameterAsInteger( 
PARAM_NUMBER_OF_CHILPS );
  -             m_chilpMessage = m_parameters.getParameter( PARAM_CHILP_MESSAGE 
);
  -             m_chilpSeparator = m_parameters.getParameter( 
PARAM_CHILP_SEPARATOR );
  +             m_numberOfChilps = parameters.getParameterAsInteger( 
PARAM_NUMBER_OF_CHILPS );
  +             m_chilpMessage = parameters.getParameter( PARAM_CHILP_MESSAGE );
  +             m_chilpSeparator = parameters.getParameter( 
PARAM_CHILP_SEPARATOR );
        }
        public void start()
        {
                getLogger().debug( "starting" );
   
  -             Runnable runnable = new BirdSongImplRunner( this );
  +             Runnable runnable = new BirdSongRunner( this );
   
                m_runnerThread = new Thread( runnable );
                m_runnerThread.setDaemon( true );
  @@ -198,15 +254,15 @@
                m_runnerThread.notify();
        }
   
  -     int getNumberOfChilps()
  +     public int getNumberOfChilps()
        {
                return m_numberOfChilps;
        }
  -     String getChilpMessage()
  +     public String getChilpMessage()
        {
                return m_chilpMessage;
        }
  -     String getChilpSeperator()
  +     public String getChilpSeperator()
        {
                return m_chilpSeparator;
        }
  @@ -214,7 +270,7 @@
                </pre>
                
   
  -             <div class="h5"><h5></h5></div>
  +             <div class="h5"><h5>BirdSongRunner.java</h5></div>
                <pre>
   package avalon.tutorial;
   
  @@ -224,21 +280,21 @@
   {
        BirdSongImpl m_bs;
   
  -     public void BirdSongRunner( BirdSongImpl bs )
  +     public BirdSongRunner( BirdSongImpl bs )
        {
                m_bs = bs;
        }
   
        public void run()
        {
  -             int max = bs.getNumberOfChilps();
  -             String msg = bs.getChilpMessage();
  -             String separator = bs.getSeparator();
  +             int max = m_bs.getNumberOfChilps();
  +             String msg = m_bs.getChilpMessage();
  +             String seperator = m_bs.getChilpSeperator();
   
                for( int i = 0; i != max; i++ )
                {
                        if( i != 0 &amp;&amp; i != (max-1) )
  -                             System.out.print( separator );
  +                             System.out.print( seperator );
   
                        System.out.print(msg );
                }
  @@ -276,9 +332,10 @@
                        <p>Based on the name of the container (a vital piece in 
all avalon software)
                        we'll be using (it's called "Tweety"), the idea to do 
something with cartoons
                        immediately sprang to mind. At first we thought it'd be 
cool to have a
  -                     CartoonDistributionService or something cool and 
serverside (which is where
  -                     avalon is probably used most), we're going to keep it 
even more simple and
  -                     do a commandline input-output thing.</p>
  +                     CartoonDistributionService or something more complex 
and serverside (which is where
  +                     avalon is probably used most), but we're going to keep 
it even more simple and
  +                     do a commandline input-output thing. If you want more 
complex examples,
  +                     avalon's got plenty :)</p>
   
                        <p>Our application will be configurable with a 
<b>bird</b>, a
                        <b>cat</b>, and a <b>cage</b>. In addition to these, 
we're
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to