OpenGPI tries to simplify and speed up the creation of configuration editors. To enable a certain kind of flexibility, developers can write the specification for their configuration menu as a simple XML file. Using a good editor will be quite advantageous, because it can assist with autocomplete and other features.
OpenGPI uses files named "descriptions" to create its interfaces. These descriptions consist of two basic elements: Blocks and keys. Blocks are just a way to organize the keys in sub-groups, similar to what is done in most configuration files today, anyway. To give you an impression of the syntax, let's look at the most basic description file we can create:
<?xml version="1.0"?> <description xmlns="http://numhpc.math.kit.edu"> <version>0.1</version> <block> <name>BasicBlock</name> <enabled>true</enabled> <key> <name>MeshFile</name> <enabled>true</enabled> <type>spinbox</type> <default>1</default> </key> </block> </description>
This should return "XML file is valid."
As you can see, the general format is not that complicated.
All these elements are block elements, i.e. they contain other elements. These child elements are listed here, each with their description following. The general structure can also be looked up in data/description.xsd
This is the most basic block all descriptions contain.
This element may contain other <block> or <key> elements. Needed children:
- <name> "The reference name. Displayed, when no display name is given"
- <enabled> "Decides if this block is enabled, i.e. shown. May be 'true' or 'false'"
Allowed children:
- <displayname> "The name to display for this block"
- other <block>s
- <key> elements, see section "<key>"
This is the most important tag for us.
Depending on the type, there may be additional children elements. WARNING: Compatibility between type and the children is not currently being checked by the script.
"combobox": Needed children:
Allowed children:
"spinbox": Allowed children - <defaultmin> "Minimum to set when evaluating all dependencies" - <defaultmax> "Maximum to set when evaluating all dependencies" - <min> "Minimum value for the default settings. Usually not needed to be applied" - <max> "Maximum value for the default settings. Usually not needed to be applied"
Itemlists are used for the default- and currentlist tags. Itemlists contain <item>-tags. To enable easier reference, one may supply the attribute 'value' to the item.
<item value="itsValue">Its display value</item>
Dependencies are specified for certain values in each key. Needed children:
- <value> "The value for which to execute this dependency
- <target> "Reference to the targets. This may have arbitrarily many"
Depending on the action, the target tag may contain only a <targetblock>, or an additional <targetkey>. It also contains an <action>. For all actions except "enableblock", a <targetkey> is needed.
Be careful that for one target, you only specify either insertitems or removeitems. Specifying both does not have a specified behaviour, and the implemented one _may_ change.