<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Spikes Of Nothingness - web2.0 tag</title>
  <link>http://weblog.flop.ca/tags/web2.0/</link>
  <description>Florin T.PATRASCU&#039;s blog</description>
  <language>en</language>
  <copyright>Florin T.PATRASCU</copyright>
  <lastBuildDate>Sat, 12 May 2012 02:12:08 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>JPublish-RESTLET integration; a very first step.</title>
    <link>http://weblog.flop.ca/2009/03/18/1237421760000.html</link>
    
      
        <description>
          &lt;p&gt;  &lt;/p&gt;
Hi,&lt;br /&gt;
&lt;br /&gt;
I am pleased to let you know about the availability of a very simple yet flexible integration between JPublish and the &lt;strong&gt;RESTLET&lt;/strong&gt; framework:&amp;nbsp; http://www.restlet.org&lt;br /&gt;
&lt;br /&gt;
The svn Rev230, contains a JPublish module that is able to transform REST requests, such as...&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&lt;strong&gt;/hello/{name}&lt;br /&gt;
/user/{name}/{id}&lt;br /&gt;
/user/{name}/order/{id}&lt;br /&gt;
/search/{keyword}&lt;br /&gt;
/info/{id}&lt;br /&gt;
...&lt;br /&gt;
&lt;/strong&gt;&lt;/blockquote&gt;&lt;br /&gt;
... into JPublish action calls and page rendering.&lt;br /&gt;
&lt;br /&gt;
For your convenience, a simple demo is provided, available here:&lt;br /&gt;
http://jpublish.googlecode.com/files/jprestlet.war.zip&lt;br /&gt;
&lt;br /&gt;
To start, build from svn or download the demo above. If you check your jpublish.xml file, you will notice the new module, JPRestlet.&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;&amp;lt;module classname=&amp;quot;org.jpublish.module.restlet.JPRestletModule&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;url&amp;gt;/rest/*&amp;lt;/url&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;restlet-config&amp;gt;/WEB-INF/jprestlet-config.xml&amp;lt;/restlet-config&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;profilling&amp;gt;true&amp;lt;/profilling&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;verbose&amp;gt;on&amp;lt;/verbose&amp;gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;debug&amp;gt;true&amp;lt;/debug&amp;gt;&lt;br /&gt;
&amp;lt;/module&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
The configuration above will initialize the &lt;strong&gt;RESTLET&lt;/strong&gt; support for all the requests on the path described by the &amp;lt;url/&amp;gt; tag: &amp;quot;&lt;strong&gt;rest/&lt;/strong&gt;*&amp;quot; in this case.&lt;br /&gt;
&lt;br /&gt;
The RESTLET convertor will be initialized from the &lt;strong&gt;/WEB-INF/jprestlet-config.xml&lt;/strong&gt; file. In the jprestlet-config.xml, you can define your resource mappings and a dedicated JPublish content repository: &amp;quot;extended&amp;quot;, in this example. The JPublish repositories are defined in the jpublish.xml, but you should already know that.&lt;br /&gt;
&lt;br /&gt;
In our example, we are supporting the following routes:&lt;br /&gt;
&lt;blockquote&gt;&amp;lt;jprestlet&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;repository name=&amp;quot;extended&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;routes&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;route map=&amp;quot;/hello/{name}&amp;quot; action=&amp;quot;rest/Hello.bsh&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;route map=&amp;quot;/user/{name}/{id}&amp;quot; page=&amp;quot;user.html&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;route map=&amp;quot;/action/info/{id}&amp;quot; action=&amp;quot;rest/Info.bsh&amp;quot; page=&amp;quot;info.html&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;route map=&amp;quot;/info/{id}&amp;quot; page=&amp;quot;info.html&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/routes&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;debug&amp;gt;true&amp;lt;/debug&amp;gt;&lt;br /&gt;
&amp;lt;/jprestlet&amp;gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
With the mappings declared above, a call like:&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;http://localhost:8080/jprestlet/rest/hello/JPublish&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
will echo back to you the text: &lt;strong&gt;Hello JPublish!&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
This is enough to get you started if you are interested in learning more about RESTful services. Also, if you don&#039;t want to use JPublish but are a Java developer that wants to develop RESTful services, please visit the RESTLET framework site. It&#039;s an amazing framework.&lt;br /&gt;
&lt;br /&gt;
If you like the RESTful world, then please stay tuned. There is more to come.&lt;br /&gt;
&lt;br /&gt;
Thank you for using JPublish,&lt;br /&gt;
-florin
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://weblog.flop.ca/2009/03/18/1237421760000.html#comments</comments>
    <guid isPermaLink="true">http://weblog.flop.ca/2009/03/18/1237421760000.html</guid>
    <pubDate>Thu, 19 Mar 2009 00:16:00 GMT</pubDate>
  </item>
  
  </channel>
</rss>

