Jim Fuller wrote:
From: Vadim Gritsenko [mailto:[EMAIL PROTECTED] Sent: 03 February 2004 01:58
To: [email protected]
Subject: Re: added Xindice Ant Task to WIKI
I've not seen code of your ant task, but how it relates/compares to the org.apache.xindice.tools.DeploymentTask? AFAIU, it can do all things which you can do using admin tool.
Warning: its not pretty code which is why I put in wiki first !
Yes, perhaps this would have been the best place to start, but I wanted
to get my hands a little dirty so I can start understanding Xindice.
In any event I want to do something like;
Encapsulate meta data
<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>
Encapsulate Document Data
<xindice action="add-document" name="test doc" host="127.0.0.1" port="8080" url="/xindice/db" collection="/db/test">
<test><a>aaaaaaaaaaaaa</a></test>
</xindice>
Use Filesets to select documents to and from Xindice
<xindice action="add-document" name="test doc" host="127.0.0.1" port="8080" url="/xindice/db" collection="/db/test"> <fileset dir="somedir"> <includes name="**/*.xml"/> </fileset> </xindice>
I felt that if I bounded the Task with DeploymentTool there would have been a problem later on....
Though it's a nice idea for an article for the Wiki.
Cheers, Jim Fuller
I like the general approach that you're proposing. Have you considered making the database implementation pluggable? Really, it seems to me that you are writing an XMLDB ant task, not a XIndice one. It'd be good to be able to somehow configure the required XMLDB driver (e.g. to use the embedded driver). For an example of some XMLDB code that does this, check out:
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/xmldb/java/org/apache/cocoon/components/source/impl/
This uses the following snippet in Cocoon's cocoon.xconf:
<component-instance class="org.apache.cocoon.components.source.impl.XMLDBSourceFactory"
name="xmldb">
<!-- Xindice driver -->
<driver class="org.apache.xindice.client.xmldb.DatabaseImpl"
type="xindice"/>
<!-- Xindice 1.1 Embedded driver -->
<driver class="org.apache.xindice.client.xmldb.embed.DatabaseImpl"
type="xindice-embed"/>
<!-- Add here other XML:DB compliant databases drivers -->
</component-instance>But otherwise - an Ant task would be great.
Regards, Upayavira
