**soutContent Proxysout**
All record types is accessible through a single repository/proxy
* * Data requests are done with a be\_user, access is controlled with standard TYPO3 access module
* * ACL check; is the authenticated user allowed to perform this action (POST = write, GET = read, DELETE = delete, PUT = update/write)
* * In CMIS terms this will be "all" rights (read and write)
* * This can be done with plain TYPO3 Database API - hooks around the different queries. Access check done against the be\_user object (Missing for exec\_selectQuery ATM)
* * Remember to think about, content can be requested for
* * Data respond in format matching the TCA definition of the
* * Register supported response formats (XML, JSON)
* * Request data should comes in a TCEForms like format
* array(
* 'name' => 'name',
* 'relations' => array(
* array( //Creates new relation
* 'name' => 'name'
* ),
* array( //Uses excisting relation
* 'uid' => 123
* )
* )
* );
* and processed.
$proxy = new NodeProxy('tablename');
$proxy->create(array(...)); //Create new database record
* Response: succes state and new record data$proxy->read(\_\_identifier); //Read excisting database record
* Response: success state and requested record$proxy->update(array(..)); //Update excisting database record
* Response: success state and new record data$proxy->delete(\_\_identifier); //delete excisting record
* Response: success state
**Request patterns**
Given the base URI is \url{http://domain.com} the request looks like follow
Request have to respect the requested URI. Ex.: request made for domain.com, can only gather data from the domain.com pagetree (*stupid idea, in termsof global news folders outside the pagetree?*)
Get all content elements (tt\_content) for a page
GET /[id]
Get content elements of a specific ctype from a page
GET /id/ctype/textpic
Get a specific tt\_news record from the domain
GET /tt\_news[/id]
Get tt\_news records based on a relation field
GET /tt\_news/category/1
Get available tt\_news records category
GET /tt\_news/category
I would prefer something like:
GET /typo3/rest/<table>[/<uid>][?<filter>]
List of all pages: GET /typo3/rest/pages
All details auf one page: GET /typo3/rest/pages/123
All tt\_content records on one page: GET /typo3/rest/pages/123/tt\_content
* How to cope with records (ex. news) that is displayed on one page, put actually stored in a different pid? All tt\_content records of a specific ctype form a page: GET /typo3/rest/pages/123/tt\_content?ctype=textpic
A specific tt\_content record (by uid): GET /typo3/rest/tt\_content/345
When designing a REST-Api, you might want to have a look at
* \url{http://de.slideshare.net/Wombert/designing-http-interfaces-and-restful-web-services-t3con11-20111008} (e.g. Slides 59ff)
* (there should be a video somewhere from the t3con11 too. A really nice talk to watch.)and read about "Hateoas"
* e.g. \url{http://stackoverflow.com/questions/1139095/actual-examples-for-hateoas-rest-architecture}
###