DConfig 
SourceForge.net Logo PHP Logo

Dynamic Configuration Toolkit

Appendices

1. Sample dconfig.jnlp content
2. dconfig-ui-jnlp.war directory structure
3. Import / Export Format

1. Sample dconfig.jnlp content      

Here is content of dconfig.jnlp file, which can be found under source code, dconfig-ui-jnlp/web/dconfig.jnlp.

<?xml version="1.0" encoding="UTF-8"?>
<jnlp codebase="$$codebase" href="dconfig.jnlp" spec="1.0+">
  <information>
    <title>Dynamic Configuration Editor</title>
    <vendor>moonwave.org</vendor>
    <homepage href="index.html"/>
    <description>Dynamic Configuration Toolkit Editor</description>
    <description kind="short">DConfig Editor</description>
    <shortcut online="true"/>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources>
    <j2se version="1.5+"/>
    <jar href="dconfig-ui.jar" main="true"/>
  </resources>
  <resources>
    <jar href="lib/commons-dbutils-1.0.jar"/>
    <jar href="lib/commons-lang.jar"/>
    <jar href="lib/commons-logging.jar"/>
    <jar href="lib/commons-logging-api.jar"/>
    <jar href="lib/dconfig-lib.jar"/>
    <jar href="lib/dom4j-1.6.1.jar"/>
    <jar href="lib/jaxen-1.1-beta-6.jar"/>
    <jar href="lib/jaxme-api-0.3.jar"/>
    <jar href="lib/jsr173_1.0_api.jar"/>
    <jar href="lib/log4j-1.2.8.jar"/>
    <jar href="lib/msv-20030807.jar"/>
    <jar href="lib/pull-parser-2.1.10.jar"/>
    <jar href="lib/relaxngDatatype-20030807.jar"/>
    <jar href="lib/spring-beans.jar"/>
    <jar href="lib/spring-core.jar"/>
    <jar href="lib/spring-dao.jar"/>
    <jar href="lib/spring-jdbc.jar"/>
    <jar href="lib/swing-layout-1.0.jar"/>
    <jar href="lib/xsdlib-20030807.jar"/>
    <jar href="lib/xpp3-1.1.3.3.jar"/>
  </resources>
  <application-desc main-class="org.moonwave.dconfig.ui.CfgEditor"/>
</jnlp>

2. dconfig-ui-jnlp.war directory structure      

Run 'ant ui-jnlp' to create a dconfig-ui-jnlp.war file. After extract the war file, you will see the following directory structure.

    Directory           Files                       Comments
    ----------------------------------------------------------------------------

                        dconfig.jnlp
                        dconfig-ui.jar              DConfig Editor jar file
                        index.jsp                   Sample jsp to launch EConfig Editor
                        webstart_small.gif

    lib                                             Files under lib are used by DConfig UI Editor,
                                                    will be downloaded automatically through jnlp (web-start)
                        commons-dbutils-1.0.jar
                        commons-lang.jar
                        commons-logging-api.jar
                        commons-logging.jar
                        dconfig-lib.jar
                        dom4j-1.6.1.jar
                        jaxen-1.1-beta-6.jar
                        jaxme-api-0.3.jar
                        jsr173_1.0_api.jar
                        LICENSE.apache.txt
                        LICENSE.cddl.txt
                        LICENSE.commons.txt
                        LICENSE.dom4j.txt
                        LICENSE.gpl.txt
                        LICENSE.hsqldb.txt
                        LICENSE.jfreechart.txt
                        LICENSE.xalan.txt
                        LICENSE.xerces.txt
                        log4j-1.2.8.jar
                        msv-20030807.jar
                        pull-parser-2.1.10.jar
                        relaxngDatatype-20030807.jar
                        spring-beans.jar
                        spring-core.jar
                        spring-dao.jar
                        spring-jdbc.jar
                        swing-layout-1.0.jar
                        xpp3-1.1.3.3.jar
                        xsdlib-20030807.jar

    WEB-INF
                        web.xml                     DConfig jnlp download set up

    WEB-INF/lib
                        jnlp-servlet.jar            jnlp servlet

You can also get the directory structure after deploy dconfig-ui-jnlp.war to tomcat web server, simple go to /webapps/dconfig-ui-jnlp folder.

3. Import / Export Format      

User can create an export file by selectig a node on DConfig UI Editor, and do a export.
The core element is defined as:
<dconfig keyName="dot separated key names here">
	<attribute name="attribute name #1 here" dataType="data type here">
		<attributeValue>Some value here</attributeValue>
		<comments>Some comments here</comments>
	</attribute>
	...
	<attribute name="attribute name #N here" dataType="data type here">
		<attributeValue>Some value here</attributeValue>
		<comments>Some comments here</comments>
	</attribute>
</dconfig>
Where a dconfig element can contain 0 to multiple attribute elements. Attribute datatype has to be one of the following
supported datatypes:
    Boolean
    Boolean Array
    Integer
    Integer Array
    Long
    Long Array
    String
    String Array
    Float
    Float Array
    Double
    Double Array
    Datetime
    Datetime Array

Here is a sample export file, which can also be obtained from dconfig-webdemo/test/demo-import.xml

<?xml version="1.0" encoding="UTF-8"?>
<configurations><dconfig keyName="admin"/>
	<dconfig keyName="admin.applications">
		<attribute name="bool attr" dataType="Boolean">
			<attributeValue>false</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="boolAr" dataType="Boolean Array">
			<attributeValue>false&^#;true&^#;true&^#;false</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="fArray" dataType="Float Array">
			<attributeValue>1012.9&^#;9.89123&^#;3.24325&^#;3.12415926</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="floatAttr" dataType="Float">
			<attributeValue>10.11</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="int ar" dataType="Integer Array">
			<attributeValue>205&^#;101&^#;102&^#;103</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="integer" dataType="Integer">
			<attributeValue>101</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="long attribute" dataType="Long">
			<attributeValue>1000090</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="longAr" dataType="Long Array">
			<attributeValue>1000&^#;3000&^#;6000&^#;9900</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="new attribute #1" dataType="Double">
			<attributeValue>3.14159278</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="new attribute #2" dataType="Double Array">
			<attributeValue>3.14&^#;3.1415&^#;3.1415926</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="new attribute #3" dataType="Datetime">
			<attributeValue>01/25/2007 00:00:00</attributeValue>
			<comments></comments>
		</attribute>
		<attribute name="new attribute #4" dataType="Datetime array">
			<attributeValue>01/25/2007 00:00:00&^#;01/12/2006 00:00:00</attributeValue>
			<comments></comments>
		</attribute>
	</dconfig>
	<dconfig keyName="admin.database"/><dconfig keyName="admin.system"/>
	<dconfig keyName="admin.users"/>
	<dconfig keyName="admin.webservices"/>
</configurations>
Note:
In attribute array value, '&^#;' is the array item separator.