Atom Publishing Plugin

Introduction #

The Goal of this Web Plugin is to expose a subset of Liferay Portal's services using AtomPub to allow for the creation of read-write mashups. These mashups can read data from the portal and also interact with it by creating or modifying existing content.

Blogs and the Web Content have been integrated within the AtomPub web plugin, but every entity that has been built with Liferay Service Builder can be easily integrated as well. This web allows an AtomPub client (which may be part of a Mashup) to list blog entries or web content, create new blogs/web content and update or remove existing blogs/web content.

The “AtomPub web plugin” provides the following URL which can be used to browse the available workspaces and collections. It is also possible to use a regular browser, such as Firefox, to read the list of blog entries. For example given the following blog entries created through Liferay Portal UI:

These blogs can also be obtained as an Atom feed using the following URL:


Which Firefox is able to interpret and show as in the following screenshot:

Using the atompub-web plugin #

To test the atompub-web plugin, we'll first need a REST Client. You can download a free REST Client by downloading the REST Client GUI here:

Right click the downloaded jar and run the application by opening it with Java(TM) Platform SE Binary.

As an example lets add a new Blog Entry using the REST Client GUI.

URL: http://localhost:8080/atompub-web/atom/blogs?companyId=1&groupId=18

For the Method tab

Select POST for the HTTP Method

For the Body tab

Body Content Type: Select "application/atom+xml" for Content-type Select UTF-8 for Content

And add this text In the text box

<?xml version='1.0'?>

<entry xmlns=''>
  <title>Atom Pub Blog 1</title>
  <author><name>Joe Bloggs</name></author>
  <content>Hello world!</content>

For the Auth tab:

Select BASIC for Auth Type.

And enter your Liferay Portal screenname and password.

Now clicking the green arrows creates a new blog entry!

For a list of Blogs, we could use the following URL:


The browser is using the GET HTTP method to obtain a list of all blog entries, but it's also possible to use the other three main HTTP methods, POST, PUT and DELETE, to add new entries, update them and delete them directly. The screenshot shows in the lower side the resulting HTTP headers including the etag headers which allows for conditional GETs for very high scalability.

You can also select to view a specific blog entry by using this URL where 11017 is the ID of the blog entry:


Using this same tool we can also test updating the entry using a PUT. The following screenshot shows how the body of the PUT request is an XML text with the entry details in Atom format. The server answers with 204 HTTP return code to specify that the entry has been updated correctly.

For Web Content, replace "/blogs/" with "/web_content/" in the URLs.

An AtomPub client can also be implemented in JavaScript, which becomes a very useful component for building read-write mashups.

   type: "POST",
   url: 'http://localhost:8080/atompub-web/atom/blogs?companyId=10111&groupId=10135',
   username: 'test',
   password: 'test',
   processData: false,
   contentType: 'application/atom+xml',
   dataType: "xml",
   data: body,
   cache: false,
   success: function(msg){
   error: function (msg){

Security #

Basic authentication has been implemented for this plugin, so you may need to introduce your credentials for some actions. The userName can be your screenName, your emailAddress or your userId in your Liferay Portal.

7 Anexos
38859 Visualizações
Média (0 Votos)
A média da avaliação é 0.0 estrelas de 5.
Respostas do tópico Autor Data
I am interested to know more about the status... Orin Fink 27 de Maio de 2010 07:22
Very interesting. Good news that Liferay can do... Kaon . Z 27 de Junho de 2010 23:51
I'd also like to know about the status of this... Jakub Liska 8 de Outubro de 2010 14:43
Hi Jakub, The Atom Publishing Plugin is in... Jorge Ferrer 26 de Outubro de 2010 02:26
Jorge, Is this plugin part of the supported... sreek samudrala 24 de Julho de 2014 22:56
Hey Sreek, I'm sorry to say that it's not and... Jorge Ferrer 4 de Agosto de 2014 15:29

I am interested to know more about the status of this plugin. It looks like its been removed from the SVN trunk but possibly put into the core in some other fashion. If it is, what is the new URL to utilize when publishing to Liferay over the REST interface for AtomPub?
Postado em 27/05/10 07:22.
Very interesting. Good news that Liferay can do it.

I am considering to use REST API to integrate my web portal with mobile portal. One content, multiple channels...
Postado em 27/06/10 23:51.
I'd also like to know about the status of this plugin. This is really useful plugin, AtomPub is promising technology/protocol and could be very well used for many more things in liferay than just blogging. Look at Google data API. Please don't give up on this plugin.
Postado em 08/10/10 14:43.
Hi Jakub,

The Atom Publishing Plugin is in incubation status and as far as I know it works. We have plans to make it a supported plugin soon.
Postado em 26/10/10 02:26 em resposta a Jakub Liska.
Is this plugin part of the supported plugin now? OR this no longer makes sense with new Liferay portal release.
Postado em 24/07/14 22:56 em resposta a Jorge Ferrer.
Hey Sreek,

I'm sorry to say that it's not and will probably never be in its current form. I was expecting much more interest in it, but we had almost zero feedback about it.

Looking forward I think that maybe it makes more sense to come up with a sort of (RESTful) API Builder that developers can use to easily and quickly build a customized API for their liferay-based systems. But so far it's just an idea.
Postado em 04/08/14 15:29 em resposta a sreek samudrala.