You can create a new property group for a service template from the Create Property Group dialog box.
The following table describes the Create Property Group dialog box fields, subfields, and field groups. A field group is a collection of fields that are related to a specific action or configuration.
When you enter information in a dialog box, if the information is not valid, errors that include a description of the problem appear at the right side of the box.
|
Field |
Subfield |
Description |
|---|---|---|
| ID* | - |
Specifies the ID for the new property group. |
| Display Name* | - |
Name of the new property group shown through the user interface. |
| Description: | - |
A optional description for the new property group. |
| Display/Hide: | - |
Specifies whether to display or hide the property group. |
| Custom File package: | - |
Specifies a custom file for the property group. |
| Summary Panel Rendering | - |
Define a JavaScript function for display contents of summary panel. The following is a sample: function summarize(properties, language, displayType) {
// PropertyInformation objects are stored in the properties.
var summaryContentsMap = {};
var restriction;
for (var i = 0; i < properties.length; i++) {
restriction = JSON.parse(properties[i].restriction);
if (displayType == "exec") {
if (restriction.permission != "hidden") {
summaryContentsMap[properties[i].displayName] = properties[i].value;
}
} else {
summaryContentsMap[properties[i].displayName] = properties[i].value;
}
}
return summaryContentsMap;
}
|
| Validation Script: | - |
Generates a validation file for the property group. |
| Fields with an asterisk (*) are required. | ||
Creating a validator script for verifying property group entries
If the provided validation options are not adequate for your purposes, you can create a script to perform the necessary verification. Following is an example of a validator script written in JavaScript that verifies whether a value entered by the user is a number and is less than the maximum allowable value of 2048:
function (properties, lang, displayType) {
var message = [];
var hasError = false;
if (displayType == "exec") {
_.each(properties, function(property) {
if (isNaN(property.value)) {
message.push( "value must be a number:" + property.keyName + "=" + property.value);
hasError = true;
}
if (property.value >= 2048) {
message.push ("value must be less than 2048:" + property.keyName + "=" + property.value);
hasError = true;
}
});
}
if (hasError) {
return message;
} else {
return
}
}
The following table shows the validator script specifications for the input property:
| # | Name | Description |
|---|---|---|
| 1 | Script format |
function (arg1, arg2, arg3) { //code } |
| 2 | Arguments of validator |
arg1: A listing of property values in Property Group. Each element is an object that has the following properties:
arg2: Locale string. e.g., ja, en arg3: Operating information when script is running (Operation with task creation: exec, Editing operation of properties: config) |
| 3 | Return value of validator |
Success: undefined or null Failure: Error message in array or string format |
If the value is not a number or is larger than the specified maximum, then a message is output through the user interface.