Changes between Version 10 and Version 11 of RESTController


Ignore:
Timestamp:
11/20/09 00:38:49 (15 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RESTController

    v10 v11  
    131131
    132132The {{{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 == Argument Lists ==
     133== URL Argument Lists ==
    134134
    135 URL format:
     135General URL format:
    136136
    137137{{{
     
    141141The argument list is interpreted as follows:
    142142
    143   * '''empty argument list''' is a LIST attempt to the primary resource
    144   * '''<id>''' is a READ attempt on the record #<id> of the primary resource
    145   * '''<method>''' is a <method> attempt on the primary resource
    146   * '''<method>/<id>''' is a <method> attempt on the record #<id> of the primary resource
    147   * '''<id>/<joined_resource>''' is a LIST attempt to the joined resource for the record #<id> of the primary resource
    148   * '''<joined_resource>?id_label=XXX''' is a LIST attempt to the joined resource for the record of the primary resource with that label
    149   * '''<id>/<joined_resource>/<method>''' is a <method> attempt on the joined resource for the record #<id> of the primary resource
    150   * '''<joined_resource>/<method>?id_label=XXX''' analogous.
     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
    151147
    152 You may even pass the record ID of the joined resource at the end of the arguments list to access a particular record - which would produce an error message if these two records do not belong together.
     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
     151You 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.
    153152
    154153The data format of the request can be passed:
    155154
    156   * as extension to the primary resource, e.g. http://localhost:8000/sahana/pr/person.xml/1
    157   * as extension to the joined resource, e.g. http://localhost:8000/sahana/pr/person/1/address.xml
     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
    158159  * as variable "format", e.g. http://localhost:8000/sahana/pr/person/1/address?format=xml
    159160
    160   '''Policy:''' ''"?format="'' overrides ''joined resource extension'' overrides ''resource extension''
    161 
     161  '''Policy:''' the rightmost extension is applied, ''?format='' overrides any extensions
    162162== Plug-In Resource Actions ==
    163163