Skip to content

Web Service Collection

Johan Janssens edited this page Mar 10, 2021 · 19 revisions

A collection can easily be retrieved from any URL.

Table of contents

Frontmatter

A web service collection is defined by specifying the URL where the collection should be retrieved from, for example:

collection:
   model: webservice?url=http://www.example.com

Note: webservice is a shortcut for com:pages.model.webservice.

Query url

The url parameter defines the location for the web service collection and can be templated using the template URIs standard. When a template URI is used, the model state will be used to expand the template URL, for example:

collection:
   model: webservice?url=http://example.com{+path}{/segments*}{?query,data*}
   state:
     path: /foo/bar
     segments: ['one', 'two']
     query:  test
     data: 
        more: value

The resulting URL would be http://example.com/foo/bar/one/two?query=test&more=value.

Custom Collections

To create custom webservice collections you need to extend the ComPagesModelWebservice class.

Example

[todo]

Clone this wiki locally