Blogs / eZ / eZ Publish REST API developer preview release

eZ Publish REST API developer preview release

Wednesday 29 September 2010 8:39:27 am

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

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

eZ debug

Timing: Jan 18 2025 00:02:55
Script start
Timing: Jan 18 2025 00:02:55
Module start 'content'
Timing: Jan 18 2025 00:02:55
Module end 'content'
Timing: Jan 18 2025 00:02:56
Script end

Main resources:

Total runtime0.2524 sec
Peak memory usage6,144.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.8594180.8281
Module start 'content' 0.00550.1041 769.6875446.5078
Module end 'content' 0.10960.1426 1,216.1953406.4766
Script end 0.2522  1,622.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00441.7518210.0002
Check MTime0.00150.6138210.0001
Mysql Total
Database connection0.00050.196510.0005
Mysqli_queries0.157062.20232020.0008
Looping result0.00210.83362000.0000
Template Total0.226189.620.1130
Template load0.00210.816720.0010
Template processing0.224088.750820.1120
Template load and register function0.00010.036110.0001
states
state_id_array0.00060.242510.0006
state_identifier_array0.00070.288020.0004
Override
Cache load0.00180.6990330.0001
Sytem overhead
Fetch class attribute name0.00281.090530.0009
Fetch class attribute can translate value0.00090.364210.0009
class_abstraction
Instantiating content class attribute0.00000.004130.0000
XML
Image XML parsing0.00030.126010.0003
General
dbfile0.00652.5645220.0003
String conversion0.00000.001730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplblog_entry/full.tplextension/community_design/design/suncana/override/templates/blog_entry/full.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/header.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/header.tplEdit templateOverride template
7content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1content/datatype/view/ezkeyword.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezkeyword.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 10

Time used to render debug report: 0.0002 secs