You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Christofer Dutz <du...@c-ware.de> on 2002/02/13 00:16:44 UTC

Creating An eXist Generator for Cocoon

Hi, 

 

I am quite new to this side of the Cocoon project ( usually I was just
using Cocoon ), so please be patient.

 

A few weeks ago I joined the group developing the eXist Xml-Database and
because of my experience with Cocoon I was assigned the task of
integrating eXist into Cocoon. After finishing all work for being able
to start/stop/access eXist locally ( not over HTTP or RPC ), I have
started creating a new Generator called
"org.apache.cocoon.generation.ExistGenerator" ( If I am not allowed to
place the class there . please tell me. I just thought that it belonged
there ). 

After finishing a first prototype of the generator, I wanted to test it.
So I added following part to the Sitemap where the generators are
defined :

<map:generator name="exist"
src="org.apache.cocoon.generation.ExistGenerator"/> 

This didn't seem to cause any problems . so I added a simple match in
the standard sample pipeline ( I am using a totally fresh installation
of Tomcat and Cocoon 2 ) "

<map:match pattern="exist">

       <map:generate type="exist" src="xPathExpression"/>

       <map:serialize/>

</map:match>

When accessing this page I get a :

UnnamedSelector: ComponentSelector could not find the component for
hint: exist

>From Cocoon. 

Does this mean that the class couldn't be found, or could there be a
problem with the class itself ? 

My Generator extends the AbstractGenerator class. I hope this is the
right way. If not, could someone please send me a small tutorial with
the steps needed to create a new Generator ? 

 

Thanx in advance, 

 

Christofer Dutz

C-Ware IT-Service

Inh. Christofer Dutz

Goethestr. 18

64372 Ober-Ramstadt

www.c-ware.de

 


RE: AW: Creating An eXist Generator for Cocoon

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Gianugo Rabellino [mailto:gianugo@apache.org]
> 
> Christofer Dutz wrote:
> > First of all. We are developing this Generator for testing reasons.
> > We had a look at the Cocoon 2.0 Sources and couldn't find any
efforts to
> > support XML:DB, so we thought this wasn't going to be supported
until a
> > Final release of the XML:DB API.
> 
> There is full support for XML:DB in 2.0.1.

Copy that.


> > The other reasons we wanted to create a Generator for eXist was that
we
> > modified the database in a way that users are able to
> > instantiate/start/stop eXist from within a simple Servlet and make
local
> > calls ( not over http- or rmi-calls ). A lot of users had the
problem
> 
> I would say that an XSP page/taglib would be enough for this...
writing
> a specific Generator would be confusing since it's meaning would not
be
> really generate but control eXist.

Better yet is to write ExistServer component implementing Server, take a
look at the HSQLDBServer (except the missing stop server feature,
everything is on place). It will be started at Cocoon startup, and
stopped on Cocoon shutdown.


> > The other thing was that we wanted to test the performance-gains we
get
> > by passing the internally used SAX-events directly to Cocoon and not
> > serializing to XML and then to SAX again and not by using some
higher
> > level protocol to transport the data.
> > I don't think this can be done via the standard XML:DB API. If not
> > please correct me.
> 
> XmlResource.getContentAsSAX(ContentHandler handler) :) It's up to the
> impl to decide whether to pipe SAX events locally or
> serialize/deserialize/parse/whatever.
> 
> > Another question to the XML:DB Generator. We also wanted to create a
> > Serializer or Transformer to store results and transformed
XML-documents
> > in eXist. Is there already a way to do this with any component ?
> 
> Scratchpad has an XML:DB Transformer which does this and more :)

Yep.

Vadim



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: AW: Creating An eXist Generator for Cocoon

Posted by Gianugo Rabellino <gi...@apache.org>.
Christofer Dutz wrote:
> First of all. We are developing this Generator for testing reasons.
> We had a look at the Cocoon 2.0 Sources and couldn't find any efforts to
> support XML:DB, so we thought this wasn't going to be supported until a
> Final release of the XML:DB API.

There is full support for XML:DB in 2.0.1.

> The other reasons we wanted to create a Generator for eXist was that we
> modified the database in a way that users are able to
> instantiate/start/stop eXist from within a simple Servlet and make local
> calls ( not over http- or rmi-calls ). A lot of users had the problem

I would say that an XSP page/taglib would be enough for this... writing 
a specific Generator would be confusing since it's meaning would not be 
really generate but control eXist.

> The other thing was that we wanted to test the performance-gains we get
> by passing the internally used SAX-events directly to Cocoon and not
> serializing to XML and then to SAX again and not by using some higher
> level protocol to transport the data.
> I don't think this can be done via the standard XML:DB API. If not
> please correct me.

XmlResource.getContentAsSAX(ContentHandler handler) :) It's up to the 
impl to decide whether to pipe SAX events locally or 
serialize/deserialize/parse/whatever.

> Another question to the XML:DB Generator. We also wanted to create a
> Serializer or Transformer to store results and transformed XML-documents
> in eXist. Is there already a way to do this with any component ?

Scratchpad has an XML:DB Transformer which does this and more :)

Ciao,

-- 
Gianugo


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


AW: Creating An eXist Generator for Cocoon

Posted by Christofer Dutz <du...@c-ware.de>.
First of all. We are developing this Generator for testing reasons.
We had a look at the Cocoon 2.0 Sources and couldn't find any efforts to
support XML:DB, so we thought this wasn't going to be supported until a
Final release of the XML:DB API. 
The other reasons we wanted to create a Generator for eXist was that we
modified the database in a way that users are able to
instantiate/start/stop eXist from within a simple Servlet and make local
calls ( not over http- or rmi-calls ). A lot of users had the problem
that they could not use eXist because they were not able to start an
exist server on their external Webspace. By this we could enable users
which only have access to a plain old servlet engine to use eXist.
We wanted to add some two or three simple parameters to the Generator
that the configuration-file would become obsolete.
The other thing was that we wanted to test the performance-gains we get
by passing the internally used SAX-events directly to Cocoon and not
serializing to XML and then to SAX again and not by using some higher
level protocol to transport the data.
I don't think this can be done via the standard XML:DB API. If not
please correct me.

Another question to the XML:DB Generator. We also wanted to create a
Serializer or Transformer to store results and transformed XML-documents
in eXist. Is there already a way to do this with any component ?

Regards,

Christofer Dutz
C-Ware IT-Service
Inh. Christofer Dutz
Goethestr. 18
64372 Ober-Ramstadt
www.c-ware.de


> -----Ursprüngliche Nachricht-----
> Von: Gianugo Rabellino [mailto:gianugo@apache.org]
> Gesendet: Mittwoch, 13. Februar 2002 10:05
> An: cocoon-dev@xml.apache.org
> Betreff: Re: Creating An eXist Generator for Cocoon
> 
> Christofer Dutz wrote:
> >
> > A few weeks ago I joined the group developing the eXist Xml-Database
and
> > because of my experience with Cocoon I was assigned the task of
> > integrating eXist into Cocoon. After finishing all work for being
able
> 
> Is there any reason not to use (and patch, if that's the case) the
> current XML:DB stuff? AFAIK eXist supports the XML:DB API, so I don't
> see why have a custom Generator or (better, as Vadim suggested) a
> Source. I think it's quite bad that the two major OSS XML databases
> don't share a common API.
> 
> Ciao,


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: Creating An eXist Generator for Cocoon

Posted by Gianugo Rabellino <gi...@apache.org>.
Christofer Dutz wrote:
> 
> A few weeks ago I joined the group developing the eXist Xml-Database and 
> because of my experience with Cocoon I was assigned the task of 
> integrating eXist into Cocoon. After finishing all work for being able 

Is there any reason not to use (and patch, if that's the case) the 
current XML:DB stuff? AFAIK eXist supports the XML:DB API, so I don't 
see why have a custom Generator or (better, as Vadim suggested) a 
Source. I think it's quite bad that the two major OSS XML databases 
don't share a common API.

Ciao,

-- 
Gianugo



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: Creating An eXist Generator for Cocoon

Posted by Vadim Gritsenko <va...@verizon.net>.
Consider implementing not a generator, but a Source. Source have more
wider application area than generators.

Regarding your question, take a look at the XMLDBSource and
XMLDBGenerator - this is the connector to the any XML:DB compliant
database, you can use this as a starting point.

> When accessing this page I get a :
> UnnamedSelector: ComponentSelector could not find the component for
hint: exist
> From Cocoon.

Stacktrace provide also lots of information for a developer. Send in
message with the stacktrace next time. Also, take a look at the Cocoon
logs.

Vadim

-----Original Message-----
From: Christofer Dutz [mailto:dutz@c-ware.de] 
Sent: Tuesday, February 12, 2002 6:17 PM
To: cocoon-dev@xml.apache.org
Subject: Creating An eXist Generator for Cocoon

Hi, 
 
I am quite new to this side of the Cocoon project ( usually I was just
using Cocoon ), so please be patient.
 
A few weeks ago I joined the group developing the eXist Xml-Database and
because of my experience with Cocoon I was assigned the task of
integrating eXist into Cocoon. After finishing all work for being able
to start/stop/access eXist locally ( not over HTTP or RPC ), I have
started creating a new Generator called
“org.apache.cocoon.generation.ExistGenerator” ( If I am not allowed to
place the class there … please tell me. I just thought that it belonged
there ). 
After finishing a first prototype of the generator, I wanted to test it.
So I added following part to the Sitemap where the generators are
defined :
<map:generator name="exist"
src="org.apache.cocoon.generation.ExistGenerator"/> 
This didn’t seem to cause any problems … so I added a simple match in
the standard sample pipeline ( I am using a totally fresh installation
of Tomcat and Cocoon 2 ) “
<map:match pattern="exist">
       <map:generate type="exist" src="xPathExpression"/>
       <map:serialize/>
</map:match>
When accessing this page I get a :
UnnamedSelector: ComponentSelector could not find the component for
hint: exist
>From Cocoon. 
Does this mean that the class couldn’t be found, or could there be a
problem with the class itself ? 
My Generator extends the AbstractGenerator class. I hope this is the
right way. If not, could someone please send me a small tutorial with
the steps needed to create a new Generator ? 
 
Thanx in advance, 
 
Christofer Dutz
C-Ware IT-Service
Inh. Christofer Dutz
Goethestr. 18
64372 Ober-Ramstadt
www.c-ware.de
 


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org