You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mitchell Christensen <mc...@redknife.com> on 2001/11/15 15:50:28 UTC

Help with Generators

Hi,

A couple of quick questions.

When I include java files inside a
<xsp:structure><xsp:include/></xsp:structure>, where should I put the jar
files?  I know that they are discovered if place them in ${TOMCAT_HOME}/lib,
but I am having problems with name collisions.  Specifically, a 3rd party
app's API jar file I'm using includes DOM stuff that doesn't seem to work
with Cocoon's code, and the 3rd party apps API doesn't work with Cocoon's
DOM stuff.

Second, I've looked at examples and documentation and am still fuzzy on how
to write my own Generator (perhaps I still don't have my head around the
Avalon architecture).  Could this help?

FWIW, the 3rd party app I'm using is the Tamino XML database from
SoftwareAG.  They provide a java based client API for talking to their XML
database.  If I use this API for pulling XML docs, and then pass the
org.w3c.dom.Node they provide (based on the Docuverse DOM implementation) to
<xsp:expr/> I get a null pointer exception.

Any pointers?

-Mitch


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Help with Generators

Posted by David Rosenstrauch <da...@dti.net>.
At 06:50 AM 11/15/01 -0800, you wrote:
>Hi,
>
>A couple of quick questions.
>
>When I include java files inside a
><xsp:structure><xsp:include/></xsp:structure>, where should I put the jar
>files?  I know that they are discovered if place them in ${TOMCAT_HOME}/lib,
>but I am having problems with name collisions.  Specifically, a 3rd party
>app's API jar file I'm using includes DOM stuff that doesn't seem to work
>with Cocoon's code, and the 3rd party apps API doesn't work with Cocoon's
>DOM stuff.


I put my jars in:

$TOMCAT_HOME/webapps/cocoon/web-inf/lib


>Second, I've looked at examples and documentation and am still fuzzy on how
>to write my own Generator (perhaps I still don't have my head around the
>Avalon architecture).  Could this help?


Look at the source code that comes with cocoon.  Location:  src/org/apache/cocoon/generation

Take a look at DirectoryGenerator, StatusGenerator, etc.  You can probably copy half of what they've done in one of these classes.

Basically, what you're trying to do is call methods on the ContentHandler.  I haven't tried to write one, but it doesn't look too tough.

I'm going to need to write one soon for a project, so I'll be able to provide more info then.


DR


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>