controls.xml
The controls.xml configuration file defines the characteristics of UI control artifacts. A unique ID is used to associate each defined control with a corresponding HTML element.
- icon
- tab
- button
The LiveContent S1000D installer delivers the default version of this file to the skins/Carbon/templates/config subdirectory under the LiveContent S1000D program file folder.
<control> element whose id property corresponds to the ID of a <div> element defined in the HTML markup for the panel on which the control appears. The following attributes can be specified in the opening tag of the element's definition.
- child
-
Designates the control as the child of a larger, container element if set to TRUE, as in this example:
<control id="CVCtrl_print" type="icon" child="true">. The Onclick event specified for the control is executed if the user clicks on the parent. For example, designating an icon as a child of a banner element effectively expands the clickable area of the icon to include the banner. This is especially useful when the UI is displayed on a tablet device. - label
-
Causes the control to be displayed with a text label if set to TRUE, as in this example:
<control id="CVCtrl_print" type="icon" label="true">.
<control> element are available to specify display characteristics that can be applied to the control based on conditions (predefined in Javascript) that describe its state. The following are the available child elements corresponding to each predefined condition.
<enabled>- Specifies a class to be applied to the control when it is enabled, for example to show the image of an icon or button in a selectable state.
<disabled>- Specifies a class to be applied to the control when it is disabled, for example to show the image of an icon or button dimmed, that is, in a non-selectable state.
<highlight>- Specifies a class to be applied to the control when it is highlighted.
<hidden>- Specifies a class to be applied to a control when it is not to be created on the screen.
<shown>- Specifies a class to be applied to a control when it is to be created on the screen.
<invisible>- Specifies a class to be applied to a control when it is to be created on the screen, but not visible to the user.
<visible>- Specifies a class to be applied to a control when it is to be created on the screen and visible to the user.
<onclick>- Specifies an action to be performed when the user selects the control, expressed as one or more Javascript commands.
<access>-
Specifies a security group and device definition for the control using its child elements,
<groupname>and<device>, respectively. Using these elements, you can determine whether a control appears for a given user group or on a given device. <text>- Specifies a value representing the text for the object's text elements. The value specified corresponds to the name in a name/value pair defined in a properties file for the default language in which the LiveContent S1000D user interface is to be displayed. For example, if the default language is set to English, LiveContent S1000D uses a properties file named resources-EN.prop. If you change the default language, the application localizes the text using the properties file for the specified language. The filename of each language resource file contains a two-character ISO language code corresponding to its language.
controls.xml example
The following is a fragment of a controls.xml file showing the attributes assigned to three icon controls.
<control id="CVCtrl_print" type="icon" label="true" child="true">
<disabled className="toolbar_button_disabled tbar_print_off dark" default="1">
<condition name="hasDocument" status="false"/>
</disabled>
<enabled className="toolbar_button tbar_print iconized">
<condition name="hasDocument" status="true"/>
</enabled>
<highlight className="toolbar_button tbar_print highlightIcon"/>
<hidden>
<condition name="hasLargeTable" status="true"/>
</hidden>
<shown>
<condition name="hasLargeTable" status="false"/>
</shown>
<access>
<device>DESKTOP</device>
</access>
<onclick>CVPortal.components.cvDocHandler.showMenu("prtMenu");</onclick>
<text>ctrl.print</text>
</control>
<control id="CVCtrl_settings" type="icon" label="true" child="true">
<disabled className="tbar_settings dark"/>
<enabled className="tbar_settings iconized" default="1"/>
<highlight className="tbar_settings highlightIcon"/>
<onclick>CVPortal.components.cvDocHandler.toggleSettingsMenu();</onclick>
<text>ctrl.settings</text>
</control>
<control id="CVCtrl_search" type="icon" label="true" child="true">
<disabled className="tbar_search dark"/>
<enabled className="tbar_search iconized" default="1"/>
<highlight className="tbar_search highlightIcon"/>
<onclick>CVPortal.components.cvSearch.showSearch();</onclick>
<text>ctrl.search.search</text>
</control>
In the preceding example, note that the Print icon named CVCtrl_print is available to all users on desktops because that device is specified within the control's <access> attribute. It is suppressed for tablets or other devices. Text for the icon is taken from the ctrl.print name/value pair in the appropriate language resource file as specified in the control's <text> attribute.