You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sébastien Geindre <se...@meteo.fr> on 2007/02/27 16:59:05 UTC
access eXist Db from Cocoon with XQueryTransformer
Hi all and sorry for cross-posting...
i need to execute a xquery on the eXist cocoon embedded database, in a
cocoon pipe.
httpPost => getRequest post which is full XML
=> parse XML data to get future xquery request parameters
=> execute xquery
=> get the xml return back
=> transform it in right format => XML reply
XQueryTransformer should be what i nedd, but it does not seem to ba part
of the distribution...
Is there another way to do that ?
thanks.
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre@meteo.fr
05 61 07 84 93
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: Creating pipeline with aggregate?
Posted by "Schmitz, Jeffrey A" <Je...@boeing.com>.
THANK YOU, One of those cases where I could have looked at it all day and not seen it.
Jeff
-----Original Message-----
From: Grzegorz Kossakowski [mailto:grek@tuffmail.com]
Sent: Tuesday, February 27, 2007 11:10 AM
To: users@cocoon.apache.org
Subject: Re: Creating pipeline with aggregate?
Schmitz, Jeffrey A napisał(a):
> Hello,
> I'm trying to create a pipeline with an aggregate, and I must be
> doing something wrong in the syntax that I just can't see. Below are
> my sitemap definitions, and when the second map:part isn't specified
> in the map:aggregate element, everything works fine, but simply adding
> the second part:
>
> <map:part src="cocoon:/ReadDiagMLModel/{1}" strip-root="true"/>
>
> Causes me to get the following error:
>
> Message: Resource Not Found
> Description: The requested resource "/cocoon/owlTrans/DiagMLIn/PV"
> could not be found
> Sender: org.apache.cocoon.servlet.CocoonServlet
> Source: Cocoon Servlet
>
> Why would adding the second map:part element cause the "DiagMLIn/*"
> resource not to be found at all?
>
> <map:match pattern="ReadDiagMLModel/*">
> <map:generate src="../../../NewModel.owl"/>
> </map:match>
Does missing serializer confuses the Cocoon badly? :)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Installing
Posted by Bertrand Delacretaz <bd...@apache.org>.
On 2/27/07, Schmitz, Jeffrey A <Je...@boeing.com> wrote:
> ...it doesn't like the space in my
> JAVA_HOME environment variable path(C:\Program Files\Java\jdk1.5.0_07).
> How can I get around this?...
Scrap the space, install java elsewhere...many java and cross-platform
programs will act funnily when confronted with paths including spaces,
it's much safer to stick to ASCII pathnames without spaces.
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: Installing
Posted by Marc Driftmeyer <md...@yahoo.com>.
when you're at the C:\>java -version
does this return back the version or is their a console error?
Suggestion: Update to jdk1.5.0_11
http://java.sun.com/j2se/1.5.0/install-windows.html
To avoid space issues I'd create a separate Java folder under C:\>Java
and reference your path variables from there that doesn't need to parse
%20 spaces.
- Marc
--- "Schmitz, Jeffrey A" <Je...@boeing.com> wrote:
> OK, I got past that problem, but now it doesn't like the space in my
> JAVA_HOME environment variable path(C:\Program
> Files\Java\jdk1.5.0_07).
> How can I get around this?
>
> Thanks,
> Jeff
>
> -----Original Message-----
> From: Schmitz, Jeffrey A
> Sent: Tuesday, February 27, 2007 4:28 PM
> To: users@cocoon.apache.org
> Subject: Installing
>
> OK, I tried following the "Don't worry - this is really easy if you
> follow the instructions in the INSTALL.txt file" (see below) process
> to
> build the latest version of Cocoon on Windows XP. However, when I
> get
> to step three below, I don't know where to execute the "build"
> command
> from. I tried from the cocoon directory, but just get an
> unrecognized
> command error. What do I need to do to build Cocoon?
>
> Thanks,
> Jeff
>
> 1) Unpack the distribution
>
> Obviously you've done this already, but if you got errors when
> unpacking
> the archive with tar, you might need to use gnutar instead. Our
> archives
> contain long paths and filenames which cause problems with some
> versions
> of the tar command.
>
> 2) Set your JAVA_HOME environment
>
> You have to set your JAVA_HOME environment to point to the root
> directory of
> the Java Virtual Machine (JDK 1.3.x or later) installed on your
> machine.
>
> To do this simply type:
>
> [unix] JAVA_HOME=/path/to/java/
> [win32] SET JAVA_HOME=c:\path\to\java
>
> your mileage may vary depending on your shell, but you know how to
> setup
> environments, right?
>
> If you're using JDK 1.3.x, you have to exclude the JCR block before
> building
> Cocoon. Have a look at the "Choosing the blocks" section below on
> how
> to
> exculude a block. Please note that some samples require JDK 1.4 or
> above.
>
> 3) Build Cocoon by typing "build" or "./build.sh"
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
____________________________________________________________________________________
Finding fabulous fares is fun.
Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains.
http://farechase.yahoo.com/promo-generic-14795097
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: Installing
Posted by "Schmitz, Jeffrey A" <Je...@boeing.com>.
OK, I got past that problem, but now it doesn't like the space in my
JAVA_HOME environment variable path(C:\Program Files\Java\jdk1.5.0_07).
How can I get around this?
Thanks,
Jeff
-----Original Message-----
From: Schmitz, Jeffrey A
Sent: Tuesday, February 27, 2007 4:28 PM
To: users@cocoon.apache.org
Subject: Installing
OK, I tried following the "Don't worry - this is really easy if you
follow the instructions in the INSTALL.txt file" (see below) process to
build the latest version of Cocoon on Windows XP. However, when I get
to step three below, I don't know where to execute the "build" command
from. I tried from the cocoon directory, but just get an unrecognized
command error. What do I need to do to build Cocoon?
Thanks,
Jeff
1) Unpack the distribution
Obviously you've done this already, but if you got errors when
unpacking
the archive with tar, you might need to use gnutar instead. Our
archives
contain long paths and filenames which cause problems with some
versions
of the tar command.
2) Set your JAVA_HOME environment
You have to set your JAVA_HOME environment to point to the root
directory of
the Java Virtual Machine (JDK 1.3.x or later) installed on your
machine.
To do this simply type:
[unix] JAVA_HOME=/path/to/java/
[win32] SET JAVA_HOME=c:\path\to\java
your mileage may vary depending on your shell, but you know how to
setup
environments, right?
If you're using JDK 1.3.x, you have to exclude the JCR block before
building
Cocoon. Have a look at the "Choosing the blocks" section below on how
to
exculude a block. Please note that some samples require JDK 1.4 or
above.
3) Build Cocoon by typing "build" or "./build.sh"
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Installing
Posted by "Schmitz, Jeffrey A" <Je...@boeing.com>.
OK, I tried following the "Don't worry - this is really easy if you
follow the instructions in the INSTALL.txt file" (see below) process to
build the latest version of Cocoon on Windows XP. However, when I get
to step three below, I don't know where to execute the "build" command
from. I tried from the cocoon directory, but just get an unrecognized
command error. What do I need to do to build Cocoon?
Thanks,
Jeff
1) Unpack the distribution
Obviously you've done this already, but if you got errors when
unpacking
the archive with tar, you might need to use gnutar instead. Our
archives
contain long paths and filenames which cause problems with some
versions
of the tar command.
2) Set your JAVA_HOME environment
You have to set your JAVA_HOME environment to point to the root
directory of
the Java Virtual Machine (JDK 1.3.x or later) installed on your
machine.
To do this simply type:
[unix] JAVA_HOME=/path/to/java/
[win32] SET JAVA_HOME=c:\path\to\java
your mileage may vary depending on your shell, but you know how to
setup
environments, right?
If you're using JDK 1.3.x, you have to exclude the JCR block before
building
Cocoon. Have a look at the "Choosing the blocks" section below on how
to
exculude a block. Please note that some samples require JDK 1.4 or
above.
3) Build Cocoon by typing "build" or "./build.sh"
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Creating pipeline with aggregate?
Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Schmitz, Jeffrey A napisał(a):
> Hello,
> I'm trying to create a pipeline with an aggregate, and I must be
> doing something wrong in the syntax that I just can't see. Below are my
> sitemap definitions, and when the second map:part isn't specified in the
> map:aggregate element, everything works fine, but simply adding the
> second part:
>
> <map:part src="cocoon:/ReadDiagMLModel/{1}" strip-root="true"/>
>
> Causes me to get the following error:
>
> Message: Resource Not Found
> Description: The requested resource "/cocoon/owlTrans/DiagMLIn/PV"
> could not be found
> Sender: org.apache.cocoon.servlet.CocoonServlet
> Source: Cocoon Servlet
>
> Why would adding the second map:part element cause the "DiagMLIn/*"
> resource not to be found at all?
>
> <map:match pattern="ReadDiagMLModel/*">
> <map:generate src="../../../NewModel.owl"/>
> </map:match>
Does missing serializer confuses the Cocoon badly? :)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Creating pipeline with aggregate?
Posted by "Schmitz, Jeffrey A" <Je...@boeing.com>.
Hello,
I'm trying to create a pipeline with an aggregate, and I must be
doing something wrong in the syntax that I just can't see. Below are my
sitemap definitions, and when the second map:part isn't specified in the
map:aggregate element, everything works fine, but simply adding the
second part:
<map:part src="cocoon:/ReadDiagMLModel/{1}" strip-root="true"/>
Causes me to get the following error:
Message: Resource Not Found
Description: The requested resource "/cocoon/owlTrans/DiagMLIn/PV"
could not be found
Sender: org.apache.cocoon.servlet.CocoonServlet
Source: Cocoon Servlet
Why would adding the second map:part element cause the "DiagMLIn/*"
resource not to be found at all?
<map:pipeline internal-only="true">
<!-- Define parts of aggregate pipeline for importing DiagML Model
-->
<map:match pattern="DiagMLImport/*" >
<map:generate type="serverpages" src="DiagMLImport.xsp" >
<map:parameter name="baseFilename" value="{1}"/>
</map:generate>
<map:serialize type="xml"/>
</map:match>
<map:match pattern="ReadDiagMLModel/*">
<map:generate src="../../../NewModel.owl"/>
</map:match>
</map:pipeline>
<map:pipeline type="noncaching">
<map:match pattern="DiagMLIn/*">
<map:aggregate element="model">
<map:part src="cocoon:/DiagMLImport/{1}"/>
<map:part src="cocoon:/ReadDiagMLModel/{1}"/>
</map:aggregate>
<map:transform src="processbNodes.xsl"/>
<map:transform src="updateRefs.xsl"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
-------- When like below it works fine ---------
<map:pipeline type="noncaching">
<map:match pattern="DiagMLIn/*">
<map:aggregate element="model">
<map:part src="cocoon:/DiagMLImport/{1}"/>
</map:aggregate>
<map:transform src="processbNodes.xsl"/>
<map:transform src="updateRefs.xsl"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: access eXist Db from Cocoon with XQueryTransformer
Posted by thomason <th...@physio1.utmem.edu>.
on 3/2/07 6:52 AM, Sébastien Geindre at sebastien.geindre@meteo.fr wrote:
> a custon generator is a better solution than use the XQueryTransformer +
> eXist module extension on JTS api ?
Don't know (the particulars of your application for quick proof-of-concept
vs. production performance). I suspect the depth of your research into the
problem makes you the authority in this area. Sorry not to be of more help!
Don
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: access eXist Db from Cocoon with XQueryTransformer
Posted by Sébastien Geindre <se...@meteo.fr>.
Donald Thomason a écrit :
> On Fri, 02 Mar 2007 10:27:43 +0100
> Sébastien Geindre <se...@meteo.fr> wrote:
>
>> At first, i intend to use JTS in XQuery function which
>> could call java function, implemented with the JTS API.
>> But performance could be a problem...
>>
>> In fact i'd like to do spatial query on XML database....
>> Cocoon handles XML post request, then requests the eXists
>> database by XQuery (extension with API JTS), and then
>> format the XML return...
>>
>> Any opinion about kind of architecture ??
>>
>
> Sébastien,
> I have not explored such a model before, so I can't be
> of more help. A custom generator may be an option, as well,
> though I know you were looking for a quick solution.
> Love to hear about your ultimate solution.
> Don
>
>
a custon generator is a better solution than use the XQueryTransformer +
eXist module extension on JTS api ?
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre@meteo.fr
05 61 07 84 93
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: access eXist Db from Cocoon with XQueryTransformer
Posted by Donald Thomason <th...@physio1.utmem.edu>.
On Fri, 02 Mar 2007 10:27:43 +0100
Sébastien Geindre <se...@meteo.fr> wrote:
>At first, i intend to use JTS in XQuery function which
>could call java function, implemented with the JTS API.
>But performance could be a problem...
>
>In fact i'd like to do spatial query on XML database....
>Cocoon handles XML post request, then requests the eXists
>database by XQuery (extension with API JTS), and then
>format the XML return...
>
>Any opinion about kind of architecture ??
Sébastien,
I have not explored such a model before, so I can't be
of more help. A custom generator may be an option, as well,
though I know you were looking for a quick solution.
Love to hear about your ultimate solution.
Don
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: access eXist Db from Cocoon with XQueryTransformer
Posted by Sébastien Geindre <se...@meteo.fr>.
> Sorry for misunderstanding. The XQueryTransformer code was posted by Ben
> Anderson
> <http://www.mail-archive.com/users@cocoon.apache.org/msg24913.html>.
>
Thanks, i am already on it...
> The xml in the POST is no problem, but the JTS suggests the possibility of a
> flow solution (with the org.xmldb.api.DatabaseManager and
> org.xmldb.api.base.Collection interfaces).
>
At first, i intend to use JTS in XQuery function which could call java
function, implemented with the JTS API.
But performance could be a problem...
In fact i'd like to do spatial query on XML database....
Cocoon handles XML post request, then requests the eXists database by
XQuery (extension with API JTS), and then format the XML return...
Any opinion about kind of architecture ??
(It is just a proof of concept, not intended to be on production...)
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre@meteo.fr
05 61 07 84 93
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: access eXist Db from Cocoon with XQueryTransformer
Posted by thomason <th...@physio1.utmem.edu>.
on 3/1/07 10:16 AM, Sébastien Geindre at sebastien.geindre@meteo.fr wrote:
> thomason a écrit :
>> on 2/27/07 9:59 AM, Sébastien Geindre at sebastien.geindre@meteo.fr wrote:
>>
>>> i need to execute a xquery on the eXist cocoon embedded database, in a
>>> cocoon pipe.
>>>
>>
>>
> Thanks for your answer, but in your case, your db is external, so REST
> maybe the right way.
>
> in mine, the db is embedded in cocoon, and the xquery are more
> complicated (call to external function in java using JTS...) and the
> xqueries needs parameters setted in the xml post...
> That's why i need a xqueryTransformer...
Sorry for misunderstanding. The XQueryTransformer code was posted by Ben
Anderson
<http://www.mail-archive.com/users@cocoon.apache.org/msg24913.html>.
The xml in the POST is no problem, but the JTS suggests the possibility of a
flow solution (with the org.xmldb.api.DatabaseManager and
org.xmldb.api.base.Collection interfaces).
Don
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: access eXist Db from Cocoon with XQueryTransformer
Posted by Sébastien Geindre <se...@meteo.fr>.
thomason a écrit :
> on 2/27/07 9:59 AM, Sébastien Geindre at sebastien.geindre@meteo.fr wrote:
>
>> i need to execute a xquery on the eXist cocoon embedded database, in a
>> cocoon pipe.
>>
>
>
Thanks for your answer, but in your case, your db is external, so REST
maybe the right way.
in mine, the db is embedded in cocoon, and the xquery are more
complicated (call to external function in java using JTS...) and the
xqueries needs parameters setted in the xml post...
That's why i need a xqueryTransformer...
> e.g., from one of my apps (all on one line, gasp):
> <map:generate
> src="http://{global:db-server}/rest/{global:offering-collection}/{1}.xml?_ho
> wmany=-1&_query=declare namespace
> util='http://exist-db.org/xquery/util'; declare namespace
> xmldb='http://exist-db.org/xquery/xmldb'; for $item in //Term return
> (xmldb:last-modified('/db/offerings',
> util:document-name($item)),/Root/ProgramName, $item)" />
>
> Also,
> <map:generate
> src="http://{global:db-server}/rest/{global:program-collection}?_howmany=-1&
> amp;_query=/Root/ProgramName|/Root/ProgramAbbrev|/Root/ProgramDescription|//
> Number|//Title|//Status|//Director/DName" />
>
> Note that I run eXist as a separate app, rather than embedded, for
> independent upgrades of cocoon and eXist.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre@meteo.fr
05 61 07 84 93
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: access eXist Db from Cocoon with XQueryTransformer
Posted by thomason <th...@physio1.utmem.edu>.
on 2/27/07 9:59 AM, Sébastien Geindre at sebastien.geindre@meteo.fr wrote:
> i need to execute a xquery on the eXist cocoon embedded database, in a
> cocoon pipe.
e.g., from one of my apps (all on one line, gasp):
<map:generate
src="http://{global:db-server}/rest/{global:offering-collection}/{1}.xml?_ho
wmany=-1&_query=declare namespace
util='http://exist-db.org/xquery/util'; declare namespace
xmldb='http://exist-db.org/xquery/xmldb'; for $item in //Term return
(xmldb:last-modified('/db/offerings',
util:document-name($item)),/Root/ProgramName, $item)" />
Also,
<map:generate
src="http://{global:db-server}/rest/{global:program-collection}?_howmany=-1&
amp;_query=/Root/ProgramName|/Root/ProgramAbbrev|/Root/ProgramDescription|//
Number|//Title|//Status|//Director/DName" />
Note that I run eXist as a separate app, rather than embedded, for
independent upgrades of cocoon and eXist.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org