Skip to content

Configuration Item String

Sébastien Gallou edited this page Apr 18, 2017 · 2 revisions

String

This type describe a string data

Non optionnal fields

Type descriptor

This field define the type as string

"type" : "string"

Optionnal fields

Default Value

The defaultValue field permit to set the default value of the parameter. If not set the default value is an empty string.

"defaultValue" : "john"

Maximum length

It define the max size of the string.

"maximumLength" : "30"

Required field

It defined the field as required. It is not possible to validate the form without have been filling at least one character in this field.

"required" : "true"

Encrypted field

It defined the field as encrypted. It will be shown as a password in the configuration form. The text will be encrypted with a light encrypting algorithm before sending it to the server. There is two kind of password based on usages. You can define decrytable passwords or not. Encryption method will be chosen depending on the "decryptable" attribute value. A plugin or a widget can ask for parameters and could decrypt password if "decrytable" attribue is set. If it is not decryptable, the plugin or widget could only encrypt his string using MD5 hex encoding and compare it the the encoded string.

If omitted, the password is decryptable.

"encrypted" : "true",
"decryptable" : "true"

Regular expression

It is possible to set a regex in order to make validation of the field. The regex must be with an error message which can be translated as same as name and description fields.

"regex" : "([0-9]{1,3}\\.){3}[0-9]{1,3}",
"regexErrorMessage" : "Must be an ipv4 adress like 192.168.0.12"

Example

"ipAddress" : {
    "type" : "string",
    "name" : "IP Address",
    "description" : "Set the IP Address of the peripheral",
    "regex" : "([0-9]{1,3}\\.){3}[0-9]{1,3}",
    "regexErrorMessage" : "Must be an ipv4 adress like 192.168.0.12",
    "required" : "true"
}
Clone this wiki locally