Rationale
Client-controlled paging is an asset which helps reduce bandwidth and scanning.
Proposal
This Pace gives the editors carte blanche to change the field names as they see fit, so any spam about field names should be directed to them directly, rather than the atom-protocol list.
Client Paging
Some clients require more precise control over the server's response. For example, the client might wish to construct a record of the collection's complete membership without generating a very large number of requests.
-
'count': the maximum number of Atom Entries to be included in the response.
-
'offset': the offset at which to begin the sequence of entries that match a given request.
-
'begin': Atom entries in the returned feed MUST have an atom:updated date later in time than the 'begin' date.
-
'end': Atom entries in the returned feed MUST have an atom:updated date equal or earlier in time than the 'end' date.
None of the parameters are required.
Example Select Template
http://example.com/foo?begin=2003-12-13T18:30:02Z&end=2003-12-25T18:30:02Z&offset=2&count=4
-
If no 'end' field is present: The 'end' date is considered to be the updated date of the collection's most recently updated member resource.
-
If no 'begin' field is present: The 'begin' date is considered to be the update date of the collection least recently updated member resource.
-
If no 'offset' field is present: The 'offset' integer is considered to be 0.
-
If no 'count' field is present: The 'count' integer is determined by the server.
Example Code
Example Python Code:
import re uri = "http://www.example.com/{foo/|END|/hmm/}test?foo=bar{&begin=|BEGIN|}{&offset=|OFFSET|}{&count=|COUNT|}&baz=qux" # Python sample using non-greedy wildcards regex = r'(\{((.*?)\|(.*?)\|(.*?))\})' fields = re.compile(regex).findall(uri,0) for field in fields: uri = re.sub(re.escape(field[0]),field[2]+"BOOYA"+field[4],uri) print uri
Output:
http://www.example.com/foo/BOOYA/hmm/test?foo=bar{&begin=|BEGIN|}{&offset=|OFFSET|}{&count=|COUNT|}&baz=qux http://www.example.com/foo/BOOYA/hmm/test?foo=bar&begin=BOOYA{&offset=|OFFSET|}{&count=|COUNT|}&baz=qux http://www.example.com/foo/BOOYA/hmm/test?foo=bar&begin=BOOYA&offset=BOOYA{&count=|COUNT|}&baz=qux http://www.example.com/foo/BOOYA/hmm/test?foo=bar&begin=BOOYA&offset=BOOYA&count=BOOYA&baz=qux
Notes
See also: PacePostTemplate, PaceXoXoIntrospection