Writing UI Extensions
In WSO2 IoTS each device type has it's own UI that lists the device specific details. Therefore, when writing your own device type you need to write the UI units mentioned below for the device specific details to be listed in the WSO2 IoTS Jaggery application pages.
Device type view Jaggery application page
The device type UI is written using the cdmf.unit.device.type.<DEVICE_TYPE_NAME>.type-view
 unit. This unit is fetched when you click on a specific device type from the device-type-listings page.
For more information on the sample implementation of this unit for the Virtual Fire-alarm, see here.
The main .hbs
 file of this unit includes all the information of a specific device type such as:
Explain the device type and its functionality.Â
The steps to register an instance of the device.
Links to download a device-agent (if available), other supporting documentation and APIs
Device details Jaggery application page
The device details UI is written using the cdmf.unit.device.type.<DEVICE_TYPE_NAME>.device-view
 unit. This unit is fetched when you click on a specific instance of a device type that is already created.
- The mainÂ
.
hbs
 file of this unit includes all the information related to a specific instance of a device type. The author can retrieve and initialize theÂdeviceType
 andÂdeviceId
, which are specific to the device instance from theÂrequest
/uri
 parameters inside the javascript file. Therefore, if any API call needs to be made, you can include theÂdeviceType
 andÂdeviceId
 variables inside theÂ.
hbs
 file.
Further to generate the real-time data gathered from the device, you need to write the Real-time data Jaggery application unit. Include theÂ
device-operations
 unit in aÂzone
 for the available operations of the device to be listed. The listing happens according to theÂ@Operation
 annotation used in the device-type API.
Â
For more information on the sample implementation of this unit for the Virtual Fire-alarm, see here.
Â
Real-time data Jaggery application page
The policy wizard UI is written using the cdmf.unit.device.type.<DEVICE_TYPE_NAME>.realtime.analytics-view
 unit. This unit is fetched when you click on a specific instance of a device type that is already created.Â
You need to configure the graphs to define what axis represents the data gathered from the device sensors.
For more information on the sample implementation of this unit for the Virtual Fire-alarm, see here.
Historical data Jaggery application page
The policy wizard UI is written using the cdmf.unit.device.type.<DEVICE_TYPE_NAME>.analytics-view
 unit. This unit is fetched when you click View Device Analytics that is under the real time graph of the device page. You need to configure the graphs to define what axis represents the data gathered from the device sensors.
For more information on the sample implementation of this unit for the Virtual Fire-alarm, see here.
Policy wizard Jaggery application page
The policy wizard UI is written using the cdmf.unit.device.type.<DEVICE_TYPE_NAME>.policy-wizard
 unit. The unit is fetched when you click ADD POLICY in the Policy Management page. This unit can be configured to inherit the parent policy wizard unit (iot.unit.policy.wizard
) of the devicemgt
 Jaggery Application.Â
- For more information on the sample implementation of this unit for the Virtual Fire-alarm, see here.
- For more information on how to add a policy, see Adding a Policy.
Adding a policy Jaggery application page
Adding a policy UI is written using the cdmf.unit.device.type.<DEVICE_TYPE_NAME>.policy-view
 unit. The unit is fetched when you click view on a policy that's already created. This unit can be configured to inherit the parent policy view unit ( iot.unit.policy.view
) of the devicemgt
 jaggery application.
For more information on the sample implementation of this unit for the Virtual Fire-alarm, see here.
Editing a policy Jaggery application page
Editing a policy UI is written using the cdmf.unit.device.type.<DEVICE_TYPE_NAME>.policy-edit
 unit. This unit is fetched when you click edit on a policy that's already created. This unit can be configured to inherit the parent policy-edit unit (iot.unit.policy.edit
) of the devicemgt
 Jaggery Application. Â
For more information on the sample implementation of this unit for the Virtual Fire-alarm, see here.