Configuring Data Editor
You can define additional parameters for any Data Editor module such as:
Labels for the module name and fields
ToolTips for the different fields
Source definitions to generate drop-down or autocomplete value lists
Regular expression checks to verify that entered values comply to a given format.
Identify a slot to enable/disable an entry
Store the name of the last user who edited the data entry
Lists of slots hidden (masked) for display
List of slots hidden (masked) for create/modify
An entry validation script to verify if the data to insert is valid
Associate help pages to the different slots
Access the view page using a direct URL
Labels
You can change the main menu name of the module by changing the “<ModuleName>Name” parameters in the [Labels] section(s) of the module configuration.
For example, for the module “SiteEnrichment” you can change from this label:
To those labels :
Lang default or EN |
Lang FR |
|
|
By setting the following parameters in the module configuration :
[Labels]
SiteEnrichmentName=Site
[Labels-fr]
SiteEnrichmentName=Localisation
Similarly, the labels for each of the slots contained in the DDA table can be set by specifying an entry of type
<slotname>=<label>
In the different [Labels] sections.
ToolTips settings
Tooltips can be associated to the fields in the “create” form.
For example:
[ToolTips]
ActionName=Indicate Action Name
ActionSeverity=Severity
[ToolTips-fr]
ActionName=Indiquer ici le nom de l action
DisplayedMessage=Message affiche
If a slot name of the DDA is ‘ActionName’ then the tooltip will be shown:
Smart tooltips
You can enable “smart tooltips” by setting the parameter AllowToolTipsInSelect to 1 in the module configuration.
When smart tooltips are enabled, the tooltip for each value of a single or multiple-select field can be set differently. This requires that the field itself uses an external source, and the output of the external source must contain the tooltip value after the value itself, with a comma separator
Example – associate the full airport name with its 3 letter code in the AIRPORT_ENRICHMENT DDA.
1. The parameter AllowToolTipsInSelect is set to 1 in the module configuration
2. The slot “airport” has an external source defined in the module :
Airport="file:./data/airports.txt"
3. The output of the external source (here, the file airports.txt) contains entries like :
Where the first field in each entry is the value that will go in the slot, and the second value (after the comma) is the tooltip.
4. In the console, the tooltips show accordingly :
External Sources
For fields that are of type STRING or LIST_OF STRING, the default behavior when in the Add/Modify form is to present a classic text box to fill in the value.
If only specific, known values are allowed as slot values, the list of allowed values can be generated and presented as a dropdown list or as autocomplete suggestions in the create entry dialog. The list can be built by
- executing a script
- reading a file
- fetching values from a specific DDA table
- Fetching values from the events table
- building a list of text values provided in the configuration file
To enable the feature, you have to create/use the [ExternalSources] section in configuration file. The ExternalSources section allows you to define a source for one or more slot.
The syntax is as follows to use a script :
Syntax |
Description |
Usage example |
<SlotName>=cmd:path |
Uses the output of a script execution to create a drop down list of values for the slot in the web interface. Each row of the output is treated as a separate entry. The path is either relative to $PRODUCT_HOME (prefix it with e.g. ./) or can be absolute. It is ok to use forward slashes on windows systems. |
Give a fix list of solution to end user even if this slot is not a baroc enumeration |
<SlotName>=cmd_free:path |
Uses the output of a script execution to create a list of suggestions that will appear as the user types in the slot text box. Each row of the output is treated as a separate entry. The path is either relative to $PRODUCT_HOME (prefix it with e.g. ./) or can be absolute. It is ok to use forward slashes on windows systems. |
Give a set of solution to end user in order to help but allow other values |
The syntax is as follows to use a file :
Syntax |
Definition |
Usage example |
<SlotName>=file:path |
Uses the contents of a file to create a drop down list of values for the slot in the web interface. Each row of the file is treated as a separate entry. |
Give a fix list of solution to end user even if this slot is not a baroc enumeration |
<SlotName>=file_free:path |
Uses the contents of a file to create a list of suggestions that will appear as the user types in the slot text box. Each row of the file is treated as a separate entry. |
Give a set of solution to end user in order to help but allow other values |
The syntax is as follows to use a DDA table :
Syntax |
Definition |
Usage example |
<SlotName>=dda:<cellname>:<dda table>:<dda slot> |
Generates a dropdown field presenting all the values of <dda slot> of table <dda table> on <cell name>
If <cell name> is omitted, the cell used by the module will be used. |
List all registered notification services in a given cell. |
<SlotName>=dda_free:<cellname>:<dda table>:<dda slot> |
Generates a list of suggestions for a text field presenting all the values of <dda slot> of table <dda table> on <cell name> If <cell name> is omitted, the cell used by the module will be used. |
List all registered notification services in a given cell. |
The syntax is as follows to use a Event source :
Syntax |
Definition |
Usage example |
<SlotName>=evt:<cellname>:<Event class>:<slot> |
Generates a dropdown field presenting all the values of <event slot> of event of class <Eventclass> on <cell name>
If <cell name> is omitted, the cell used by the module will be used. If <Event class> if omitted, the EVENT class will be used |
List all hosts values |
<SlotName>=evt_free:<cellname>:<Event class>:<slot> |
Generates a list of suggestions for a text field presenting all the values of <event slot> of event of class <Eventclass> on <cell name>
If <cell name> is omitted, the cell used by the module will be used. If <Event class> if omitted, the EVENT class will be used |
List all hosts values |
The syntax is as follows to use simple text entries:
Syntax |
Definition |
Usage example |
<SlotName>=text:<value1>:<value2>:… |
Generates a dropdown field presenting all the values listed after the “text:” directive. Values must be separated by a colon.
|
Active=text:ENABLED:DISABLED |
<SlotName>= text_free:<value1>:<value2>:… |
Generates a list of suggestions for a text field presenting all the values listed after the “text:” directive. Values must be separated by a colon. |
Active=text:ENABLED:DISABLED |
The syntax is as follows to use one of the built-in functions
Syntax |
Definition |
Usage example |
<SlotName>=function:<function name>:<parameters>:… |
Generates a dropdown field presenting all the values returned by the function <function name>. The list of available functions is available here |
HostList=function:TrueSightGetDeviceList |
For example :
[ExternalSources]
ActionCalendar=cmd:/Data/WWWRoot/Demo/Tools/bin/GetCalendarsList.sh
In such a case, for the DDA slot name ‘ActionCalendar’, the script :
/Data/WWWRoot/Demo/Tools/bin/GetCalendarsList.sh
will be run. One drop-down value will be generated per row of the output, and information will be displayed in a drop down menu.
Five arguments are passed to the script:
1. CellName
2. Name of DDA table
3. SlotName
4. User name
5. User group name
Each line of the output of the script will be presented as a choice in the dropdown list presented in the ProactivePack console.
i If the path to the script or the file is relative (starting with a “.”), the root directory is the $PRODUCT_HOME directory.
Available functions
If the external source is of type “function”, the following functions are available to use. Function names are case-sensitive :
Function name |
Description |
Remarks |
TrueSightGetDeviceList |
Returns the list of TrueSight devices that the logged in user is authorized to access in the TrueSight Presentation server, using the BMC Rest API “devices” call |
To use this function, Proactivepack must be configured to use the TSPS external authentication. |
Linked values
In some situations, only certain combinations of slot values make sense. For example, if the DDA contains slots “category” and ”type” you want that the possible “type” values depend on the chosen value for “category”.
You can easily build that in ProactivePack using the same type of sources as defined in the previous section, by simply adding an entry like follows to the [ExternalSources] section of the module configuration :
[ExternalSources]
Slot1,Slot2=<source type>:<source parameters>
The allowed sources for linked values are:
- file
- file_free
- cmd
- cmd_free
- dda
- dda_free
ð When using file, file_free, cmd, cmd_free, the file (or script) must output values that are comma-separated. See above section for the details on those sources.
ð When using dda and dda_free, the notation for the external source should be set as follows :
dda:<cellname>:<table name>:<comma separated list of slots>
Example
A DDA table named CTI_TABLE holds all the possible combinations of category,type,item in 3 distinct fields
[ExternalSources]
Category,Type,Item=dda::CTI_TABLE:itsm_category,itsm_type,itsm_item
Remarks about linked values :
1. Only one set of linked values is allowed in a given DDA module (you cannot specify two or more lists of slots that are linked by value).
2. If an external source is defined for an individual slot that is listed in the linked values, that external source will not be considered.
Regular expression checks
Values entered by users can also be checked against regular expressions, to ensure that the values comply with your requirements. For example, you may want to ensure that a given slot only contains valid IP addresses, or contains only upper case values, etc.
To do this, use the [SlotPatternVerification] section in the configuration and use entries as follows:
<slotname>=<nice name for your regexp>:/<your regexp>/
The “nice name” is used in the console in case of errors to provide more explicit indications than show the regular expression itself.
Example :
[SlotPatternVerification]
SourceAddress=ip_address:/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/
SourceApplication=uppercase:/^[A-Z]+$/
In this example :
- The slot “SourceAddress” must contain a valid ip address (as set in the regular expression). If the user fails to provide a value that matches the regular expression, a warning will be shown saying :
- The slot “SourceApplication” must be filled in upper case using only letters (no digits/symbols or spaces).
Enable/Disable entry
If your DDA contain a ‘enable’ slot to enable or disable entry usage (within the rules), you can configure ProactivePack module to use it.
Without this configuration, DDA will look like:
Once configured, it will be displayed as follow:
In this configuration, the “EnabledSlot” slot can be changed in a click.
In order to do so, configuration needs to be done as below:
The user must have the “EnableEntry” permission on the module to be able to enable/disable the entry.
Last modifier
If you need to store the last user who modified the entries in your dda DDA, you can declare the slot name that will store the information. This slot will be automatically be populated with the current user when any change is done using ProactivePack on this DDA. It will appear as:
In order to do so, configuration needs to be done as below:
Help pages
HTML files containing help for end-users can be created and associated to the slots of the DDA that are edited through ProactivePack.
If a html file is available, then the question mark is blue can be clicked in the console to show the help content.
Help files must be located under data/<ModuleName>/Help/ and must be named as follow:
1. <slotname>.html by default (all languages)
2. <slotname>-2 digit lang code>.html for a specific language
For example, if the DDA includes a slot “Host”, and a file $PRODUCT_HOME/data/BlackoutMgt/Help/Host.html exists, then when a user clicks on the question mark the content of the file will be displayed such as:
An example file is provided under $PRODUCT_HOME/data/BlackoutMgt/Help :
<h2> Help on hostname choice</h2>
<hr/>
<p> You need to declare host you under maintenance using hostname or regular expression</p>
<div class="alert alert-success" role="alert">
<p> Example: hostname must be defined as in event management. Short name only. Do not use FQDN.</p>
</div>
<div class="alert alert-info" role="alert">
<p> Example: hostname must be defined as in event management. Short name only. Do not use FQDN.</p>
</div>
<div class="alert alert-warning" role="alert">
<p> Example: hostname must be defined as in event management. Short name only. Do not use FQDN.</p>
</div>
<div class="alert alert-danger" role="alert">
<p> Example: hostname must be defined as in event management. Short name only. Do not use FQDN.</p>
</div>
Entry validation script
When data is entered manually (this does not apply to Excel import), a validation script can be run when submitting the data to validate it. This may be used to verify data integrity.
The script takes 5 arguments :
- CellName
- DDA Class of the module
- ModuleName
- User
- Group.
The script also has the form input available as environment variables.
The environment variables are available as :
ClassicSlots=<comma separated list of “classic” slot names>
InputSlots=<comma separated list of “input_match” slots
OutputSlots=<comma separated list of “output expression” slots
<slotname><index>=<slot value>
<index> is “1” for input match, “2” for output expressions and “3” for classic slots. The distinction is required as a same slot could be used in input, output and classic slots.
If the return code of the validation script is 0, then the entry is validated and will be created.
If the return code of the validation script is not equal to 0, then the entry is not validated and whatever the script writes to the standard output will be shown in the console to the end user.
Accessing the view page from an external URL
It is possible to jump directly into the “View” page of a given Data Editor module using arguments included in the URL :
Argument |
Value |
DirectURL |
1 |
Page |
ViewDeleteDDAModifier |
ModuleName |
<Name of the Data Editor Module> |
SearchString |
Optional search string to pass to the table search |
For example, if you want to access the “EventCatalogLinux” Data Editor Module and open the view filtered on the string “linuxsvr1”, you can build a URL as follows :
Other configuration options
Default values
Default values can be supplied for each slot. They override any default set in the BAROC definition of the slot.
Note that default values can be overridden in advanced permissions as well (to allow different user groups to use different default values)
The format is
<SlotName>DevaultValue=<DefaultValue>
Masked Slots
Slots that should not show in the table view of the module can be listed (comma-separated) in the parameter
MaskedSlotsForDisplay=""
Slots that should show (and be edited) in the add/modify form can be listed (comma-separated) in the parameter
MaskedSlotsForCreate=””
SortDirective
You can set a default sort order to the table view of the DDA. The sorting is applied at query time (within mquery). The parameter follows the same syntax as the mquery “-o” option.
SortDirective=<slot1>{+|-},<slot2>{+|-}
Example:
SortDirective=mc_date_modification-,host+
The table is first sorted by descending order of the modification date (latest on top), then by ascending order of the “host” slot value.
ReplicationTasks
If you are licenced to use the DDA Replicator module (see DDA Replication), you can associate replication tasks to your dda, so that a direct shortcut between the Data Editor and the DDA replication task is built. Provide the comma-separated of replication task names in the ReplicationTasks parameter.
For example
ReplicationTasks=task1,task2
Will create the following buttons at the bottom of the DDA table view:
i The “Run” permission the DDA Replication module is required for a user to access these replication tasks.
Custom menu
Accessing custom actions requires the “Run” permission on the module.
Two action types are available :
Command |
to run a script using the mc_udid of the selected entry |
Link |
to provide a link to another web application or part of ProactivePack. |
To create custom actions, add a section like follows to the configuration file of the module ($PRODUCT_HOME/config/custom/<module name>.conf
[Custom]
CustomActions="Action1,Action2,…."
Action1="cmd:…"
Action2=”link:…”
…
CustomActions contains the comma-separated list of actions that need to be created in the context menu. Action names should be alphanumeric only (no spaces).
Each action listed in CustomActions must then exist as a parameter in the rest of the section.
Syntax |
Description |
Usage example |
Action=cmd:<script> |
Runs the <script> provided in the parameter. The script takes as positional arguments:
|
Trigger the enrichment of existing (past) events based on a new DDA enrichment table entry. |
Action=link:<link> |
Redirects the console to <link>. The link can contain a reference to the mc_udid by using the uppercase string MC_UDID. MC_UDID value is replaced at runtime. |
Show other DDA table(s) related to the selected entry. |