You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Gianugo Rabellino <gi...@apache.org> on 2002/01/10 17:47:44 UTC

XPath-enabled DirectoryGenerator

Ciao,

in these days I wanted to test Eclipse (BTW, looks really great! too bad 
it does a bad job with indenting...) and I found the time to come up 
with an XPath-enabled DirectoryGenerator wich uses the X-pointerish 
syntax already implemented in the XMLDB stuff.

I find it really useful for my needs: the capability of having XPath 
queries in directory listings allows to get basic metadata from the XML 
documents that can be used for a number of things: as an example this 
might allow us to forget about book.xml for the Cocoon docs since the 
needed metadata would be pulled out from the files themselves.

Now, before committing it, I have some questions:

1. XPathProcessor has been migrated to Avalon (release, not scratchpad) 
and AFAIK the Avalon version is the only one that will be maintained in 
the future, so I have used 
org.apache.avalon.excalibur.xml.xpath.XPathProcessor in my code; 
cocoon.roles, however, still points to the Cocoon implementation so, if 
committed, my code would not work unless we change cocoon.roles too. I 
think that this shouldn't bring any problem.

The same goes for the parser abstraction (though I've used the Cocoon 
one since this component is still in Avalon's scratchpad): Carsten's 
last email was definitely appropriate :) What's the best thing to do? Of 
course I can change my code and switch to Cocoon's XPathProcessor, but I 
don't like this solution that much.

2. Scratchpad or not? I'd go for the first, see if it works and behaves 
and then move it to the stable tree with some docs.

3. It might be the case to add this feature not as another generator but 
as an option to DirectoryGenerator itself (and, why not to FileGenerator 
as well). Maybe it's only me finding this stuff really useful, but I 
have the feeling that it might save lots of butts in real life. With 
this I can have a poor man's CMS with WEBDAV support built in minutes :)

Ciao,

-- 
Gianugo Rabellino


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


RE: XIndice, Was: XPath-enabled DirectoryGenerator

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Gianugo Rabellino [mailto:gianugo@rabellino.it]
> 
> Vadim Gritsenko wrote:
> 
> >>From: Gianugo Rabellino [mailto:gianugo@apache.org]
> >>
> >><drooling>
> >>What is this XMLDBTrasformer thing? :) Whatever it is I want to have
a
> >>look at it! :))
> >></drooling>
> >>
> >
> >
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/scratchpad/src/org/apa
> >
che/cocoon/transformation/XMLDBTransformer.java?rev=1.1&content-type=tex
> > t/vnd.viewcvs-markup
> >
> > :)
> 
> 
> Gosh. I have to catch up with CVS mails and take a look at scratchpad
> more often: I hope it's only me, but I have the feeling that
scratchpad
> is becoming the Hall of Forgotten Code... anyway rest assured that I
> will take a deep look at it :)
> 

This particular code is not forgotten - it is just born :)
It needs XUpdate testing, and may be there are some namespacing issues -
that's why I do not push it into main trunk. But once it is stable...

Anyway, I would like to hear your comments on this transformer - I guess
you are an active xindice user :)

Vadim


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


Re: XIndice, Was: XPath-enabled DirectoryGenerator

Posted by Gianugo Rabellino <gi...@rabellino.it>.
Vadim Gritsenko wrote:

>>From: Gianugo Rabellino [mailto:gianugo@apache.org]
>>
>><drooling>
>>What is this XMLDBTrasformer thing? :) Whatever it is I want to have a
>>look at it! :))
>></drooling>
>>
> 
> http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/scratchpad/src/org/apa
> che/cocoon/transformation/XMLDBTransformer.java?rev=1.1&content-type=tex
> t/vnd.viewcvs-markup
> 
> :)


Gosh. I have to catch up with CVS mails and take a look at scratchpad 
more often: I hope it's only me, but I have the feeling that scratchpad 
is becoming the Hall of Forgotten Code... anyway rest assured that I 
will take a deep look at it :)


> xindice\java\src\org\apache\xindice\client\corba\db\APIException.java:
>   extends org.omg.CORBA.UserException
> 
> jre\lib\rt.jar:
>   org\omg\CORBA\UserException.class
> 
> I guess it's enough CORBA in the JRE to connect to xindice.


I hope I can find the time to check once again tomorrow. So long I just 
received some weird 405 responde from URLConnections, but I'll have a 
deeper look at it soon. I see you are using Resin, were you successful 
with Tomcat too?

Ciao,

-- 
Gianugo Rabellino


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


RE: XIndice, Was: XPath-enabled DirectoryGenerator

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Gianugo Rabellino [mailto:gianugo@apache.org]
> 
> <drooling>
> What is this XMLDBTrasformer thing? :) Whatever it is I want to have a
> look at it! :))
> </drooling>

http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/scratchpad/src/org/apa
che/cocoon/transformation/XMLDBTransformer.java?rev=1.1&content-type=tex
t/vnd.viewcvs-markup

:)

> > Note: My environment does not have anything specific: stock
> > resin/tomcat, empty jre/lib/ext, and empty environment.
> >
> > This should not work? Nobody told me client must have corba! ;)
> 
> OK, I'll give it another try... yet this sounds really strange to me.
> Why is then people (including me) receiving complaints from openorb
not
> being able to find its configuration? Anyway, I'll manage to find the
> time and give it another try. Thanks a lot for your infos:)

BTW:
xindice\java\src\org\apache\xindice\client\corba\db\APIException.java:
  extends org.omg.CORBA.UserException

jre\lib\rt.jar:
  org\omg\CORBA\UserException.class

I guess it's enough CORBA in the JRE to connect to xindice.

Vadim


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


Re: XIndice, Was: XPath-enabled DirectoryGenerator

Posted by Gianugo Rabellino <gi...@apache.org>.
Vadim Gritsenko wrote:

> Hm. My setup is:


<snip/>


> src="org.apache.cocoon.transformation.XMLDBTransformer">


<drooling>
What is this XMLDBTrasformer thing? :) Whatever it is I want to have a 
look at it! :))
</drooling>


<snip/>


> Note: My environment does not have anything specific: stock
> resin/tomcat, empty jre/lib/ext, and empty environment.
> 
> This should not work? Nobody told me client must have corba! ;)


OK, I'll give it another try... yet this sounds really strange to me. 
Why is then people (including me) receiving complaints from openorb not 
being able to find its configuration? Anyway, I'll manage to find the 
time and give it another try. Thanks a lot for your infos:)

Ciao,

-- 
Gianugo


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


XIndice, Was: XPath-enabled DirectoryGenerator

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Gianugo Rabellino [mailto:gianugo@apache.org]
> 
> Vadim Gritsenko wrote:
> 
> > Please, don't jump to conclusions: I run Cocoon as xindice client
with
> > xindice.jar and xmldb.jar: just 532968 bytes. If to include
full-blown
> > xindice... Yes, thanks to openorb, it's 2.5M :(
> 
> I'd really love to know how you managed to do it. There are
significant
> portions of Corba code all over the place in the client libraries and
> the client-server communication itself AFAIK is based on Corba. If I
try
> to remove openorb all I get is a bunch of errors. Please enlighten me
:)

Hm. My setup is:

1. cocoon/WEB-INF/lib:
   xindice.jar
   xmldb.jar

2. cocoon/cocoon.xconf#cocoon/source-handler/protocol:
   <driver type="xindice"
           class="org.apache.xindice.client.xmldb.DatabaseImpl"/>

3. cocoon/sitemap.xmap#map:sitemap/map:components/map:transformers:
   <map:transformer name="xmldb"
 
src="org.apache.cocoon.transformation.XMLDBTransformer">
     <driver>org.apache.xindice.client.xmldb.DatabaseImpl</driver>
     <base>xmldb:xindice:///db/test</base>
   </map:transformer>

4. cocoon/sitemap.xmap#map:sitemap/map:pipelines/map:pipeline:
   <map:match pattern="data-to-xmldb">
     <map:generate src="data.xml"/>
     <map:transform src="data-to-xmldb.xsl"/>
     <map:transform type="xmldb"/>
     <map:serialize type="xml"/>
   </map:match>
   <map:match pattern="xmldb/**">
     <map:match type="request" pattern="xpath">
       <map:generate src="xmldb:xindice:///db/{../1}#{1}"/>
       <map:serialize type="xml"/>
     </map:match>
     <map:generate src="xmldb:xindice:///db/{1}"/>
     <map:serialize type="xml"/>
   </map:match>

5. xindice/startup

6. resint/bin/httpd

7. http://localhost:8080/data-to-xmldb to bulk-load documents...

8. http://localhost:8080/xmldb/test/doc-id to access these documents...

Note: My environment does not have anything specific: stock
resin/tomcat, empty jre/lib/ext, and empty environment.

This should not work? Nobody told me client must have corba! ;)

Vadim



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


Re: XPath-enabled DirectoryGenerator

Posted by Gianugo Rabellino <gi...@apache.org>.
Vadim Gritsenko wrote:

> Please, don't jump to conclusions: I run Cocoon as xindice client with
> xindice.jar and xmldb.jar: just 532968 bytes. If to include full-blown
> xindice... Yes, thanks to openorb, it's 2.5M :(


I'd really love to know how you managed to do it. There are significant 
portions of Corba code all over the place in the client libraries and 
the client-server communication itself AFAIK is based on Corba. If I try 
to remove openorb all I get is a bunch of errors. Please enlighten me :)

Ciao,

-- 
Gianugo


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


Re: XPath-enabled DirectoryGenerator

Posted by Stefano Mazzocchi <st...@apache.org>.
Vadim Gritsenko wrote:
> 
> > From: Stefano Mazzocchi [mailto:stefano@apache.org]
> >
> > > > Should we start shipping XIndice with Cocoon? (I know Cocoon is
> already
> > > > big enough, but by making it easier to people to assemble things
> is the
> > > > way to go... at least until we have an apt-get-like thing for
> java.
> > > > still would like avalon to provide that... but it will take some
> time to
> > > > get people to agree on it :(
> > >
> > > I don't know... the required jars sum up to 2.5MB, it's quite a high
> > > load as of now, yet I see from the user list (both Cocoon and
> XIndice)
> > > that there is a growing interest in making the two work together.
> > > Besides, XIndice has a quirk today: the openorb jars must be
> installed
> > > in $CATALINA_HOME/common/lib.
> 
> Why do you need it there?

classloading problems.

> >
> > Aaaaaahhhh, that instantly makes it a -1!
> >
> 
> Please, don't jump to conclusions: I run Cocoon as xindice client with
> xindice.jar and xmldb.jar: just 532968 bytes. If to include full-blown
> xindice... Yes, thanks to openorb, it's 2.5M :(
> 
> May be add just xindice.jar for now?

If we can make it run out of the box, I'm +1 on including all we need,
even if this makes it 3Mb bigger.

But I remain -1 if classloading problems force you to move things around
and break the 'drop the war and forget' installation process.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



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


RE: XPath-enabled DirectoryGenerator

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
> 
> > > Should we start shipping XIndice with Cocoon? (I know Cocoon is
already
> > > big enough, but by making it easier to people to assemble things
is the
> > > way to go... at least until we have an apt-get-like thing for
java.
> > > still would like avalon to provide that... but it will take some
time to
> > > get people to agree on it :(
> >
> > I don't know... the required jars sum up to 2.5MB, it's quite a high
> > load as of now, yet I see from the user list (both Cocoon and
XIndice)
> > that there is a growing interest in making the two work together.
> > Besides, XIndice has a quirk today: the openorb jars must be
installed
> > in $CATALINA_HOME/common/lib.

Why do you need it there?

> 
> Aaaaaahhhh, that instantly makes it a -1!
> 

Please, don't jump to conclusions: I run Cocoon as xindice client with
xindice.jar and xmldb.jar: just 532968 bytes. If to include full-blown
xindice... Yes, thanks to openorb, it's 2.5M :(

May be add just xindice.jar for now?

Vadim



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


Re: XPath-enabled DirectoryGenerator

Posted by Stefano Mazzocchi <st...@apache.org>.
Gianugo Rabellino wrote:
> 
> (sorry for this late reply: my MX host changed its IP so I had huge
> email problems lately).

bah, telecom italia users :)

> Stefano Mazzocchi wrote:
> 
> >>with an XPath-enabled DirectoryGenerator wich uses the X-pointerish
> >>syntax already implemented in the XMLDB stuff.
> >>
> >
> > Way cool, I badly needed this for Forrest :)
> 
> Great, hope it will help you. :-)
> 
> >>1. XPathProcessor has been migrated to Avalon (release, not scratchpad)
> >>and AFAIK the Avalon version is the only one that will be maintained in
> >>the future, so I have used
> >>org.apache.avalon.excalibur.xml.xpath.XPathProcessor in my code;
> >>cocoon.roles, however, still points to the Cocoon implementation so, if
> >>committed, my code would not work unless we change cocoon.roles too. I
> >>think that this shouldn't bring any problem.
> >
> > I'm really agnostic to this. I fully trust Carsten's judgement.
> 
> I'll wait until tomorrow then I'll commit a first version using the
> cocoon XPath interface.
> 
> > Should we start shipping XIndice with Cocoon? (I know Cocoon is already
> > big enough, but by making it easier to people to assemble things is the
> > way to go... at least until we have an apt-get-like thing for java.
> > still would like avalon to provide that... but it will take some time to
> > get people to agree on it :(
> 
> I don't know... the required jars sum up to 2.5MB, it's quite a high
> load as of now, yet I see from the user list (both Cocoon and XIndice)
> that there is a growing interest in making the two work together.
> Besides, XIndice has a quirk today: the openorb jars must be installed
> in $CATALINA_HOME/common/lib.

Aaaaaahhhh, that instantly makes it a -1!

> I was starting to play with Kimbro's file system based RI: if I can make
> it work we will have a sample XML:DB running right inside of the dist
> like HSQLDB does at the price of a few KB. How about it?

That's better. Let us know when you have something that works cleanly.

>  >>3. It might be the case to add this feature not as another generator but
> 
> >>as an option to DirectoryGenerator itself (and, why not to FileGenerator
> > I'm sure users will drive the evolution of it.
> >
> > And count me as a user in this case :)
> 
> Gosh. Got to pull out the absbestos underwear then ;-P
> 
> Ciao,
> 
> --
> Gianugo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



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


Re: XPath-enabled DirectoryGenerator

Posted by Gianugo Rabellino <gi...@apache.org>.
(sorry for this late reply: my MX host changed its IP so I had huge 
email problems lately).

Stefano Mazzocchi wrote:

>>with an XPath-enabled DirectoryGenerator wich uses the X-pointerish
>>syntax already implemented in the XMLDB stuff.
>>
> 
> Way cool, I badly needed this for Forrest :)


Great, hope it will help you. :-)

>>1. XPathProcessor has been migrated to Avalon (release, not scratchpad)
>>and AFAIK the Avalon version is the only one that will be maintained in
>>the future, so I have used
>>org.apache.avalon.excalibur.xml.xpath.XPathProcessor in my code;
>>cocoon.roles, however, still points to the Cocoon implementation so, if
>>committed, my code would not work unless we change cocoon.roles too. I
>>think that this shouldn't bring any problem.
> 
> I'm really agnostic to this. I fully trust Carsten's judgement.


I'll wait until tomorrow then I'll commit a first version using the 
cocoon XPath interface.


> Should we start shipping XIndice with Cocoon? (I know Cocoon is already
> big enough, but by making it easier to people to assemble things is the
> way to go... at least until we have an apt-get-like thing for java.
> still would like avalon to provide that... but it will take some time to
> get people to agree on it :(


I don't know... the required jars sum up to 2.5MB, it's quite a high 
load as of now, yet I see from the user list (both Cocoon and XIndice) 
that there is a growing interest in making the two work together. 
Besides, XIndice has a quirk today: the openorb jars must be installed 
in $CATALINA_HOME/common/lib.

I was starting to play with Kimbro's file system based RI: if I can make 
it work we will have a sample XML:DB running right inside of the dist 
like HSQLDB does at the price of a few KB. How about it?

 >>3. It might be the case to add this feature not as another generator but

>>as an option to DirectoryGenerator itself (and, why not to FileGenerator
> I'm sure users will drive the evolution of it.
> 
> And count me as a user in this case :)


Gosh. Got to pull out the absbestos underwear then ;-P

Ciao,

-- 
Gianugo


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


Re: XPath-enabled DirectoryGenerator

Posted by Stefano Mazzocchi <st...@apache.org>.
Gianugo Rabellino wrote:
> 
> Ciao,
> 
> in these days I wanted to test Eclipse (BTW, looks really great! too bad
> it does a bad job with indenting...) and I found the time to come up
> with an XPath-enabled DirectoryGenerator wich uses the X-pointerish
> syntax already implemented in the XMLDB stuff.

Way cool, I badly needed this for Forrest :)

> I find it really useful for my needs: the capability of having XPath
> queries in directory listings allows to get basic metadata from the XML
> documents that can be used for a number of things: as an example this
> might allow us to forget about book.xml for the Cocoon docs since the
> needed metadata would be pulled out from the files themselves.
> 
> Now, before committing it, I have some questions:
> 
> 1. XPathProcessor has been migrated to Avalon (release, not scratchpad)
> and AFAIK the Avalon version is the only one that will be maintained in
> the future, so I have used
> org.apache.avalon.excalibur.xml.xpath.XPathProcessor in my code;
> cocoon.roles, however, still points to the Cocoon implementation so, if
> committed, my code would not work unless we change cocoon.roles too. I
> think that this shouldn't bring any problem.
> 
> The same goes for the parser abstraction (though I've used the Cocoon
> one since this component is still in Avalon's scratchpad): Carsten's
> last email was definitely appropriate :) What's the best thing to do? Of
> course I can change my code and switch to Cocoon's XPathProcessor, but I
> don't like this solution that much.

I'm really agnostic to this. I fully trust Carsten's judgement.

> 2. Scratchpad or not? I'd go for the first, see if it works and behaves
> and then move it to the stable tree with some docs.

Yeah, scratchpad first, then main trunk with lots of examples and docs
:)

Should we start shipping XIndice with Cocoon? (I know Cocoon is already
big enough, but by making it easier to people to assemble things is the
way to go... at least until we have an apt-get-like thing for java.
still would like avalon to provide that... but it will take some time to
get people to agree on it :(

> 3. It might be the case to add this feature not as another generator but
> as an option to DirectoryGenerator itself (and, why not to FileGenerator
> as well). Maybe it's only me finding this stuff really useful, but I
> have the feeling that it might save lots of butts in real life. With
> this I can have a poor man's CMS with WEBDAV support built in minutes :)

I'm sure users will drive the evolution of it.

And count me as a user in this case :)

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



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