eZ Publish REST API developer preview release

Wednesday 29 September 2010 8:39:27 am

By : Bertrand Dunogier

As announced earlier during the eZ Conference 2010 and the various eZ Publish Fuji events (Oslo, Paris), developer preview releases for the next generation eZ Publish APIs are also be made available.

Note: a newer version of the REST Interface preview is available. See the blog post about REST preview 1.2.

REST API

Heavily requested by both professionals and community users, these new interfaces are being designed in order to make usage of eZ Publish as smooth and flexible as possible: the REST interface aims at giving access to the CMS features over HTTP using JSON or XML output, following the RESTful interface recommendations. Security is provided using an oAuth2 implementation. The whole interface uses the MVC pattern, on top of MvcTools, one of the eZ Components.

PHP API

The second part of this release is the eZ Publish PHP API (very early developer preview). The current state of the eZ Publish API wasn't on par with our objective of making the CMS as open as possible. The lack of documentation didn't expose the public parts of the API, and a new, ambitious implementation of a real API was the only possible choice. You will see by looking at the package examples that the chosen approach uses a fluent interface and establishes clearer terminology on top of the existing system.

HOW-TO

The API packages can be downloaded using the links below:

Of course, since a package without examples & documentation is like a geek without a keyboard, we have prepared some stuff for you.

First, at the root of both packages, you will find an INSTALL doc that will let you install both rest and oauth extensions on your eZ Publish instance. More general info can be found in the README file located inside the same package, in the ezpublish/extension/rest folder.

Icing on the cake, a full featured demonstration of how oAuth and REST can be used using PHP can be found on GIST, the github powered on-steroids pastebin: http://gist.github.com/602862. You can either download the file using the download button at the top, or clone the whole thing using the public clone URL. If you feel like sharing your work based on this, you can even edit it, which basically is a fork, and push your own version for others to see.

Your turn now !

The engineering team is eager to get feedback about the ideas exposed in these preview packages ! Your opinion is crucial at the current steps

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 29 2025 23:51:51
Script start
Timing: Jan 29 2025 23:51:51
Module start 'layout'
Timing: Jan 29 2025 23:51:51
Module start 'content'
Timing: Jan 29 2025 23:51:51
Module end 'content'
Timing: Jan 29 2025 23:51:51
Script end

Main resources:

Total runtime0.0114 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0040 588.2422151.2109
Module start 'layout' 0.00400.0019 739.453136.6563
Module start 'content' 0.00590.0045 776.109495.3203
Module end 'content' 0.01040.0010 871.429729.9766
Script end 0.0114  901.4063 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.001917.0106140.0001
Check MTime0.00108.3344140.0001
Mysql Total
Database connection0.00065.053210.0006
Mysqli_queries0.001916.278930.0006
Looping result0.00000.068810.0000
Template Total0.00086.810.0008
Template load0.00065.165710.0006
Template processing0.00021.607310.0002
Override
Cache load0.00043.489710.0004
General
dbfile0.001512.795580.0002
String conversion0.00000.043840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs