Ant task for processing DXL
DXL is the Domino XML Language, that makes importing and exporting both data and design to a Domino/Notes database easy. Because it’s XML, it can be transformed into other XML documents and also into other forms. The DXL processing components are supplied with the R6 release, but in R5, those components was found in the XML Toolkit 1.0. This article only treats R6.
Roxes Ant Tasks
The build script makes use of the Roxes Ant Tasks (http://www.roxes.com/produkte/rat.html) to get information from the Windows registry, to locate where your Notes installation is. The JAR file is included with the supplied file.
Building the Domino Ant tasks
Attached to this article are two files, one with the source directory tree, and one with only the binaries. If you only want to use the DXL Ant tasks, you can download the binary jar only, and skip to the section ”Using the DXL Ant tasks” below. To build the binaries from the source-zip file, you have to put the files and directories in a tree like this:
Projects root |_ build_common.xml |_ MyProject | |_ build | | |_ lib | |_ dist | | |_ classes | | |_ lib | |_ docs | | |_ api | |_ lib | |_ src | | |_ java
The name of the projects root and your project directory are irrelevant, but you have to put the build_common.xml in the projects parent directory. The build_common.xml file can be found in my article ”Common Ant build file and sample build file”.
Open a command window and change directory to your project and invoke ”ant -projecthelp”, and you will get a list of targets that can be invoked. Try running ”ant dist” and you would get a binary distribution in the dist/lib directory.
Using the DXL Ant tasks
In Ant, you can define external tasks with the <taskdef> tag. To define the importdxl task, you write:
<taskdef name="importdxl" classname="net.kanngard.tools.ant.tasks.ImportDXL">
If you don’t have the net.kanngard.tools.ant.tasks package in your class path, you can write:
<taskdef name="importdxl" classname="net.kanngard.tools.ant.tasks.ImportDXL"> <classpath path="location/to/DominoAntTasks.jar"/> </taskdef>
To use the importdxl task, you can write:
<importdxl server="" database="names.nsf" sourcefile="source_test.dxl" />
The example above takes the file source_test.dxl and imports all the elements into the local database names.nsf. For more examples and documentation, see the source distribution. Please note that this is the first public release of the tools, so it may contain bugs. Please let me know if you find any!