Hi
Apologies if this is an oft-answered question, but despite some trawling of the mailing list archives and documentation I have not been able to find a simple answer. I have declared a .xpl pipeline with input and output parameters e.g. something like <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors"> <p:param type="input" name="foo"/> <p:param type="output" name="bar"/> ... </p:config> I would like to invoke this pipeline from Java code, binding some dynamic data to the input "foo" parameter, and reading the output in the "bar" parameter after the pipeline finishes execution. I'm using the source to the org.orbeon.oxf.main.OPS class as my starting point, but cannot figure out how to do the hook-up to the pipeline input and output parameters using the API. Any help much appreciated. Thanks Alan -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Alan,
I think that the java processor is for you. http://www.orbeon.com/ops/doc/processors-java http://www.orbeon.com/ops/goto-example/java Marc -----Message d'origine----- De : [hidden email] [mailto:[hidden email]] Envoyé : mardi 20 juin 2006 13:15 À : [hidden email] Objet : [ops-users] Newbie question: extending code in OPS.java to handle pipeline input and output Hi Apologies if this is an oft-answered question, but despite some trawling of the mailing list archives and documentation I have not been able to find a simple answer. I have declared a .xpl pipeline with input and output parameters e.g. something like <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors"> <p:param type="input" name="foo"/> <p:param type="output" name="bar"/> ... </p:config> I would like to invoke this pipeline from Java code, binding some dynamic data to the input "foo" parameter, and reading the output in the "bar" parameter after the pipeline finishes execution. I'm using the source to the org.orbeon.oxf.main.OPS class as my starting point, but cannot figure out how to do the hook-up to the pipeline input and output parameters using the API. Any help much appreciated. Thanks Alan -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by alan.boshier
Hi Marc
I might be missing something here, but that doesn't quite look like it fits what I'm looking to do. I want to initiate a pipeline execution myself from Java, not write a processor that slots into a pipeline. Indeed most of what I want is already in the source of the class org.orbeon.oxf.main.OPS, but it appears to be missing the hooks to bind runtime data to the pipeline input parameters, and extract the results held in the pipeline output parameters. Those are the missing bits I'm looking for. Alan -----Original Message----- From: [hidden email] [mailto:[hidden email]] Sent: 20 June 2006 13:21 To: [hidden email] Subject: RE: [ops-users] Newbie question: extending code in OPS.java to handle pipeline input and output Alan, I think that the java processor is for you. http://www.orbeon.com/ops/doc/processors-java http://www.orbeon.com/ops/goto-example/java Marc -----Message d'origine----- De : [hidden email] [mailto:[hidden email]] Envoyé : mardi 20 juin 2006 13:15 À : [hidden email] Objet : [ops-users] Newbie question: extending code in OPS.java to handle pipeline input and output Hi Apologies if this is an oft-answered question, but despite some trawling of the mailing list archives and documentation I have not been able to find a simple answer. I have declared a .xpl pipeline with input and output parameters e.g. something like <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:oxf="http://www.orbeon.com/oxf/processors"> <p:param type="input" name="foo"/> <p:param type="output" name="bar"/> ... </p:config> I would like to invoke this pipeline from Java code, binding some dynamic data to the input "foo" parameter, and reading the output in the "bar" parameter after the pipeline finishes execution. I'm using the source to the org.orbeon.oxf.main.OPS class as my starting point, but cannot figure out how to do the hook-up to the pipeline input and output parameters using the API. Any help much appreciated. Thanks Alan -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Administrator
|
In reply to this post by alan.boshier
Alan,
PipelineEngine.executePipeline() and InitUtils.runProcessor() (the latter called by the implementation of the former) take a ProcessorDefinition object, which allows you to specify static inputs by name and URL. InitUtils uses lower-level APIs to create the processor, hook-up its inputs to the DOMGenerator or URLGenerator processors, and then runs: processor.reset(pipelineContext); processor.start(pipelineContext); This means that it doesn't support dynamic inputs or any outputs. To implement such support, you will have to dig deeper and use more such lower-level APIs. The ProcessorTest class, for example, used for unit tests, does something like this. You may want to look at this class for inspiration. Ideally, the higher-level Pipeline API would be extended to support this. -Erik [hidden email] wrote: > Hi > > Apologies if this is an oft-answered question, but despite some > trawling of the mailing list archives and documentation I have > not been able to find a simple answer. > > I have declared a .xpl pipeline with input and output parameters > e.g. something like > > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:oxf="http://www.orbeon.com/oxf/processors"> > > <p:param type="input" name="foo"/> > <p:param type="output" name="bar"/> > ... > </p:config> > > I would like to invoke this pipeline from Java code, binding > some dynamic data to the input "foo" parameter, and reading the > output in the "bar" parameter after the pipeline finishes execution. > > I'm using the source to the org.orbeon.oxf.main.OPS class as > my starting point, but cannot figure out how to do the hook-up > to the pipeline input and output parameters using the API. > > Any help much appreciated. > > Thanks > > Alan Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
In reply to this post by alan.boshier
Hi Erik
Thanks - that did the trick. I cannibalized the InitUtils.createProcess code in order to be able to do the bindings for the pipeline inputs and outputs. Regards, Alan -----Original Message----- From: Erik Bruchez [mailto:[hidden email]] On Behalf Of Erik Bruchez Sent: 20 June 2006 13:51 To: [hidden email] Subject: Re: [ops-users] Newbie question: extending code in OPS.java to handle pipeline input and output Alan, PipelineEngine.executePipeline() and InitUtils.runProcessor() (the latter called by the implementation of the former) take a ProcessorDefinition object, which allows you to specify static inputs by name and URL. InitUtils uses lower-level APIs to create the processor, hook-up its inputs to the DOMGenerator or URLGenerator processors, and then runs: processor.reset(pipelineContext); processor.start(pipelineContext); This means that it doesn't support dynamic inputs or any outputs. To implement such support, you will have to dig deeper and use more such lower-level APIs. The ProcessorTest class, for example, used for unit tests, does something like this. You may want to look at this class for inspiration. Ideally, the higher-level Pipeline API would be extended to support this. -Erik [hidden email] wrote: > Hi > > Apologies if this is an oft-answered question, but despite some > trawling of the mailing list archives and documentation I have > not been able to find a simple answer. > > I have declared a .xpl pipeline with input and output parameters > e.g. something like > > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:oxf="http://www.orbeon.com/oxf/processors"> > > <p:param type="input" name="foo"/> > <p:param type="output" name="bar"/> > ... > </p:config> > > I would like to invoke this pipeline from Java code, binding > some dynamic data to the input "foo" parameter, and reading the > output in the "bar" parameter after the pipeline finishes execution. > > I'm using the source to the org.orbeon.oxf.main.OPS class as > my starting point, but cannot figure out how to do the hook-up > to the pipeline input and output parameters using the API. > > Any help much appreciated. > > Thanks > > Alan Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Free forum by Nabble | Edit this page |