Home
Introduction Documentation Developer's Corner Snippets Extras library Best practices Downloads Screenshots Contact Sponsoring |
Extras library 1 QiQu-ExtrasIn the 'qiquextralib.jar' library you find additional helpfull
QiQu-Commands. At the moment the libray contains four QiQu-Commands:
Download the extraslib here: extraslib.jar To browse the sources, go to the our CVS - repository at SourceForge. 1.1 JavaToXmlThis command converts a Java source file into a XML structure. Actually Java
1.4 and Java 1.5 is supported. You could use this command i.e. if your UML-tool
- such as Borland Together - produces .java files. In this case it might be
easier to use these generated .java files as input for your QiQu script (instead
of using the XMI file). 1.1.1 JavaToXml Sample<?xml version="1.0" encoding="ISO-8859-1"?> <QiQuScript> <JavaToXml FileName="'src/test/hello.java'" NewDocRef="$mydoc"/> <SaveDoc FileName="'hello.xml'" DocRef="$mydoc"/> </QiQuScript> This script will produce something like this: <?xml version="1.0" encoding="ISO-8859-1"?> <compilationUnit package="test"> <import value="java.lang.String"/> <class name="hello"> <doccomment><![CDATA[ @This ist a comment for a Class.@author ga]]> </doccomment> <modifier value="public"/> <vardef type="String" name="variable2"> <doccomment><![CDATA[ A comment for a variable]]> </doccomment> </vardef> <method name="meth1" return="String"> <doccomment> <![CDATA[ A comment for a method@param String the string to return@return String the string that was input]]> </doccomment> <modifier value="public"/> <vardef type="String" name="myString"/> <block value="{// A comment within a methodreturn myString;}"/> </method> </class> </compilationUnit> 1.2 DBQueryThis command allows you to extract data from your database and merge it with
other information, i.e. your UML-Model. 1.2.2 DBQuery Sample<?xml version="1.0" encoding="ISO-8859-1"?> <QiQuScript> <DBQuery DriverJarWithPath="'C:/mydrivers/ojdbc14.jar'" DriverClassName="'oracle.jdbc.driver.OracleDriver'" DBUrl="'jdbc:oracle:thin:@localhost:1521:XE'" DBUserName="'myUserId'" DBUserPassword="'myPassword'" DBQueryString="'select * from test'" NewDocRef="$query"/> <SaveDoc FileName="'query.xml'" DocRef="$query"/> </QiQuScript> This script will produce something like this: <?xml version="1.0" encoding="ISO-8859-1"?> <queryresult statement="select * from test" rows="3"> <row FELD1="eins"/> <row FELD1="drei"/> <row FELD1="zwei"/> </queryresult> 1.3 MessagesBundlesToXMLThis command takes a given directory. Herein it looks for MessagesBundle.properties-files, parses them and creates a XML-Structure out of all given values. 1.3.3 MessagesBundlesToXML Sample<?xml version="1.0" encoding="ISO-8859-1"?> <QiQuScript> <MessagesBundlesToXML DirName="'resources/messagesbundles'" RootNodeName="'translation'" NewDocRef="$xmlFile"/> </QiQuScript> In the given directory the script finds three MessagesBundles:
This will produce the following XML-structure: <?xml version="1.0" encoding="ISO-8859-1"?> <translationlist> <translation label="greetings" default="Hello" de_DE="Hallo" fr_FR="Bonjour"> <translation label="farewell" default="Goodbye" de_DE="Auf Wiedersehen"> <translation label="inquiry" default="Hello" fr_FR="Comment allez-vous?"> <translation label="birthday" de_DE="Geburtstag"> </translationlist> 1.4 XMLtoMessagesBundlesThis command handles a language-XML that has been created with the MessagesBundlesToXML-command. It creates some MessagesBundle.properties-files again into the given directory and overrides existing MessagesBundle-files if there are any. 1.4.4 XMLtoMessagesBundles SampleWe take again the produced XML-file from the preceding sample: <?xml version="1.0" encoding="ISO-8859-1"?> <translationlist> <translation label="greetings" default="Hello" de_DE="Hallo" fr_FR="Bonjour"> <translation label="farewell" default="Goodbye" de_DE="Auf Wiedersehen"> <translation label="inquiry" default="Hello" fr_FR="Comment allez-vous?"> <translation label="birthday" de_DE="Geburtstag"> </translationlist> This will produce the following MessagesBundle-files:
The keys are in alphabetical order. Keys that don't have a value are marked as UNDEFINED, so you can find them easily and fill in the missing values. |