[Neos] REST API for Neos content elements

Aske Ertmann aske at moc.net
Tue Jan 20 21:44:49 CET 2015


Hey Pavlina

To use the NodeDataRepository you need to create a context which matches the created content to retrieve the content.

Examples can be found in NodeSearchService, where it takes the context and calls NodeDataRepository to fetch NodeData. This is then transformed into actual Nodes using the nodeFactory’s createFromNodeData method.

Once you have a node you can get it’s children through the available methods like getChildNodes.

If you create your own route you need to create the context manually, which can be done using the contextFactory. Search for “createContext” to find examples.

Hope this helps getting you started.

Cheers,
Aske

> On 12 Jan 2015, at 15:49, Pavlina Drosos <pavlinadrosos at gmail.com> wrote:
> 
> Hi guys,
> 
> I need to do a REST API which must deliver specific Neos content elements -
> for example list of all blog posts, single blog post by id, list of
> clients, single client by id etc.
> 
> 
> My problem is that I don't know how to get all Neos content elements with
> specific nodetype (for example all blog posts) and their nested content
> elements (title, author, date and content of each blog post).
> 
> Also how to get single blog post content element with its nested content
> elements by its id.
> 
> I have looked in the NodeDataRepository, but I couldn't find out how to use
> it.
> I will appreciate any suggestions and code examples how to do this.
> 
> Thank you in advance!
> 
> Regards,
> Pavlina Drosos
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos



More information about the Neos mailing list