- CX Portal
- Dise Player
- Dise One Template SDK
- ダウンロード
- リリースノート
- CX Portal
- Upcoming CX Portal Release Dates
- CX Portal Release V27
- CX Portal Release V26
- CX Portal Release V25
- CX Portal Release V24
- CX Portal Release V23
- CX Portal Release V22
- CX Portal Release V21
- CX Portal Release V20
- CX Portal Release V19
- CX Portal Release V18
- CX Portal Release V17
- CX Portal Release V16
- CX Portal Release V15
- CX Portal Release V13
- Dise One
- Premium
- Lite
- CX Composer
- CX Portal
- スクリプティングと統合
- CX Composer
- Internal Support
Expression Attributes allow the setting of state (active: true/false), based on the state of payload/data of one or more other Attributes. This can easily be added to a “24/4 Template Layer Template“ in code, but the logic can in a lot of situations instead be done by the Player itself. For example:
We have a camera-sensor measuring the number of cars in a traffic intersection:
{
"name": "dyn.traffic",
"data": "15"
}
This is updated by a template, a Player Plugin or some other mechanism. To trigger on this, we can add some Expression Attributes that can be used as Conditionals in the CMS:
{
"name": "expr.lightTraffic",
"data": "{dyn.traffic}.VALUE < 10"
}
{
"name": "expr.mediumTraffic",
"data": "{dyn.traffic}.VALUE >= 10 && {dyn.traffic}.VALUE < 20"
}
{
"name": "expr.heavyTraffic",
"data": "{dyn.traffic}.VALUE >= 20"
}
These will then change the active-state dynamically, based on the “dyn.traffic” data-value.
The data-field frequently contains an object serialized as JSON and this is supported in the syntax.
The expression is JS-eval()’ed after massaging of the string, so any JS-operators are valid.
“{dyn.ExampleAttr}” - boolean. The active state of “dyn.exampleAttr“.
“{dyn.ExampleAttr}.VALUE“ - string. The unparsed data-value.
“{dyn.ExampleAttr}.myValue“ - The type and value of JSON.parse(attr.data).myValue.
“expr.mediumTraffic“ from the example above can therefore be defined as:
{
"name": "expr.mediumTraffic",
"data": "!{expr.lightTraffic} && !{expr.heavyTraffic}"
}