The CODFolder class
Support in HbbTV
Available since: Not implemented in HbbTV
CODFolder represents a folder in a CoD catalogue. Folders may contain other folders, and an asset may be present in more than one folder.
Because a content list may contain a large number of items, the contents of the list are made available on demand using a paging model. Applications MAY request the contents of the list in ‘pages’ of an arbitrary size. The data SHALL be fetched from the appropriate source, and application SHALL be notified when the data is available.
Each folder is described by a GroupInformation element in the BCG Group Information Table.
Properties
readonly Integer type |
The type of the item, used to distinguish between the types of objects that may be contained in a folder in a CoD catalogue. This SHALL always have the value 0 for folders. |
readonly String uri |
The URI used to refer to the folder. The value of this property is given by the GroupId attribute of the GroupInformation element representing this folder. |
readonly String name |
The name of the folder. The value of this property is given by the Title element that is a descendant of the GroupInformation element representing this folder. |
readonly String description |
A description of the folder, for display to an end user. The value of this property is given by the Synopsis element that is a descendant of the GroupInformation element representing this folder. |
readonly String thumbnailUri |
The URI of an image associated with this folder. For assets whose BCG description contains a RelatedMaterial element indicating a relationship of Promotional Still Image, the value of this property is given by the MediaURI element that is a descendant of that element. For assets without an appropriate RelatedMaterial element, the value of this property SHALL be undefined. |
readonly Integer length |
The number of items in the current page. If getPage() has not yet been called, the value of this property SHALL be undefined. |
readonly Integer currentPage |
The page number of the currently-available results, as specified in the last call to getPage(). If getPage() has not yet been called, the value of this property SHALL be undefined. |
readonly Integer pageSize |
The number of items that were requested from the content catalogue in a call to getPage(). This MAY be different form the number of items that are available (e.g. the last page in the collection). If getPage() has not yet been called, the value of this property SHALL be undefined. |
readonly Integer totalSize |
The total number of items in the folder. This MAY be undefined until getPage() has been called. The value of this property may be given by the numOfItems attribute of the GroupInformation element representing this folder. |
Methods
Object item( Integer index ) | ||
Description | Return the item at position index in the current page, or undefined if no item is present at that position. This function SHALL only return objects that are instances of CODAsset, CODFolder, or CODService. Applications SHALL be able to access items in the collection using array notation instead of calling this method directly. | |
Arguments | index | The index into the collection. |
void getPage( Integer page, Integer pageSize ) | ||
Description | Retrieve one page of the folder’s contents. The application SHALL be notified by an event targeted at the folder’s parent content catalogue when the data is available. Calls to this method SHALL cancel any outstanding requests. | |
Arguments | page | The number of the page for which data should be retrieved, indexed from zero. |
pageSize | The size of the page. |
void abort() | |
Description | Abort the current request for a new page of folder contents. Any results for this folder SHALL be removed (i.e. the value of the length property will be 0 and any calls to the item() method SHALL return undefined), |