-
Notifications
You must be signed in to change notification settings - Fork 9
Web Service Collection
Johan Janssens edited this page Mar 10, 2021
·
19 revisions
A collection can easily be retrieved from any URL.
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
.
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
.
To create custom webservice collections you need to extend the ComPagesModelWebservice
class.
[todo]
Got a question or need help? We have a forum on Github Discussions where you can get in touch with us.