The configuration of the application is done with two types of files in XML format.
The first type of configuration file is just one file for the global concepts of the application, as also certain elements for the user interaction.
This is a table with all the configurable elements of that file.
|GrammarFileName||Names of the files that have grammar definition for all commands. The files are separated by semi-period.||Yes||grammar/db2-create.xml;command/db2-alter.xml|
|GrammarReaderName||Implementation of the read that will read the grammar.||Yes||name.angoca.zemucan.grammarReader.impl.xml.ImplementationXMLGrammarReader|
|Prompt||The prompt that is shown in the console.||No||sa>|
|Exit||Token to exit from the application.||No||exit|
|AboutToken||Token to ask for the application information.||No||about|
|HelpToken||Token to ask for help about how to use the application.||No||???|
|ShowIntro||If the introduction is show presented when the application started.||No||true/false|
|DB2Native||If the DB2 commands have to be executed natively||No||true/false|
Some configuration parameters are defined in the JVM environment variables. These parameters are:
The second type of files describes the grammar of the DB2 commands. Those files contain each token of a command, and for each one it says what the possible next tokens are.
When the application reads the grammar, it builds a graph in memory, where it has an only entering point, and only one exiting point. The entering point is called STARTING_NODE, and in this token all DB2 commands are added. The exiting point is called ENDING_NODE, and when a command can be executed, it has to refer to it (The command has enough parameters to realize some operation.)
Each token that represents a command name or a parameter, is written in a grammar file like a node. A node has the following attributes:
|id||Unique identifier of a node in the graph. It cannot be possible to have two nodes with the same name.||<id>idCreate</id>|
|name||Token's name, which is the word that represents in the grammar.||<name>create</name>|
|reserved||Indicates if the node represents a reserved word, or if it is a value given by the user.||<reserved />|
|children||Represents the options of the command in the current position. It is described with idToken attribute.||-|
|idToken||Following node to the current node.||<idNode>createTable</idNode>|
The final node, ENDING_NODE, does not have children, because after this node, there are no more options.
The attribute reserved does not have any value, only its presence in the node means that the word represents a reserved word.
Following, there is an example of a node called create:
<token> <id>create</id> <name>create</name> <reserved /> <children> <idToken>create_database</idToken> <idToken>create_table</idToken> <idToken>create_tablespace</idToken> ... <idToken>create_index</idToken> </children> </token>
There are other two properties files that configure the operation of the application.
Logback is used for as the event registry system in the application. For its configuration, please look at Logback documentation (http://logback.qos.ch/manual/configuration.html).
Those files contain the messages showed in the user interface. This file is composed by elements: key/value.
Currently, the application is translated to English and Spanish. If you want to add another language, it is just necessary to translate the messages that can be found in those files. The language selection to show is done according to the Locale properties of the machine where the application is executed. (Locale in Java).
Information about translation for Internationalization: Resource Bundle.