Changes between Version 11 and Version 12 of RESTController


Ignore:
Timestamp:
11/20/09 01:02:54 (12 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RESTController

    v11 v12  
    3737
    3838In this implementation, component tables can be joined 1:1 or N:1 to their primary resources, either by natural joins (same key field in both tables) or primary/foreign key matches, where the primary key is always the 'id' field in the primary table.
     39
     40== URL Argument Lists ==
     41
     42General URL format:
     43
     44{{{
     45http://host/application/module/resource/<arguments>?<vars>
     46}}}
     47
     48The argument list is interpreted as follows:
     49
     50  * '''empty argument list''' accesses to all/any records of the resource
     51  * '''<id>''' access to record #<id> of the resource
     52  * '''<method>''' <method> access to all/any records of the resource
     53  * '''<method>/<id>''' <method> access to the record #<id> of the resource
     54
     55  * '''<id>/<component>''' access to all/any component records of the record #<id> of the resource
     56  * '''<id>/<component>/<method>''' <method> access to all/any component records for the record #<id> of the resource
     57
     58You may even pass a record ID for the component at the end of the arguments list to access a particular component record - which would produce an error message if these two records do not belong together.
     59
     60The data format of the request can be passed:
     61
     62  * as extension to the resource, e.g. http://localhost:8000/sahana/pr/person.xml/1
     63  * as extension to any of the arguments, e.g. http://localhost:8000/sahana/pr/person/1/address/create.xml
     64  * as explicit variable "format", e.g. http://localhost:8000/sahana/pr/person/1/address?format=xml
     65
     66If multiple extensions are specified, the rightmost extension applies. Where ''?format='' is specified, it overrides any extensions.
     67
     68If no ID for the primary resource record is sent in the URL, the last record ID will be remembered. This can be used for cascading or returning UI actions. This ID trace can be explicitly cleared by sending a request to the primary resource with ''clear'' as method. At login/logout as well as after a ''delete'' action, the ID memory is automatically cleared.
    3969
    4070== Model ==
     
    131161
    132162The {{{response.s3.filter}}} provides a filter which is used in the list view to show the desired subset of records (note that the s3.crud_strings can also be customised - when done in the Controller like this, they are good for just this request).
    133 == URL Argument Lists ==
    134163
    135 General URL format:
    136 
    137 {{{
    138 http://host/application/module/resource/<arguments>?<vars>
    139 }}}
    140 
    141 The argument list is interpreted as follows:
    142 
    143   * '''empty argument list''' accesses to all/any records of the resource
    144   * '''<id>''' access to record #<id> of the resource
    145   * '''<method>''' <method> access to all/any records of the resource
    146   * '''<method>/<id>''' <method> access to the record #<id> of the resource
    147 
    148   * '''<id>/<component>''' access to all/any component records of the record #<id> of the resource
    149   * '''<id>/<component>/<method>''' <method> access to all/any component records for the record #<id> of the resource
    150 
    151 You may even pass a record ID for the component at the end of the arguments list to access a particular component record - which would produce an error message if these two records do not belong together.
    152 
    153 The data format of the request can be passed:
    154 
    155   * as extension to the resource, e.g. http://localhost:8000/sahana/pr/person.xml/1
    156   * as extension to the record ID, e.g. http://localhost:8000/sahana/pr/person/1.xml
    157   * as extension to the component, e.g. http://localhost:8000/sahana/pr/person/1/address.xml
    158   * as extension to the method, e.g. http://localhost:8000/sahana/pr/person/1/address/create.xml
    159   * as variable "format", e.g. http://localhost:8000/sahana/pr/person/1/address?format=xml
    160 
    161   '''Policy:''' the rightmost extension is applied, ''?format='' overrides any extensions
    162164== Plug-In Resource Actions ==
    163165