Module Design

ConfigTree Model
The ConfigTree maintains specific configuration types. Each configuration type has a root node in the ConfigTree and zero or more configurations at different levels.
The configuration type is represented by a configurable object, holding the configurations of the type. Each configuration is a Config node instance which has properties and child Config nodes.
The configuration data of a specific type is mapped to some functionality, reflecting the content of the related entities. In this way, the "configuration" of entities can be exported to another system or entities can be indirectly modified by manipulating the Config nodes.
Operations in the ConfigTree
Editing Configurations
Configuration of a specific type within the ConfigTree can be modified to reflect the latest changes to the associated entity. Subject of change (add, edit, and remove) are the Config nodes, including properties and children.
Importing and Exporting Configurations
The ConfigTree provides the benefit of porting configuration data across different systems via export and import of configurations of a specific configurable object in the defined format. The format can be either XML or binary as described in "Import/Export Formats" section of the current document.
Configurations in XML format can be automatically imported on bundle start-up using the functionality provided by the ConfigTree Resource Manager.
Import/Export Formats
Single Configuration Type
The data of one configuration type can be transferred in binary or XML file format. These file formats allow porting configuration types only one by one. For porting a group of configuration types simultaneously, please refer to the next chapter.
Several Configuration Types
When it is more convenient to transfer data of several (or all) configuration types at the same time, the ConfigTree Module supports porting ZIP files holding configurable XML or binary files. Such a configuration ZIP file should contain a directory called configuration, consisting of separate files for each configuration type:
or
You can select which configuration types to be exported to a ZIP file, or which configuration types to be imported from a ZIP file.
File Formats Comparison
Comparison between the binary and XML file formats for importing and exporting configurations.
Binary:
XML:
ConfigTree API
The ConfigTree API is represented by the com.prosyst.mbs.service.configtree Java package. The package contains all public components of the API, including a service for managing the ConfigTree, components representing the ConfigTree content and utilities.
ConfigTree Administration
The ConfigTreeAdmin service provides management applications with access to the ConfigTree components. Applications can call the ConfigTreeAdmin to import and export configurations of a specific type as well as modify available Config nodes if needed.
Refer to "Managing Configurations via API" for more information on using this service.
Components for ConfigTree Content
Each configuration type is represented as a Configurable instance which stands for the root node, holding the configurations of this type.
A Configurable instance contains ConfigNodes,which contain other ConfigNodes and properties in the form of String keys and Object values.
Below is presented the XML format configuration of a demo:
<config name="DEMO1">
<property key="a" value="1, 2, c" type="string[]"/>
<config name="firstnode">
<property key="a[]" value="a, b, n" type="string[]"/>
<property key="map property" type="map">
<property key="aa[]" value="1, 2, 3" type="int[]"/>
<property key="map2" type="map">
<property key="a" value="aa" type="string"/>
</property>
<property key="aa" value="bb" type="string"/>
</property>
<property key="a" value="b" type="string"/>
</config>
</config>
An application supporting a configuration type registers a Configurable service in the OSGi framework with "configurable_type" (Configurable.CONFIGURABLE_TYPE) equal to the type. The ConfigTree Admin will map calls for configurations of that type to the Configurable service.
See "Adding a New Configuration Type" for more information.
Supported Property Data Types
Properties of config nodes have String keys and can have values of the following data types:
Trying to set a property type not supported by the ConfigNode implementation will result in a java.lang.IllegalArgumentException.