Cocoon: Flow parameters and XQueryGenerator

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Cocoon: Flow parameters and XQueryGenerator

Éric BURGHARD
Hi,

I've added the possibility to pass parameters (String, and DOM) to the
XQueryGenerator. That way you could write for example inside a flowscript

pipelineUtil.processToDOM("xquery/test.xq", {dom: dom})

and use the $dom variable inside your script. The patch is very simple just
add this to the end of declareParameters

ScriptableObject slot = (ScriptableObject)
FlowHelper.getContextObject(this.objectModel);
if (slot != null) {
        Object[] ids = slot.getAllIds();
        for (int i=0; i < ids.length; i++) {
                String id = (String) ids[i];
                service.declareVariable(id,
FlowHelper.unwrap(ScriptableObject.getProperty(slot, id)));
        }
}

There are some problems (i admit that this is quite quick and dirty).

1. Xpath expressions on Document parameters always return (). It works with
Node parameters.

2. hard disk seems to wake-up every second (read or write, during an endless
event loop i guess), even after the end of execution of the script. It
stops when i shut down the servlet.

Any idea ?


Regards.




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Cocoon: Flow parameters and XQueryGenerator

Jean-Baptiste Quenot-2
* BURGHARD Éric:

> I've added the possibility to  pass parameters (String, and DOM)
> to  the XQueryGenerator. That  way you  could write  for example
> inside a flowscript
>
> pipelineUtil.processToDOM("xquery/test.xq", {dom: dom})

Great!   Thank you,  have  you provided  eXist  developers with  a
patch?
--
Jean-Baptiste Quenot
Systèmes d'Information
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com/


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: Cocoon: Flow parameters and XQueryGenerator

BURGHARD Éric
>> I've added the possibility to  pass parameters (String, and DOM)
>> to  the XQueryGenerator. That  way you  could write  for example
>> inside a flowscript
>>
>> pipelineUtil.processToDOM("xquery/test.xq", {dom: dom})
>
> Great!   Thank you,  have  you provided  eXist  developers with  a
> patch?

What's the procedure for submitting patches ? The sourceforce tracker seems
to be unused for that.

I've attached the patch to this message.

Regards.

XQueryGenerator.java.patch (924 bytes) Download Attachment