Date: 2004-02-08T03:30:34 Editor: 213.122.137.214 <> Wiki: Xindice Wiki Page: AntXindice URL: http://wiki.apache.org/xindice/AntXindice
no comment New Page: There are a few methods of using Ant with Xindice; XindiceDeploymentTask XindicewithJavaTask Xindice Ant Task v.1alpha ''[EMAIL PROTECTED]'' Add and remove Xindice documents and collections. This version is an alpha prototype written within an hour to get an understanding of Xindice, it works... but use at your own risk ! Download from http://www.ruminate.co.uk/samples/xindiceanttask.zip usage: 1) add com.example.XindiceAntTask using taskdef to make it available to Ant <taskdef classpath="${java.class.path}" name="xindice" classname="com.example.XindiceAntTask" /> There is no reason you need to keep the namespace, all classes are in com.example....possibly with a better version this Xindice Task may find itself within Xindice or Ant optional. 2) The following target is an example of the syntax used when adding and removing documents and collections <target name="test-xindice-ant-task" description="test XindiceAntTask"> <taskdef classpath="${java.class.path}" name="xindice" classname="com.epinx.xindice.XindiceAntTask"/> <xindice action="add-collection" name="test collection" host="127.0.0.1" port="8080" url="/xindice/db" collection="/db/pims"> <metadata>a</metadata> </xindice> <xindice action="add-document" name="test" host="127.0.0.1" port="8080" url="/xindice/db" collection="/db/pims"> <metadata>b</metadata> </xindice> <xindice action="remove-document" name="test" host="127.0.0.1" port="8080" url="/xindice/db" collection="/db/pims"> <metadata>c</metadata> </xindice> <xindice action="remove-collection" name="test collection" host="127.0.0.1" port="8080" url="/xindice/db" collection="/db/pims"> <metadata><a>asdfasdf</a></metadata> </xindice> </target> Feel free to take this code and make better, but please post back to either here or the Xindice list. todo: * create commercial quality java code...at the moment its an alpha scratched up in an afternoon * comment code * add fileset capability when adding or removing documents from repository * create meta data definition, as encapsulated within xindice element * add retrieve-document function * add BASIC/DIGEST authentication with username/password attributes