Restlet, a RESTful middleware for GWT, GAE and Android December 17, 2009
Posted by Jerome Louvel in Android, Ecosystem, GAE, Google, GWT, Microsoft, REST, Restlet, Restlet General.10 comments
The Web is taking multiple shapes with the Mobile Web, Cloud Computing and RIA being hot topics recently. If you follow this blog frequently, you are certainly aware that the Restlet Framework, the first RESTful web framework for Java developers, is available in five consistent editions since version 2.0 M4. Each edition targets a special development environment:
- Google Web Toolkit (GWT) for AJAX applications deployed in desktop browsers, without any plugin required
- Google App Engine (GAE/J) for deployment on Google’s cloud computing infrastructure
- Android for deployment on compatible smartphones
- Java SE for standalone deployments in regular Java Virtual Machines
- Java EE for deployment in Servlet engines
Each edition is offering the same Restlet Framework, with restrictions and adjustments based on the target environment. For example, the GWT edition only supports the client-side usage of Restlet, while the GAE edition only provides compatible extensions and ensures that we don’t break the security sandbox or use unsupported JRE classes.
As a result, you can easily develop a unified Restlet application with a server-side deployed in GAE, a client version available for Android smartphones and another available for desktop browsers with GWT, fully leveraging the most innovative technologies available from Google for Java developers.
You might wonder what exact value does Restlet brings in the middle of those technologies? The Restlet Framework is all about REST, supporting advanced HTTP features such as content negotiation, caching and conditional processing, allowing for the same URI-addressable resource to expose various representations. Each representation renders the same information in various languages or formats such as JSON, XML or anything else that makes sense for your clients such as binary pictures.
Supporting content negotiation allows your Restlet cloud server to expose the same resources to all its clients, including an Android smartphone client, a GWT desktop client, a Flex client, a programmatic Java SE robot or a basic HTML browser. One Java API and one unified code base gets you covered in all those scenarios, even if you need to serve static files: a Restlet Application truly merges the notion of Web Site, Web App and Web Service!
So, using Restlet as a cloud server gets you much further than a regular Servlet application. Usually, you would use GWT-RPC to communicate between your GWT client and your GAE back-end, and the low-level HTTP client provided by Android to communicate with your GAE custom Servlets. Obviously, the result wouldn’t be very RESTful as GWT-RPC is introducing some strong coupling. You could use the low-level HTTP client provided by GWT as well, but then you would loose the big benefit of using Java proxies in GWT, with transparent serialization of parameters and result object.
This is where the Restlet Framework comes to rescue! For GWT, we provide both a high-level HTTP client, removing the need to manually parse and format HTTP headers thanks to its Restlet API but also a proxy generation mechanism based on GWT deferred binding very similar to GWT-RPC but truly RESTful! Migration of existing GWT-RPC code is straightforward as we also support GWT-RPC AsyncCallback interface in addition to our equivalent Result interface. For our serialization format, we reused the one of GWT-RPC, a special JSON variant, therefore it is fully featured and as robust as GWT-RPC ! In your Restlet cloud server, you just need to add our server-side GWT extension to transparently support this serialization format, thanks to content negotiation.

If you are a Google fan, you should be happily developing with the recent GWT 2.0, Android 2.0 and GAE 1.3.0 releases and the RESTful solution described above should gives you a big smile and to get started, we have written a complete tutorial, with full source code, illustrating a unified Restlet application for GAE, GWT and Android.
But even in this scenario, you wouldn’t be restricted to Google technologies, you could chose to support alternative clients such as regular HTML browsers, Flex or Silverlight clients, or any other HTTP client. On the server-side, you could take the same Restlet application and deploy it locally, or on Amazon EC2 or Microsoft Azure, thanks to our Restlet editions for Java SE and Java EE which can be installed on those major cloud platforms!
In the end, the Restlet Framework offers you, for free, the first comprehensive RESTful middleware for Google technologies and beyond! As a last word, I would like to thank again my friend Didier Girard, for sharing his insights that led us to this post (and a lot of work!)
Towards RESTful Web Content Management December 10, 2009
Posted by Jerome Louvel in CMS, Ecosystem, REST, Restlet, Restlet General.add a comment
The Restlet community is so diverse that it is difficult to cover all related projects and products. Sometimes, it is easier to identify trends and connections. Like for most sectors of the software industry, the Web is exerting a lot of attraction on Content Management Systems (CMS), including Enterprise Content Management (ECM) and Document Management Systems (DMS).
As a result, those products typically offer a mechanism to programmatically interact with their CMS through the Web, by providing a Web Service API. Ideally, those APIs are designed RESTfully such as Nuxeo ECM which leveraged Restlet. This approach was explained in more depth in a CMSWire article covering Alfresco’s RESTful approach and mentioning Restlet has a good candidate for lighter and more RESTful Web frameworks.
Jalios JCMS, a commercial ECM product, also leverages Restlet for their RESTful OpenAPI. Another nice example of a REST API based on Restlet was recently provided by NeoDoc in their Calenco product, a CMS focusing on the collaborative edition of documents such as strategic business documents, technical documentation, user guides, quality manuals or security procedures.
While each of those REST APIs supports the special features of their related CMS, users might prefer for some scenarios to use a more generic REST API, not tightened to a particular vendor or project. This is the purpose of the Content Management Interoperability Services (CMIS) standardization effort. Version 1.0 is currently is final review stages, and seems to be gaining a lot of traction.
However, Roy T. Fielding expressed some critics on the initial draft in this blog post, pointing to its lack of RESTfulness and the fact that it was too focused on document management instead of content management as its name implies. It seems that the RESTfulness concerns were mostly addressed, but not the one of the scope of the specification . Note that Nuxeo already supports CMIS and that Jalios has planned its support as well.
Finally, there is a new trend in CMS called Web Content Management (WCM), focusing on the online edition of Web documents and Web sites in general. This family includes Wiki software like the powerful and open source XWiki which also leverages Restlet for their REST API.
Another illustration of this trend leading to more and more convergence of CMS towards the Web are major online services like Google Docs and Microsoft OfficeLive, enabling the collaborative edition of enterprise content, progressively blurring the line with regular Web content. As a final illustration of how Restlet can successfully support the development of WCM systems, I recommend you to have a look at GoGoEgo, a very promising open source RESTful WCM recently launched by Solertium.
Their solution not only provides a REST API, but is fully designed as a RESTful Web application, with an administrative front-end based on GWT and the ability to be hosted on the cloud with Google AppEngine. Solertium is also a strong supporter and contributor to the Restlet project, as illustrated in this passionate post from their CTO about friendly frameworks!
Update : Mentionned CMIS implementors. Adjusted wording regarding Roy & CMIS based on feed-back from Benoît Dissert of Jalios







