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 Brian Burridge <ma...@burridge.net> on 2004/01/05 18:56:46 UTC
Connecting Cocoon 2.1 from cvs with external Xindice
Cocoon, pulled last week from cvs, is working with the embedded Xindice,
but I need it to work with the external xindice. I have version 1.1b1
installed in tomcat, and its accessible via
http://localhost:8080/xindice.
However, all the examples show the connection uri to xindice to be:
xmldb:xindice://localhost:8080/db/collection, but that doesn't work. I
tried: xmldb:xindice:localhost:8080/xindice/db/colledction, but it gets
confused with the extra slash.
How do set cocoon up with external xindice?
Brian
Re: Connecting Cocoon 2.1 from cvs with external Xindice
Posted by Brian Burridge <ma...@burridge.net>.
Ok. Made a little progress. My cocoon.xconf was fine as was my sitemap.
I upgraded my cocoon (which was only a few weeks old), but that madea
difference. I no longer get an error connecting to the db. I also
upgrade xindice, and finally got the commnadline admin tool to work,
which never had worked for me before.
I can see my collection via the command line you gave, and can view the
xml in it.
However, when I attempt to retrieve xml via cocoon (sitemap below), I
get nothing but a blank html back (and why html and not blank xml?).
<map:match pattern="db/**">
<map:match type="request-parameter" pattern="xpath">
<map:generate
src="xmldb:xindice://localhost:8080/db/{../1}#{1}"/>
<map:serialize type="xml"/>
</map:match>
<map:generate src="xmldb:xindice://localhost:8080/db/{1}"/>
<map:serialize type="xml"/>
</map:match>
Brian
On Mon, 2004-01-05 at 14:56, Mark Eggers wrote:
> Brian,
>
> I just put together a real quick test. I have the
> following collection:
>
> /db/addissue
>
> It has 100 very small documents in it.
>
> I put the following in my sitemap.xmap:
>
> <map:pipeline>
> <map:match pattern="addissue/**">
> <map:match type="request-parameter"pattern="xpath">
> <map:generate
> src="xmldb:xindice://localhost:8080/db/addissue/{../1}#{1}"/>
> <map:serialize type="xml"/>
> </map:match>
> <map:generate
> src="xmldb:xindice://localhost:8080/db/addissue/{1}"/>
> <map:serialize type="xml"/>
> </map:match>
> </map:pipeline>
>
> (sorry for the word-wrap problem)
>
> I was able to get the listing with:
>
> http://localhost/cocoon/~mdeggers/addissue/
>
> A particular document as:
>
> http://localhost/cocoon/~mdeggers/addissue/out00.xml
>
> I am using Cocoon 2.1.4-dev checked out from CVS on
> 12/15/2003.
>
> My cocoon.xconf looks like:
>
> <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>
>
> Can you reach your collection using the command line
> tools?
>
> Try the following:
>
> xindice ld -c \
> xmldb:xindice://localhost:8080/db/restaurants
>
> If you can, then there is something wrong with:
>
> a) cocoon.xconf
> b) sitemap.xmap
> c) current CVS checkout of Cocoon
>
> If you can't, then there is a problem with your
> installation of Xindice on Tomcat (?)
>
> HTH
> /mde/
> just my two cents . . . .
>
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
Re: Connecting Cocoon 2.1 from cvs with external Xindice
Posted by Mark Eggers <it...@yahoo.com>.
Brian,
I just put together a real quick test. I have the
following collection:
/db/addissue
It has 100 very small documents in it.
I put the following in my sitemap.xmap:
<map:pipeline>
<map:match pattern="addissue/**">
<map:match type="request-parameter"pattern="xpath">
<map:generate
src="xmldb:xindice://localhost:8080/db/addissue/{../1}#{1}"/>
<map:serialize type="xml"/>
</map:match>
<map:generate
src="xmldb:xindice://localhost:8080/db/addissue/{1}"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
(sorry for the word-wrap problem)
I was able to get the listing with:
http://localhost/cocoon/~mdeggers/addissue/
A particular document as:
http://localhost/cocoon/~mdeggers/addissue/out00.xml
I am using Cocoon 2.1.4-dev checked out from CVS on
12/15/2003.
My cocoon.xconf looks like:
<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>
Can you reach your collection using the command line
tools?
Try the following:
xindice ld -c \
xmldb:xindice://localhost:8080/db/restaurants
If you can, then there is something wrong with:
a) cocoon.xconf
b) sitemap.xmap
c) current CVS checkout of Cocoon
If you can't, then there is a problem with your
installation of Xindice on Tomcat (?)
HTH
/mde/
just my two cents . . . .
__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
Re: Connecting Cocoon 2.1 from cvs with external Xindice
Posted by Brian Burridge <ma...@burridge.net>.
I've changed the xmldb samples sitemap to use
"xmldb:xindice://localhost:8080/" instead of "xmldb:xindice-embed:///".
However, when I do this:
"http://localhost:8080/cocoon/samples/xmldb/db/restaurants/" I get this
error:
org.apache.cocoon.ResourceNotFoundException: Collection
xmldb:xindice://localhost:8080/db/restaurants/ not found
I have a collection called "restaurants".
What confuses me is that xindice isn't accessible via localhost:8080 but
at localhost:8080/xindice. So how is the above supposed to work without
specifying "xindice" after the port.
Brian
On Mon, 2004-01-05 at 13:22, Mark Eggers wrote:
> There's a Wiki entry that is helpful:
>
> http://wiki.cocoondev.org/Wiki.jsp?page=XMLIndiceCocoon2.1
>
> Please note that since Xindice 1.1 uses xml-rpc,
> you'll need to put xmlrpc-1.1.jar in:
>
> $CATALINA_HOME/webapps/cocoon/WEB-INF/lib
>
> Here is a snippet from an experimental sitemap I'm
> playing with at the moment.
>
> <map:match pattern="remotedb/**">
> <map:match type="request-parameter" pattern="xpath">
> <map:generate
>
> src="xmldb:xindice://localhost:8080/db/{../1}#{1}"/>
> <map:serialize type="xml"/>
> </map:match>
> <map:generate
> src="xmldb:xindice://localhost:8080/db/{1}"/>
> <map:serialize type="xml"/>
> </map:match>
>
> This has been more or less shamelessly copied from:
>
> http://localhost/cocoon/samples/xmldb/welcome
>
> and its sitemap.xmap in:
>
> $CATALINA_HOME/webapps/cocoon/samples/xmldb/
>
> HTH
> /mde/
> just my two cents . . . .
>
> __________________________________
> Do you Yahoo!?
> Find out what made the Top Yahoo! Searches of 2003
> http://search.yahoo.com/top2003
Re: Connecting Cocoon 2.1 from cvs with external Xindice
Posted by Mark Eggers <it...@yahoo.com>.
There's a Wiki entry that is helpful:
http://wiki.cocoondev.org/Wiki.jsp?page=XMLIndiceCocoon2.1
Please note that since Xindice 1.1 uses xml-rpc,
you'll need to put xmlrpc-1.1.jar in:
$CATALINA_HOME/webapps/cocoon/WEB-INF/lib
Here is a snippet from an experimental sitemap I'm
playing with at the moment.
<map:match pattern="remotedb/**">
<map:match type="request-parameter" pattern="xpath">
<map:generate
src="xmldb:xindice://localhost:8080/db/{../1}#{1}"/>
<map:serialize type="xml"/>
</map:match>
<map:generate
src="xmldb:xindice://localhost:8080/db/{1}"/>
<map:serialize type="xml"/>
</map:match>
This has been more or less shamelessly copied from:
http://localhost/cocoon/samples/xmldb/welcome
and its sitemap.xmap in:
$CATALINA_HOME/webapps/cocoon/samples/xmldb/
HTH
/mde/
just my two cents . . . .
__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003