REST

From version 3.3 (current beta) Tequila will support pretty urls and rest, the current implementation is as follows:

Requirements:

.htaccess file with the following rules

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

#RewriteRule ^.*$ index.php [NC,L]

RewriteRule ^.*$ /projects/2010/workflowupgrade/index.php [NC,L]

DON'T FORGET TO SET THIS LAST REWRITE RULE TO YOUR DIRECTORY!!!!!!!!!

I'm adding this line because with multiple sites in directories the original rule was not working properly (redirection to a different directory was happening

Currently supported REST methods:

Standard URL

http(s)://yoururl/index.php?task=yourtask&mode=yourmode&youridfield=therequestedid

All methods after: http(s)://yoururl/

BROWSE: yourtask /projects

CREATE/NEW: yourtask/new /projects/new

VIEW: yourtask/id /projects/1

Others:

page:html /projects/1.html

xml /projects/1.xml

json /projects/1.json

no headers /projects/1.nh

block /projects/1.block

UPDATE: /projects/1?_method=PUT

OR

/projects/1 (And method = POST)

SPECIAL MODES:

UPDATE AJAX /projects ?rrt=xml (POST) Couldn't find a better way to specify the response type

saveajax /projects/1.xml?_method=saveajax OK

saveajax /projects/1.xml/saveajax OK

saveajax /projects/1.xml?mode=saveajax FAIL USE METHOD ONLY

saveajax /projects/1.xml?_method=PUT OK

saveajax /projects/1.xml (With POST data) OK

INSERT AJAX

/projects/?method

ANY SPECIAL MODE CAN BE CALLED AS FOLLOWS:

AT COLLECTION LEVEL /projects/yourmethod

AT ROW LEVEL /projects/1/yourmethod

TEQUILA RRT -> REST

COLLECTION /projects.rrt

ROW /projects/1.rrt

YOURMETHOD ROW /projects/1.rrt/mymethod

collection /projects.xml/mymethod

/projects/mymethod.xml Allowed but not recommended

Roadmap

Currently I'm implementing:

- patterns to define REST URL's

- Intergrate support to AMF

- Integrate login