Changes between Version 55 and Version 56 of RESTController


Ignore:
Timestamp:
08/22/10 19:33:56 (14 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RESTController

    v55 v56  
    77The so called '''REST Controller''' (function {{{shn_rest_controller()}}}) is a wrapper function for the RESTful API of the [wiki:S3XRC_S3Resource S3Resource] class.
    88
    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:
     9The [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
     11Method 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
     13These default method handlers as well as {{{shn_rest_controller()}}} itself are implemented in:
    1414
    1515  * {{{models/01_crud.py}}}.
    1616
    17 The method handlers support a number of data representation formats:
     17The method handlers of {{{01_crud.py}}} support a number of data representation formats:
    1818
    1919    * HTML (including autogenerated Create/Update forms)
     
    2121    * XLS (export only)
    2222    * CSV
     23
     24Note: Method handlers for XML and JSON formats are integrated in the backend (S3Resource).
    2325
    2426A good tool for testing the REST functionality is the [http://code.google.com/p/rest-client/ RESTClient]