The Control Unit Browser is designed for employing, diagnostics and test of control units (see "Control Unit Admin Bundle"). It is designed as a servlet, packed as an OSGi-compliant bundle.
Contents:
The JAR of the Control Unit Browser bundle is cubrowser.jar located in the bin/tools/framework/cu/browser installation directory.
|
The Control Unit Browser bundle exports no packages for use by other bundles.
This chapter provides the steps to take in order to install the Control Unit Browser and launch it in a Web browser.
Note: In the described starting procedure, bundle JAR file installation is done through the mBS's text console. If you prefer, you can use the user-friendly interface of the mConsole to perform this operation.
Except for the Control Unit Admin Bundle, all bundles the Control Unit Browser depends on (see the "Import" section) are included in the base bundle configuration of mBS and are started by default unless additionally set otherwise. This suggests that the Control Unit Admin Bundle, whose JAR file is bundles/cuadmin.jar, should be explicitly installed and started in the OSGi framework.
i -s cuadmin.jari -s cubrowser.jarhttp://<framework_host>/controlunit
If the OSGi User Admin service is not available in the framework, a user can login as anonymous with an empty password. This is possible only if the mbs.useradmin.anonymousConnect system property is true, and the user name is null or an empty String.
This section will help you to get more familiar with the Control Unit Browser and its usage.
When the Control Unit Browser is launched, it searches the OSGi framework for control unit instances and displays them in a tree in the left browser frame.
The main nodes in the control unit tree are the control unit instances. Depending on user's preferences, control units can be displayed with their type, name and ID. When a node is selected, its properties taken from the control unit's metadata appear in the right frame.
Figure
1: Control unit tree. |
|
|||||||||||
The Control Unit Browser shows the state variables and actions as children of the corresponding control unit node. Double click a type node or unit node to expand/collapse it and view/hide respectively control unit instances or state variables and actions.
To refresh the control unit tree content, click the Control Units link or refresh the page.
In case viewing control unit types is enabled (the Type preference is checked), for a selected type you can view its immediate subtypes along with their descendants down to the bottommost type.

For a selected control unit, the Control Unit Browser shows its ID, name, type and description, as specified in control unit's metadata. The Control Unit Browser also shows the IDs of parent and child control units of the chosen one along with links to the data available for them. Note that parents are shown with their ancestors up to the topmost control unit in the hierarchy, as well as children - with their descendants down to the bottommost control unit.
Figure 2: Control unit properties.
A state variable represents a unit-specific parameter and has an ID, unique within the control unit scope. For a selected state variable, the Control Unit Browser shows the metadata of the state variable including its ID, name, data type, etc.
Figure 3: State Variable Properties.
You can add a listener to receive notifications when the value of a selected state variable changes by using the Add a listener command.

Figure 4: Receiving state variable events.
The actions of a control unit are operations that the control unit supports for changing its state, e.g. turning a lamp on and off, resetting a clock, etc. An action can have input and/or output arguments.
For an action, the Control Unit Browser displays information based on the action's metadata, including its input/output arguments, as well as provides an interface for action execution.

Figure 5: Viewing action properties.
To invoke an action, enter input data and click Execute. As a result, the Control Unit Browser will redirect the action execution to the Control Unit Admin and will show action's output if output arguments are defined.
The Control Unit Browser invokes control unit actions by using the invokeAction
method of the Control Unit Admin. Constructor, destructor and finder actions
are called by using other Control Unit Admin methods (see "Control
Unit Admin Bundle") and are therefore not supported by the Control
Unit Browser.
The Control Unit Browser converts action input supplied by the user as text to appropriate data format. For more complex data types, such as dictionary, array and vector (see "Control Unit Admin Bundle"), the Control Unit Browser supports a special syntax for definition of such data:
An array should start with { and end with }, and its elements should be separated by commas.
A vector should start [ and end with ], and its elements should be separated by commas.
A dictionary should start with < and end with >, and
its elements should be separated by commas. Odd entries are considered as
keys and event ones - as values. For example, to modify a user's properties
as dictionary, you can supply the following action input -
The Control Unit Browser can be configured to require or not require user authentication at calling the tool from a Web browser (see step #4 from "Starting the Control Unit Browser"). The configuration can be done over the OSGi Configuration Admin service - most conventiently by using the mConsole or the config console commands. Control Unit Browser's configuration properties are exported under the mbs.cu.browser PID and the "Control Unit Browser Configuration" configuration name.