Properties that need to be persisted only need a get and a set method defined, and the object database used by Waher.Persistence will persist the property according to its type. But allowing administrators to edit properties requires human interfaces. It is not sufficient to know the name of the property and the data type of the value.
To enable the IoT Gateway to create human readable interfaces for editing node properties, you must annotate each editable property with information suitable for human interaction. The Waher.Things.Attributes namespace contains a series of attributes that can be used to annotate properties and classes with such information. If these attributes are not sufficient, you can customize the property dialog by implementing the AnnotatePropertyForm() method defined in the IPropertyFormAnnotation interface, available in the Waher.Networking.XMPP.DataForms namespace. Available attributes include:
Method |
Type |
Description |
AlphaChannel |
Property |
Enables editing of the alpha channel of a color property. |
DateOnly |
Property |
Only the date part of a DateTime-valued property is editable. |
DefaultLanguage |
Class |
Defines the default language code for human readable texts in the class. |
Header |
Property |
Defines a localizable header string for the property. |
Masked |
Property |
Makes sure input for the property is masked. |
Open |
Property |
Defines an open parameter. Open parameters accept values outside of given options, as long as the input conforms to the underlying data type. |
Option |
Property |
Defines an option for the property and its corresponding localizable human-readable label. The attribute can be used multiple times. |
Page |
Property |
Defines the page (or tab) with a localizable label in the dialog for the property. |
Range |
Property |
Defines the valid input range for the property. |
ReadOnly |
Property |
Defines a property as read-only (in property dialogs). |
RegularExpression |
Property |
Provides a regular expression for validation of user input. |
Required |
Property |
Tells the system the property is required. |
Section |
Property |
Defines a section with a localizable label inside a page (or tab) where the property will be displayed. |
Text |
Property |
Adds a localizable text paragraph before or after the property. The attribute can be used multiple times. |
ToolTip |
Property |
Defines a localizable tool-tip text for the property. |