Ruby on Rails Portlet

    It has been an exciting week, with the prospect of integrating and running a Ruby on Rails application as a Portlet. As any Ruby fan would know, it is very easy to generate a web application on Rails with a few commands. So the next logical step was to see if we can somehow get a Portlet out of this web application. JRuby is a wonderfully powerful java implementation of Ruby and the Rails-integration project, which is a JRuby extras project helps in the integration of a Rails application with a Servlet container. 

    There is a plugin provided by the Rails integration project, which creates a war out of a Rails application. This war can be deployed on say Glassfish as a web application and can be used as any normal Java EE web application. For more details of how to do this, check out Ashish's blog entry

    So it appeared that there was an existing way to get a Java EE web application. So we used the Portal pack Netbeans plugin to create a Portlet application. We then made sure that the appropriate doXXXX() methods did a Request Dispatch to the rails application by providing the url of the controller and action needed to perform. For instance, using the famous Cookbook Ruby on Rails application, the doView() would be appropriately taking the user to the list of Recipes and so on. As of now this seems to work fine. This is still work in progress, but the presence of JRuby and Rails-integration projects has made the creation of a Portlet a lot easier. Right now this has been working on the Open Source Portlet Container on java.net.

    Next steps would be :

 

  1. Provide Portlet urls instead of direct rails urls so that every request appropriately goes through the Portlet Container.
  2. Check the statefulness, i.e., session management.
  3. Provide a flash demo of the entire process of converting a Ruby on Rails application into a Portlet application, and make it run on the Open Source Portlet Container.
Check this space for more on this, in the coming days.


 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

karthiksudarshan

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today