You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Jim Fuller <ji...@ruminate.co.uk> on 2004/02/03 00:40:07 UTC
added Xindice Ant Task to WIKI
Use this Ant task to add and remove collections and documents, working
on version to use filesets and metadata, will update when and if I get
the spare cycles.
I added it to the current WIKI, as it works...but is certainely not
ready for prime time code
http://nagoya.apache.org/wiki/apachewiki.cgi?XindiceProjectPages
You can also download from here http://www.ruminate.co.uk
Cheers, Jim Fuller
Re: added Xindice Ant Task to WIKI
Posted by Upayavira <uv...@upaya.co.uk>.
Jim Fuller wrote:
>>But what I do see from looking at the deployment task is that it uses
>>the XMLTools class, which is also used by the CLI tools. This is very
>>good practice.
>>
>>
>
>My ant task uses xml-rpc calls so can control remote db's...not sure if
>XMLTools is doing native calls or not, will take a look at the
>DeploymentTask in detail.
>
>
The CLI (and thus XMLTools) can do both native and remote calls. There's
a -l option (IIRC) which says use embedded mode, otherwise it uses XMLRPC.
But the DeploymentTask doesn't support this. But making it do so would
be __extremely__ trivial.
>>Oh, and if you get to understand how this works, then a page
>>on the wiki
>>(even better, a patch for the xdocs) about how it works would
>>be great!
>>
>>
>
>The not ready for prime time will get put in wiki, then I will cook it a
>bit more to patch docs...which I am also going through in detail.
>
Sounds perfect.
>I have
>to admit that documentation in general could do with a bit of
>refactoring; the information is generally fine, but the structure is a
>bit helter skelter and I having gone through xindice just recently I
>think I can comment on where newbies have problems comprehending what is
>authorative versus what is ancillery.
>
>
I'm sure all the help available will be appreciated.
Regards, Upayavira
RE: added Xindice Ant Task to WIKI
Posted by Jim Fuller <ji...@ruminate.co.uk>.
> But what I do see from looking at the deployment task is that it uses
> the XMLTools class, which is also used by the CLI tools. This is very
> good practice.
My ant task uses xml-rpc calls so can control remote db's...not sure if
XMLTools is doing native calls or not, will take a look at the
DeploymentTask in detail.
> Oh, and if you get to understand how this works, then a page
> on the wiki
> (even better, a patch for the xdocs) about how it works would
> be great!
The not ready for prime time will get put in wiki, then I will cook it a
bit more to patch docs...which I am also going through in detail. I have
to admit that documentation in general could do with a bit of
refactoring; the information is generally fine, but the structure is a
bit helter skelter and I having gone through xindice just recently I
think I can comment on where newbies have problems comprehending what is
authorative versus what is ancillery.
Cheers, Jim Fuller
Re: added Xindice Ant Task to WIKI
Posted by Upayavira <uv...@upaya.co.uk>.
Jim Fuller wrote:
>>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
>>
>>
>
>Btw do is there an example build.xml Ant that demonstrates the usage of
>DeploymentTask ?
>
>
Okay. I've now looked at the Deployment task. A search on Google found
the API only, not any examples.
But what I do see from looking at the deployment task is that it uses
the XMLTools class, which is also used by the CLI tools. This is very
good practice.
So, Jim, I would strongly recommend you to look at the DeploymentTask.
If there's features that it doesn't have, add them to XMLTools, and then
add access methods to both the Deployment task and to the CLI. That way,
everyone benefits.
Examing the DeploymentTask.java file, you'll find a strong resemblance
between the Ant code in there and the CLI parameters.
Oh, and if you get to understand how this works, then a page on the wiki
(even better, a patch for the xdocs) about how it works would be great!
Regards, Upayavira
RE: added Xindice Ant Task to WIKI
Posted by Jim Fuller <ji...@ruminate.co.uk>.
> 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
Btw do is there an example build.xml Ant that demonstrates the usage of
DeploymentTask ?
Cheers, Jim
RE: added Xindice Ant Task to WIKI
Posted by Jim Fuller <ji...@ruminate.co.uk>.
> 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.
I will definitely keep this in mind, thx for the idea. Though I must
admit of being xindice-nostic at the moment, getting my head around the
internals and understanding what works and what kind of works.
> 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:
Excellent stuff, will pursue, in the meantime the hack ant task is in
the Wiki, though as Vadim pointed out its simple enough to use the
deploymenttask already created.
Cheers, Jim Fuller
Regards, Jim Fuller
Re: added Xindice Ant Task to WIKI
Posted by Upayavira <uv...@upaya.co.uk>.
Jim Fuller wrote:
>>From: Vadim Gritsenko [mailto:vadim@reverycodes.com]
>>Sent: 03 February 2004 01:58
>>To: xindice-users@xml.apache.org
>>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
RE: added Xindice Ant Task to WIKI
Posted by Jim Fuller <ji...@ruminate.co.uk>.
> From: Vadim Gritsenko [mailto:vadim@reverycodes.com]
> Sent: 03 February 2004 01:58
> To: xindice-users@xml.apache.org
> 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
Re: added Xindice Ant Task to WIKI
Posted by Vadim Gritsenko <va...@reverycodes.com>.
Jim Fuller wrote:
>Use this Ant task to add and remove collections and documents, working
>on version to use filesets and metadata, will update when and if I get
>the spare cycles.
>
>I added it to the current WIKI, as it works...but is certainely not
>ready for prime time code
>
>http://nagoya.apache.org/wiki/apachewiki.cgi?XindiceProjectPages
>
>You can also download from here http://www.ruminate.co.uk
>
>
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.
Vadim