Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
FAQ
License

User-defined global configuration properties



Properties variables can be declared in the configuration, and reused in most of the configuration files (for example file paths).

A global property is declared by the confProperty element. This element has two mandatory attributes:
  • key: the name of the variable
  • value: the value of the variable
These properties can be used in all other configuration files by using the "${variable_name}" construct.

Overriding properties values at start through a Popup dialog

The "starterGUI" command-line argument allows to override user-defined properties before starting the framework. For example:
      java -jar protoframework.jar config=filelist.xml starterGUI
This will show a Popup window allowing to override their values[1]
Their initial values are the values which are defined in the Configuration file
. For example, for the following Configuration file:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <confProperty key="twoGUI" value="false" />
      </files>
We will have the following Popup Window allowing to override the value of the "twoGUI" property:
launchproperties

Using user-defined properties to customize the framework architecture


It is possible to use user-defined properties to customize the framework architecture.

Setting user-defined property values through the launcher arguments

It is possible to specify that a user-defined property value can be set through the launcher arguments by setting the true value to the allowSetByLauncher attribute. In that case:
  • The value attribute specifies the value which will be used to set the user-defined property if the launcher does not define this value
  • Else the value will be set by the launcher
For example:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <confProperty key="myPath" value="D:/my/directory/" allowSetByLauncher="true" />
      </files>
If we start the framework by:
      java -jar protoframework.jar config=filelist.xml
The myPath value will have the D:/my/directory/ value.

But if we start the framework by:
      java -jar protoframework.jar config=filelist.xml myPath=D:/the/other/directory
The myPath value will have the D:/the/other/directory value.

Examples

Basic Example

For example:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <confProperty key="myPath" value="D:/my/directory/" />
      </files>
We can for example use this property value in the properties configuration file:
      <properties>
         <application name="appli1" >
            <module name="module1" >
               <moduleProperty key="theGraphicPath" value="${myPath}/graphic.xml" />
            </module>
         </application>
      </properties>

Another example

For example:
      <files>
         <file url="applications.xml" />
         <file url="services.xml" />
         <file url="types.xml" />
         <confProperty key="enable" value="false" />
      </files>
We can for example use this property value in the applications configuration file:
      <applications>
         <application name="appli1" >
            <module name="module1" isEnabled="${enable}" >
      ...
            </module>
         </application>
      </lt;applications>

Notes

  1. ^ Their initial values are the values which are defined in the Configuration file

See also


Categories: config

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence