I'm a developer and I know ajax from other platforms, but I have not experience on eZ.
So what I need is some way to get:
1- some object with the content of one specific node (JSON & XML are fine). 2- the HTML of that view, so I can insert the values of the content node into that HTML, using JavaScript code.
I already have installed xajax 0.5, and xajax-classattributes in my eZ Publish.
I haven't tried specifically xajax, but typically while working with YUI for example, I would create a new module/view where one of the params is a node_id something like
www.example.com/handlerequest/23
Then sending async get call you can get what you want from that URL as on PHP level you can fetch node_id = 23 then generate either XHTML output or whatever you need. You can pass of course more params, like www.example.com/handlerequest/23/JSON, where last part can be use for decision what output return.
To learn more about creating extensions and modules from article or old doc:
http://ez.no/developer/articles/an_introduction_to_developing_ez_publish_extensions http://ez.no/ezpublish/documentation/development/extensions/building_an_ez_publish_module
You can also specify witch datamap attribute to load as second parameter, like: <system_url>/ezoe/load/<object_id>/image
If you instead want to load all the children of a node you can use expand:
<system_url>/ezoe/expand/<node_id>/<offset>/<limit> (offset and limit are optional)
The code for the views, load (json): http://svn.ez.no/svn/extensions/eztinymce/trunk/ezoe/modules/ezoe/load.php
Since this thread is referred to by others, here are some updates:
Some of the ajax concepts from oe5 have been split out and generalized into a extension called ezcore, right now the extension doesn't do much on it's own, more like a developer toolbox for simplifying ajax concepts in eZ Publish.
http://projects.ez.no/ezcore
Among the concepts:
* css/js packer( php class eZPacker ):
http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/ezcss.txt http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/ezscript.txt
* objects/nodes to json/xml/hash/text( php class eZAjaxContent ):
http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/node_encode.txt
http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/json_encode.txt http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/xml_encode.txt
* ezcore/call (php class eZCoreServerCall):
A xajax like interface for calling your own php/template code as registered by a couple of setting lines, but without any js library dependency. http://svn.projects.ez.no/ezcore/trunk/ezcore/doc/ajax.txt