Title: [waffle-scm] [587] trunk/waffle-distribution/src/site/content/ruby-controllers.html: words and style
Revision
587
Author
paul
Date
2008-02-07 00:21:40 -0600 (Thu, 07 Feb 2008)

Log Message

words and style

Modified Paths


Diff

Modified: trunk/waffle-distribution/src/site/content/ruby-controllers.html (586 => 587)

--- trunk/waffle-distribution/src/site/content/ruby-controllers.html	2008-02-07 06:06:52 UTC (rev 586)
+++ trunk/waffle-distribution/src/site/content/ruby-controllers.html	2008-02-07 06:21:40 UTC (rev 587)
@@ -1,36 +1,77 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html><head>
 <title>Ruby Controllers</title></head>
-<body>Ever wish you could utilize Ruby from your Java based web applications?<br /><br />Waffle,
-a Java based Web Framework, now provides built in support for JRuby.
+<body>
+	<h2>Utilizing Ruby in a Waffle web application</h2>
+Waffle now provides built in support for JRuby.
 This will allow you to easily write your Controllers in Ruby. The
 integration is simple and straightforward, taking advantage of
-functionality Waffle provides (without being a Rails clone). <br /><br />A
-key feature of Waffle has always been its pluggable architecture. From
+functionality Waffle provides (without being a Rails clone). 
+<br /><br />
+A key feature of Waffle has always been its pluggable architecture. From
 the beginning we believed that the default behavior defined by the
 Waffle team might not be suitable for every situation. Therefor Waffle
 was built following an Interface driven approach. Practically all of
 Waffle's built-in functionality can easily be extended or replaced.
 This design made integrating JRuby support quite easy. The next 3 steps
 give a brief overview of how to integrate JRuby support into your
-Waffle based applications.<br /><br />Step 1 - configure Waffle to be "Ruby Aware"<br /><br />Waffle
-avoids XML like the plague but we still need to have a web.xml for our
+Waffle based applications.
+<br /><br />
+<span style="font-weight: bold;">Step 1</span> - configure Waffle to be "Ruby Aware"
+<br /><br />
+Waffle avoids XML like the plague but we still need to have a web.xml for our
 applications. This web.xml is where we can take advantage of Waffle's
 pluggability. The following three context-param nodes need to be added
 to your applications web.xml. This alerts Waffle that a few of its
 foundational components should be replaced with alternate
-implementations.<br /><pre>&lt;context-param&gt;<br />&nbsp; &lt;param-name&gt;org.codehaus.waffle.context.ContextContainerFactory&lt;/param-name&gt;<br />&nbsp; &lt;param-value&gt;org.codehaus.waffle.context.pico.RubyAwarePicoContextContainerFactory&lt;/param-value&gt;<br />&lt;/context-param&gt;</pre><pre>&lt;context-param&gt;<br />&nbsp; &lt;param-name&gt;org.codehaus.waffle.bind.DataBinder&lt;/param-name&gt;<br />&nbsp; &lt;param-value&gt;org.codehaus.waffle.bind.RubyDataBinder&lt;/param-value&gt;<br />&lt;/context-param&gt;</pre><pre>&lt;context-param&gt;<br />&nbsp; &lt;param-name&gt;org.codehaus.waffle.controller.ControllerDefinitionFactory&lt;/param-name&gt;<br />&nbsp; &lt;param-value&gt;org.codehaus.waffle.co
 ntroller.RubyControllerDefinitionFactory&lt;/param-value&gt;<br />&lt;/context-param&gt;</pre>Step
-2 - Your application's Registrar should extended
-AbstractRubyAwareRegistrar. This exposes a new registration method to
+implementations.
+
+<textarea class="java:nogutter:nocontrols" name="code">&lt;context-param&gt;
+&nbsp; &lt;param-name&gt;org.codehaus.waffle.context.ContextContainerFactory&lt;/param-name&gt;
+&nbsp; &lt;param-value&gt;org.codehaus.waffle.context.pico.RubyAwarePicoContextContainerFactory&lt;/param-value&gt;
+&lt;/context-param&gt;
+&lt;context-param&gt;
+&nbsp; &lt;param-name&gt;org.codehaus.waffle.bind.DataBinder&lt;/param-name&gt;
+&nbsp; &lt;param-value&gt;org.codehaus.waffle.bind.RubyDataBinder&lt;/param-value&gt;
+&lt;/context-param&gt;
+&lt;context-param&gt;
+&nbsp; &lt;param-name&gt;org.codehaus.waffle.controller.ControllerDefinitionFactory&lt;/param-name&gt;
+&nbsp; &lt;param-value&gt;org.codehaus.waffle.controller.RubyControllerDefinitionFactory&lt;/param-value&gt;
+&lt;/context-param&gt;</textarea>
+<span style="font-weight: bold;">Step
+2</span> - Your application's Registrar should extended
+AbstractRubyAwareRegistrar. <br /><br />
+This exposes a new registration method to
 use within your Registrar ... registerRubyScript(String key, String
-className). See the example below: <br /><pre>public class MyRegistrar extends AbstractRubyAwareRegistrar {<br />&nbsp; public MyRegistrar(Registrar delegate) {<br />&nbsp;&nbsp;&nbsp; super(delegate);<br />&nbsp; }&nbsp;&nbsp; &nbsp;</pre><pre>&nbsp; @Override<br />&nbsp; public void application() {<br />&nbsp;&nbsp;&nbsp; registerRubyScript("foobar", "FooBar");<br />&nbsp; }<br />&nbsp; ...<br />}</pre>In
+className). See the example below: 
+
+<textarea class="java:nogutter:nocontrols" name="code">public class MyRegistrar extends AbstractRubyAwareRegistrar {
+&nbsp; public MyRegistrar(Registrar delegate) {
+&nbsp;&nbsp;&nbsp; super(delegate);
+&nbsp; }&nbsp;&nbsp; &nbsp;
+	&nbsp; @Override
+&nbsp; public void application() {
+&nbsp;&nbsp;&nbsp; registerRubyScript("foobar", "FooBar");
+&nbsp; }
+&nbsp; ...
+}</textarea>In
 this example the Ruby class named 'FooBar' will be exposed as a
 Controller under the name 'foobar' (e.g.
-http://localhost:8080/jruby/foobar.waffle).<br /><br />Step 3 - Write
+http://localhost:8080/jruby/foobar.waffle).
+<br /><br />
+<span style="font-weight: bold;">Step 3</span> - Write
 your Ruby Controller class. Notice in the following example that your
-class does not need to extend or include anything.<br /><pre>class FooBar<br />&nbsp; def index # This is the default action<br />&nbsp;&nbsp;&nbsp; "&lt;h1&gt;Hello World&lt;/h1&gt;"<br />&nbsp; end&nbsp; <br />end</pre>And
+class does not need to extend or include anything.
+
+<textarea class="java:nogutter:nocontrols" name="code">class FooBar
+&nbsp; def index # This is the default action
+&nbsp;&nbsp;&nbsp; "&lt;h1&gt;Hello World&lt;/h1&gt;"
+&nbsp; end&nbsp; 
+end</textarea>And
 that is all the steps required to integrate JRuby within your Waffle
-Applications. In my next post I will uncover details on how to access
-registered components from your Ruby based controllers as well as
-explain the built in conventions that make writing Ruby controllers so
-easy.</body></html>
\ No newline at end of file
+Applications. 
+
+<h3>Why are Ruby controllers desirable?</h3>
+TODO
+</body>
+</html>
\ No newline at end of file


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to