cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christofer Dutz" <>
Subject AW: AW: AW: eXist xmldb
Date Fri, 16 Jun 2006 10:28:32 GMT
Yet another try … common’ !!!!!


Another try … since the mailing list complained about my postings size :-(



Hi Peter,


Sorry fort he delayed response. I was out of office and full of work after that. I added the
Souce for my eXist service to this mail. 

I have to explain this a little though. This service uses a directory specified by the “home”
parameter and treats any subdirectory as instance name. In my case I have a directory called
/home/domains and this contains one directory for every domain I host. The service now scans
each directory if it possesses a directory specified by the “suffix” parameter. If it
does, this is where the Exist instance is configured. 


This results in multiple Instances being configured. Unfortunately in cocoon every instance
has to be configured in the cocoon.xconf so dynamically adding domains would not be possible.
To circumvent this my modified XmlDbDriver is configured for the virtual instance “exist”
and the instance is defined by the hostname part of the url so xmldb:exist://host1/db addresses
the host1 instance and xmldb:exist://host2/db addresses host2. All remote-access code has
been removed, since I only use local access. I also had to modify the XQuery generator since
this uses the original Driver version and this tries to configure an “exist” instance
after failing to access one with that name. I think I had to modify the original XQueryGenerator
to support overriding with other default driver, so I added the source to this as well.


Here what to do to configure everything:

Add the following Generator definition to your root-sitemap:

<map:generator name="xquery" src="de.cware.cweb.system.xmldb.VirtualHostXQueryGenerator"/>


Add the following Driver definition to your cooon.xconf (remember to remove entries, that
are not used):

            <driver class="de.cware.cweb.system.xmldb.VirtualHostDatabaseImpl" type="exist"/>


Configure the service itself in the cocoon.xconf:

            <component role="de.cware.cweb.system.xmldb.server" class="de.cware.cweb.system.xmldb.XmlDbServerImpl"
home="C:/home/domains" suffix="data/xmldb" minBrokers="1" maxBrokers="5"/>


Create a config-file for exist containing the following code somewhere in the classpath and
call it “xmldb.xconf”:


            <db-connection database="native" files="."

                pageSize="4096" cacheSize="48M" free_mem_min="5">


                <!-- Settings for the database connection pool:

                    - sync-period

                    defines how often the database will flush its 

                    internal buffers to disk. The sync thread will interrupt 

                    normal database operation after the specified number of 

                    milliseconds and write all dirty pages to disk.

                    - min: minimum number of connections to keep alive.

                    - max: maximum number of connections allowed.

                    - wait-before-shutdown:

                    defines how long the database instance will wait for running

                    operations to complete before it forces a shutdown.


                <pool min="1" max="20" sync-period="120000" wait-before-shutdown="120000"/>


                <recovery enabled="yes" sync-on-commit="no" journal-dir="data"        size="10M"/>


                <watchdog query-timeout="-1" output-size-limit="10000"/>


                <!--system-task class="" period="120000">

                    <parameter name="output-dir" value="backup"/>



            <xsl:copy-of select="serializer"/>

            <xsl:copy-of select="xupdate"/>

            <xsl:copy-of select="xquery"/>


                <xsl:copy-of select="indexer/stopwords"/>

                <xsl:copy-of select="indexer/index"/>


                    <!--<xsl:copy-of select="indexer/entity-resolver/*"/>-->



            <xsl:copy-of select="indexer"/>



Finally add the following jars to your cocoon distribution:






        < exist/lib/core/xmlrpc-1.2-patched.jar


Hope this get’s you started with creating your own eXist service (or you like mine so much
that you simply start using this) ;) 


Kind regards, 



PS: I cross-posted this to the eXist mailing list as well, since it might be useful here too.


[ c h r i s t o f e r   d u t z ]



univativ GmbH & Co. KG

Robert-Bosch-Str. 7, 64293 Darmstadt


fon: 0 61 51 / 66 717 - 21

fax: 0 61 51 / 66 717 - 29



Darmstadt, Stuttgart, Karlsruhe, Düsseldorf

View raw message