Cocoon 2.2 + eXist 1.2.6 : Cocoon sitemap configuration.

View: New views
3 Messages — Rating Filter:   Alert me  

Cocoon 2.2 + eXist 1.2.6 : Cocoon sitemap configuration.

by Tomek Piechowicz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.
I`m new to eXist and I`ve been trying to access the database from Apache
Cocoon 2.2 framework via xml:db protocol. I`ve found some information in
Server Configuration section on eXist home page. In subsection 3. Cocoon
Sitemap Configuration I found example code of configuration XML:DB
Database Driver :

<source-handler logger="core.source-handler">
        <!-- xmldb pseudo protocol -->
     <protocol  
           
class="org.apache.cocoon.components.source.XMLDBSourceFactory"  
            name="xmldb">
        <driver class="org.exist.xmldb.DatabaseImpl" type="exist"/>
        <!-- Add here other XML:DB compliant databases drivers -->
      </protocol>
</source-handler>

After I created new cocoon 2.2 block in maven, I`ve copied following
jars to WEB-INF/lib directory :

exist/exist.jar
exist/exist-optional.jar
exist/lib/core/antlr-2.7.6.jar
exist/lib/core/commons-pool-1.4.jar
exist/lib/core/xmldb.jar
exist/lib/core/xmlrpc-client-3.1.1.jar
exist/lib/core/xmlrpc-common.3.1.1.jar

I created configuration file in WEB-INF/avalon/cocoon.xconf and I put
the configuration code into created file. When I try to run maven jetty
with new configuration server throws exception :

org.apache.avalon.framework.configuration.ConfigurationException: Unknow
document 'source-handler' (...).

Can anyone help me with this configuration ?

Regards,
Tomasz.

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Cocoon 2.2 + eXist 1.2.6 : Cocoon sitemap configuration.

by Wolfgang Meier-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I`m new to eXist and I`ve been trying to access the database from Apache
> Cocoon 2.2 framework via xml:db protocol.

Some of the eXist components which were written for Cocoon do
currently not work with Cocoon 2.2. The development version of eXist
removes all direct dependencies on Cocoon (though it still contains
Cocoon examples), so fixing the Cocoon integration isn't really a top
priority anymore. We definitely need to work on this for the
forthcoming 1.3/1.4 release though.

Right now I'm not sure which features have to be upgraded. We may drop
a few components which are poorly supported by Cocoon, in particular
the XMLDBSourceFactory. However, I guess the most important component
is the XQueryGenerator, which should still work. Also, you can use all
of eXist's standard functionality to access the db, so the
XMLDBSourceFactory is not really required anymore.

Wolfgang

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open@...
https://lists.sourceforge.net/lists/listinfo/exist-open

Re: Cocoon 2.2 + eXist 1.2.6 : Cocoon sitemap configuration.

by Tomek Piechowicz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Wolfgang Meier-2 wrote:
Also, you can use all
of eXist's standard functionality to access the db, so the
XMLDBSourceFactory is not really required anymore.
Does It mean that I don`t have to create any configuration files containing definition of protocol and database driver to use XQueryGenerator ?


To test this approach I created new cocoon 2.2 block in maven and added xquery generator and simple pipeline to sitemap.xmap:


<map:generators>
         <map:generator name="xquery"
          logger="sitemap.generator.xquery"
          src="org.exist.cocoon.XQueryGenerator"
          user="guest"
          password="guest" />
</map:generators>


<map:pipeline>
         <map:match pattern="Exist">
             <map:generate src="xmldb:exist:///db/tomek/people.xml" type="xquery"/>    
            <map:serialize type="xml"/>
         </map:match>
</map:pipeline>

After I run jetty, server throws exception :

java.lang.ClassNotFoundException: org.exist.cocoon.XQueryGenerator

Did I forget to copy some jars from eXist lib folder ? Which jar contains XQueryGenerator class ?

Regards,
Tomasz.