Easy web services with eZ Publish

One of the things I love about eZ publish is that it's so configurable and often settings can be used in ways that were not thought of when introduced.

In version 3.8 the ability to add and override HTTP headers was introduced (from what I can tell to allow for fine tuning of cache related headers).

In the most basic terms a web service is the ability to provide machine readable data (typically XML) over a network.

eZ publish has the ability to provide RSS feeds which is contained within it's own module. However this is quite limited. eZ also come with a SOAP library that would allow the coding of services.

The introduction of the httpd header overwrite feature allows for eZ Publish to use the templating system and the content within the site to produce any data you require, i.e. no php coding required. It also allows for the data feeds to be dynamic and relative to the existing web content.

The process in a nutshell is:

create a layout for the webservice (layout.ini)

overwrite the "Content-Type" header for this layout so that the ouput is presented as XML (site.ini)

create templates to produce the desired output

I'm working on a site that uses this method to produce podcasts and will post some code examples once the site is complete.

Comments

I'd also be interested in seeing some example code for this. I"m doing an ezPublish implemenation now where we'll be outputting object data in XML format to then be styled with XSLT via another webservice.

In the preface to the current Admin interface specification the last paragraph caught my eye:A overview of user task need a dashboard, where she can follow here own content, approval and other tasks she might do on a regular basis.I recently saw a demo of the latest version of the bug tracking system JIRA 4.0 by Atlassian. It used an OpenSocial dashboard to allow users to customise their homepage to access and interact with information that was important to them. The system not only displays JIRA widgets but any OpenSocial widgets (and those from other Atlassian products). You can check out a video of it in action here and more information on how Atlassian is using OpenSocial here.

What is OpenSocial? From the official site:OpenSocial defines a common API for social applications across multiple websites. With standard JavaScript and HTML,
developers can create apps that access a social network's friends and update feeds. Google personal home page is an example of an OpenSocial da…

The following presentation was given on 24 July 2012 to the DevOps Brisbane group. Some of the technical detail about Vagrant is outdated but I think it provides a good overview of why moving to a "Infrastructure as code" setup makes a lot of sense.