[[TOC]] [wiki:S3XRC] | [wiki:S3XRC/RESTfulAPI S3 RESTful API] | S3Resource = S3Resource Class = == Introduction == Resources are dynamic, document-alike representations of data objects on the Eden server. As such, they can represent both single instances as well as structured sets of data objects. ''Note: in the database context, a single instance of a data object is typically called a record (or row), with fields (or columns) as its atomic elements. However, even though S3Resources are typically bound to a relational database and therefore the record/field terminology is often used in this regard, they are '''''not''''' intended to provide any object-relational mapping (ORM).'' S3Resources implement an extensible, multi-format [http://en.wikipedia.org/wiki/REST REST]ful API to retrieve and manipulate data on the Eden server by [http://en.wikipedia.org/wiki/HTTP HTTP] requests, where every resource can be addressed by an individual [http://en.wikipedia.org/wiki/URL URL]. In the context of the Model-View-Controller (MVC) architecture, S3Resources are controller-generated objects. Typically, the controller generates a resource in response to an incoming HTTP request and returns a view of it (''output'') to the client: [[Image(arch3.png)]] == Terminology == A S3Resource consists of elements which can be either ''resource''s themselves (container type) or ''data'' (atomic types). Container type elements within a resource can be: - primary resources (independent data objects) - component resources (objects which are part of a primary object) - referenced resources (objects which are referenced by primary or component resources) == RESTful API == This interface is used by the ''s3_rest_controller()'' function: {{{ res, req = s3xrc.parse_request(module, resource) output = res.execute_request(req, **attr) }}} where {{{res}}} is the S3Resource instance, and {{{req}}} the [wiki:S3XRC/RESTfulAPI/S3Request S3Request] instance. === Flow Diagram === [[Image(s3rest.png)]] ---- DeveloperGuidelines