|=== Custom Methods Plugged into REST ===
|In many cases it may be much easier to implement non-CRUD resource functions as REST-plugins instead of separate controllers.
| * see search_simple for an example
|The advantage of doing it as REST plugin is that you have a pre-parsed XRequest instead of the original request, as well as you'd preserve the actions and setting from your REST interface for this resource.
|XRequest is already checked and parsed for the REST syntax, and is resolved for the format extension (XRequest.representation) and record ID's, contains all handles to the necessary tables as well as the complete primary record (if any).
|It contains the interface to export or import the resource in XML and JSON (.import_xml() and .export_xml() resp. _json()), and of course you'd have the nice backlink helpers to quickly produce URL's:
| .here() (=URL of the current resource),
| .same() (=URL of the current resource, record ID replaced as "[id]"),
| .there() (=URL of the current resource, no function, no record ID), and
| .other() (=URL of the current resource, other function)
|and finally, XRequest remembers the record ID until the next request to the same resource in the same session, which can be helpful when producing links (especially _next's) not knowing the record ID.