getScrollIndices
Sonos uses getScrollIndices
to enable alphabetical scrolling for large collections of metadata. It enables users to scroll through an alphabet to select a letter, which can then initiate a getMetadata
request on a collection at a particular index.
The message accepts the collection ID as a single parameter and returns a comma-separated list of letter and index pairs. If a directory does not contain any items of the given letter, the index should refer to the next letter that does contain a valid index. For example, if there is no item starting with the letter ’Q’, but the first item that starts with ‘R’ is at index 75, the entry for ‘Q’ should also contain 75. The sample below shows this. There are no entries after the letter 'V'.
If you wish to provide this capability for large lists of items, your service must implement getScrollIndices
and return canScroll=true
in the getMetadata
response for any collections that provide scroll indices.
The list of items must be in alphabetical order for Scroll indexes to work.
Request parameter
Name | Type | Description |
---|---|---|
id | string(128) | The ID of the collection. |
Response
Name | Type | Description |
---|---|---|
result | string | Comma separated list of letters and indices. |
Sample request
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getScrollIndices xmlns="http://www.sonos.com/Services/1.1">
<id>collection0001</id>
</getScrollIndices>
</soap:Body>
</soap:Envelope>
Sample response
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getScrollIndicesResponse xmlns="http://www.sonos.com/Services/1.1">
<getScrollIndicesResult>
A,14,B,47,C,54,D,58,E,62,F,62,G,67,H,67,I,68,J,68,K,70,L,70,M,72,N,
73,O,73,P,73,Q,75,R,75,S,77,T,78,U,79,V,85,W,85,X,85,Y,85,Z,85
</getScrollIndicesResult>
</getScrollIndicesResponse>
</soap:Body>
</soap:Envelope>
Updated about 2 years ago