To populate UI list elements a backing datasource is required. But datasources can also provide write and update support that can be accessed using eventhandlers.
A datasource lists an array of JSON objects. Each object has the same set of properties that can be used by templating in menu pages. An example of data in a datasource could be:
[
{
"name": "John Doe",
"id": 1,
"picture": "https://myresourceserver/image1.png"
},
{
"name": "John Smith",
"id": 2,
"picture": "https://myresourceserver/image243.png"
},
{
"name": "Leah Doe",
"id": 3,
"picture": "https://myresourceserver/image7233.png"
}
]
For certain TV-services HTTP operations can be done. When using POST or PUT, one single item should be carried in the payload and the ID of the item should be part of the URL. When using DELETE the ID must be part of the URL, and no payload is needed.
There are three basic types of datasources.
To be able to take advantage of the flexibility that the Item List UI element offers without connecting to a dynamic source, the static data-source manager is available for users to build data-sets that can be used to back their user interfaces.
This is a fully flexible data-set editor that lets you design your own objects and populate a list of these. The editor is available in the Menu Page editor:
Under the Schema section you will add properties to your object definition. These can be of different types:
¶ Text/Markup
The most common type to use. Allows adding free text with translations.
¶ Text/Markup
The most common type to use. Allows adding free text with translations.
¶ Pure text
Just a text value. No translation capabilities available. Useful when working with filters.
¶ Image resource
A reference to an image resource. Useful if you wish to display images in a structured way.
¶ Document resource
A reference to a document resource. Useful if you wish to update elements with the content of a document, or open a new page with a document reference as a page parameter.
¶ Template resource
A reference to a template resource. Useful if you wish to update elements with the content of a template, or open a new page with a template reference as a page parameter.
¶ WebRadio channel
A static web-radio channel configuration that you pick from the web-radio directory. Contains and icon, a name and the media URL. After fetching the channel info you can edit the name and the icon URL.
The properties are accessed byitem.name, item.iconUrl, item.url
.
¶ Datasource
A reference to another datasource.
¶ Action
Advanced feature
A defined action(read about actions here). You will need to use the Run an action parsed from data-source item action type in combination with this.
Once you have defined a property you can begin adding or editing items in your data-set. When adding a new property, this property will automatically be added to all existing items. The proper editor tool will be set for the property based on the type - so for Text/Markup you will have a free-text editor. For document resources, you will have a document picker, etc.
Items can be reordered in the editor.
These are services offered by the system itself. New services will constantly be added and made available to the editor. This section lists the currently available services:
NOTE Data in services is manipulated using the Create item in service, Update item in service and Delete item in service actions in eventhandlers.
You can define query parameters for the service requests. These can contain templated data.
The Web Radio directory service is a read-only service that allows the TV application to fetch web radio channel definitions based on various criteria. The data also includes the URL required for streaming the radio channel.
A GET request to this service will return a list of items.
The supported query params are:
Example page=2&pagesize=10&search=BBC&bitrate=128
[
{
"name":"BBC Radio 1",
"url": "http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_radio_one.m3u8",
"countrycode": "gb",
"iconUrl": "https://cdn-radiotime-logos.tunein.com/s24939q.png",
"bitrate": 128,
"codec": "MP3"
},
{
"name":"BBC Radio 2",
"url": "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p",
"countrycode": "gb",
"iconUrl": "https://cdn-radiotime-logos.tunein.com/s24940q.png",
"bitrate": 128,
"codec": "MP3"
},
{
"name":"BBC Radio 3",
"url": "http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio3_mf_p",
"countrycode": "gb",
"iconUrl": "https://cdn-radiotime-logos.tunein.com/s24941q.png",
"bitrate": 128,
"codec": "MP3"
}
]
Not supported
Not supported
Not supported
View Bill is a read-only service that allows the TV application to fetch the portfolio for the guest(s) that are checked in to the location to which the TV is registered.
A GET request to this service will return a list of items from the guest portfolio in the format, based on a couple of parameters. This is configured in the Data source params field under the element settings.
The supported parameters are:
The specific response may vary based on the PMS system in use.
[
{
"name":"Service / Product",
"amount":31.6,
"currency":"GBP",
"state":"Open",
"timestamp":"20210112103700",
"isBalance": false
},
{
"name":"Service / Product",
"amount":31.6,
"currency":"GBP",
"state":"Open",
"timestamp":"20210113103700",
"isBalance": false
},
{
"name":"Card payment (Amex 123456****2222)",
"amount":-126.4,
"currency":"GBP",
"state":"Open",
"timestamp":"20210111084355",
"isBalance": false
},
{
"name":"Balance",
"amount":100.0,
"currency":"GBP",
"state":"Open",
"timestamp":"20210111084355",
"isBalance": true
}
]
Not supported
Not supported
Not supported
Guests is a service that allows the TV application to view and check out the guest(s) directly from the room. The service is used for both express checkout and for the view bill tv service.
A GET request to this service will return a list of guests on the room.
The returned list of guests on the room may vary based on the PMS system in use. If the PMS supports "guest checkout", the full list of guests will be returned. In the case of "room checkout", the returned list will contain a single element, with the name of one of the guests (even if there are multiple guests in the room).
The returned guest list can also differ based on whether the guests have access to viewbill or are able to perform an express checkout. To specify which guest list you want to fetch, add the following query param:
operation=bill
[
{
"name":"Guest name 1",
"accountReference": "3451372",
...
},
{
"name":"Guest name 2",
"accountReference": "7451346",
...
}
]
Not supported
Not supported
A DELETE request will start the checkout process for the guest(s) specified by the accountReference of the guest. The accountReference should be used as the Item ID parameter in the Delete item in service action.
Guest messages is a service that allows the TV application to display the messages for the guest on the TV.
A GET request to this service will return a list of messages sent to the room.
[
{
"subject": "Pool closed",
"body": "The swimming pool will be closed at ....",
"receiverRoomAccountId": "21344321",
"createdDate": "2021-10-20T11:28:57.609",
"displayedDate": null,
"isDisplayed": false,
"readDate": null,
"isRead": false,
"isInstant": false,
"senderName": "Reception"
...
},
{
...
}
]
Not supported.
A PUT request to this service only supports setting two fields in the payload: "isRead" and "isDisplayed". Only the fields that are included in the payload will be updated.
{
"isRead": false,
"isDisplayed": true
}
Not supported.
The wake up service allows users to list, add, edit and delete wakeups for the room to which the TV is registered. Wakeups can also be managed from the portal.
Returns all wakeups registered for the room the TV is registered with:
[
{
"id":"13917039",
"contextId":"4949319",
"roomAccountId":"4950797",
"daily":false,
"wakeupMonth":"01",
"wakeupDay":"15",
"wakeupHour":"08",
"wakeupMinute":"20",
"tvPageId":"4950468"
}
]
Creates a new wakeup for the attached room.
{
"daily":false,
"wakeupMonth":"01",
"wakeupDay":"15",
"wakeupHour":"08",
"wakeupMinute":"20",
"tvPageId":"4950468"
}
Be sure to include the MenuPage ID of the page to be displayed for wakeup.
Not supported
Deletes an existing wakeup. The id of the wakeup should be used as the Item ID parameter in the Delete item in service action.
Local data-sources are data-sets that are made available directly in the application. These datasets are maintained by the application and data is based on various sources such as configuration data from the system, in-band data from the current channel etc.
Lists the available languages for use in the TV application, format:
[
{
isDefault: true
iso-639-1: "en"
label: "english"
}
]
[
{
"lang":"en",
"idx":0,
"label":"English",
"active": false,
"_index":1
}
]
[
{
"lang":"off",
"idx":-1,
"label":"None(off)",
"active": false,
"_index":1
},
{
"lang":"en",
"idx": 0,
"label":"English",
"active": true,
"_index":2
}
]"
The subtitle data-set always contains an entry for
"lang": "off"
used to disable subtitles
The list of available external input connectors that are exposed to the guest.
[
{
"type":"hdmi",
"idx":1
},
{
"type":"hdmi",
"idx":2
},
{
"type":"composite",
"idx":1
}
]
Not all physical inputs available are always exposed here.
The list of available TV channels set up for this TV for its present configuration/state.
[
{
"id":"1730497",
"globalChannelId":"a9b14f39-c046-4ecd-aa91-2c0bada586c1",
"name":"CNN",
"mediaurl":"udp://230.3.1.1:5700/4422?drm=false",
"icon":"https://image.thecloudortal.com/mediachannel/a9b14f39-c046-4ecd-aa91-2c0bada586c1.png",
"category":["1735658"],
"_index":1
},
{
"id":"1730500",
"globalChannelId":"577bf282-9b6e-45a5-968b-fdd57a6bd6c7",
"name":"BBC World News",
"mediaurl":"udp://230.3.1.4:5700/8204?drm=false",
"icon":"https://image.thecloudportal.com/mediachannel/577bf282-9b6e-45a5-968b-fdd57a6bd6c7.png",
"category":["1735658"],
"_index":2
},
{
"id":"6765008",
"globalChannelId":null,
"name":"test stream audio",
"mediaurl":"udp://230.1.1.100:5700/0?drm=false",
"icon":null,
"category":[],
"_index":3
}
]
Lists the available channel categories. Useful for presenting TV-channel browsing by category, by filtering the tv-channels store.
[
{
"id":null,
"name":"All",
"_index":1
},
{
"id":"1735658",
"name":"IPTV",
"_index":2
},
{
"id":"1735661",
"name":"DVB-C",
"_index":3
}
]
An entry with
"id": null
is always present, representing the "All" category.
A helper store to make it easier to build time-pickers.
[
{
"_index": 1,
"value":0,
"title":"00"
},
{
"_index":2,
"value":5,
"title":"05"
},
{
"_index":3,
"value":10,
"title":"10"
} ...
]
A helper store to make it easier to build time-pickers.
[
{
"_index":1,
"value":0,
"title":"00"
},
{
"_index":2,
"value":5,
"title":"01"
},
{
"_index":3,
"value":2,
"title":"02"
} ...
]