9 | | The [wiki:S3XRC_S3Resource S3Resource] class implements a generic '''RESTful API''' ([http://en.wikipedia.org/wiki/Representational_State_Transfer Representational State Transfer]) for Sahana Eden database resources, i.e. they can map HTTP requests to data resources and function calls. |
10 | | |
11 | | In particular, they map resource addresses (=URL's) and HTTP methods (=GET, PUT, DELETE etc.) to CRUD actions, and then invoke so called ''method handlers'' (provided by the calling controller via hooks) to execute those actions. |
12 | | |
13 | | The function {{{shn_rest_controller()}}} provides by default a number of generic CRUD method handlers. These method handlers as well as {{{shn_rest_controller()}}} itself are implemented in: |
| 9 | The [wiki:S3XRC_S3Resource S3Resource] class implements a generic '''RESTful API''' ([http://en.wikipedia.org/wiki/Representational_State_Transfer Representational State Transfer]) for Sahana Eden database resources, which maps HTTP requests (i.e., URLs and HTTP methods like GET, PUT, DELETE etc.) to internal data stores (e.g. database resources) and methods (e.g. CRUD), and applies the methods by calling so called ''method handlers''. |
| 10 | |
| 11 | Method handlers are to be provided by the calling controller via hooks. The function {{{shn_rest_controller()}}} simplifies the use of the REST interface and provides a number of pre-configured standard CRUD method handlers. |
| 12 | |
| 13 | These default method handlers as well as {{{shn_rest_controller()}}} itself are implemented in: |