Date: 2004-02-08T08:44:43
Editor: 213.122.16.117 <>
Wiki: Xindice Wiki
Page: AntXindice
URL: http://wiki.apache.org/xindice/AntXindice
no comment
Change Log:
------------------------------------------------------------------------------
@@ -21,6 +21,55 @@
Check out the commands.xml file contained in /config directory, which lists
all the available commands for this task.
+Here is an example ant build.xml file which uses the useful Macrodef task to
create xindice tasks.
+
+<?xml version="1.0"?>
+<project name="test xindice deployment task" default="test" basedir=".">
+<description>
+ Illustrate how to use xindice DeploymentTask.
+</description>
+
+<taskdef name="xindicedeploy"
classname="org.apache.xindice.tools.DeploymentTask"/>
+
+<!-- xindice properties //-->
+<property name="xindice.collection" value="xmldb:xindice://127.0.0.1:8080/db"/>
+<property name="xindice.home" location="E:\java\xindice"/>
+<property name="xindice.path" location="c:\test\log"/>
+<property name="xindice.document_dir" location="c:\\doctest\\"/>
+
+<macrodef name="xindice-add-collection">
+<attribute name="name"/>
+<sequential>
+<xindicedeploy Home="${xindice.home}" Name="@{name}"
Collection="${xindice.collection}" Activity="add_collection"
Path="${xindice.path}"/>
+</sequential>
+</macrodef>
+
+<macrodef name="xindice-remove-collection">
+<attribute name="name"/>
+<sequential>
+<xindicedeploy Home="${xindice.home}" Name="@{name}"
Collection="${xindice.collection}" Activity="delete_collection"
Path="${xindice.path}"/>
+</sequential>
+</macrodef>
+
+<macrodef name="xindice-add-document">
+<attribute name="name"/>
+<sequential>
+<xindicedeploy Home="${xindice.home}" Name="@{name}"
Collection="${xindice.collection}" Activity="add_document"
Path="${xindice.document_dir}"/>
+</sequential>
+</macrodef>
+
+<target name="test">
+
+<xindice-add-collection name="test"/>
+
+<xindice-add-document name="test.xml"/>
+
+<xindice-remove-collection name="test"/>
+
+</target>
+
+</project>
+
= Xindice Ant Task v.1alpha =