How to get output Data from my own java processor (i am new)

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

How to get output Data from my own java processor (i am new)

Xin-4
Hi All,

I am new here. It is very excited to work on XFrom stuff. Well, I have a
question, How can I get the output data from my own java processor.

pageflow:
    <page path-info="/ps/" model="models/getps.xpl"
        view="views/view.xsl"
default-submission="ps-default-submission.xml">
        <setvalue ref="/submission/first" parameter="first"/>
        <setvalue ref="/submission/count" parameter="count"/>
    </page>


model:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:oxf="http://www.orbeon.com/oxf/processors">

    <p:param type="input" name="instance"/>
    <p:param type="output" name="data"/>
   
    <p:processor name="oxf:java">
        <p:input name="config">
            <config sourcepath="../java" class="RequestFragment"/>
        </p:input>
        <p:input name="request" href="#instance"/>
        <p:output name="response" ref="data"/>
    </p:processor>

</p:config>

view:
    <xsl:template match="/">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <title>Current Time</title>
            </head>
            <body>
                <p>The time is now <xsl:value-of
select="current-dateTime()"/>!</p>
                <xsl:variable name="submission"
select="doc('input:instance')"/>
                <p>parameter, first = <xsl:value-of
select="$submission//first"/></p>
                <p>parameter, count = <xsl:value-of
select="$submission//count"/></p>
               
                *<p>output of java is: </p>*
              *  <xsl:copy-of select="doc('input:data')"/>*  
---------------> Here is the tricky? I can't find the answer from
documentation.
            </body>
        </html>
    </xsl:template>

Thanks a lot for your help! Any help will do! Or you can give me a
reference that has the answer.

Many thanks!
xin





--
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
Reply | Threaded
Open this post in threaded view
|

Re: How to get output Data from my own java processor (i am new)

Alessandro Vernet
Administrator
Xin,

On 9/5/07, Xin Chen <[hidden email]> wrote:
>               *  <xsl:copy-of select="doc('input:data')"/>*
> ---------------> Here is the tricky? I can't find the answer from
> documentation.

Here you should be able to just write <xsl:copy-of select="/*"/>. The
"data" output of your model is fed to the input of the view
stylesheet. You can also put a debug attribute on the <p:output
name="response" ref="data"/> in your model to check what the output of
your Java processor is.

I hope this helps,

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
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
Reply | Threaded
Open this post in threaded view
|

Re: How to get output Data from my own java processor (i am new)

Xin-4
Thanks Alessandro,

for the debug attribute, I tried and it didn't work. Could you show me how debug uses?

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:oxf="http://www.orbeon.com/oxf/processors">

    <p:param type="input" name="instance"/>
    <p:param type="output" name="data"/>
   
    <!-- Execute REST submission -->
    <p:processor name="oxf:java">
        <p:input name="config">
            <config sourcepath="../java" class="RequestFragment"/>
        </p:input>
        <p:input name="request" href="#instance"/>
        <p:output name="response" id="fragmentresponse"/>
    </p:processor>

    <!-- Write back original content -->
    <p:processor name="oxf:java">
        <p:input name="config">
            <config sourcepath="../java" class="InsertOriginalFragment"/>
        </p:input>
        <p:input name="request" href="#fragmentresponse"/>
        <p:output name="response" ref="data" debug="data"/>
    </p:processor>
</p:config>

Thanks a lot!
xin

Alessandro Vernet wrote:
Xin,

On 9/5/07, Xin Chen [hidden email] wrote:
  
              *  <xsl:copy-of select="doc('input:data')"/>*
---------------> Here is the tricky? I can't find the answer from
documentation.
    

Here you should be able to just write <xsl:copy-of select="/*"/>. The
"data" output of your model is fed to the input of the view
stylesheet. You can also put a debug attribute on the <p:output
name="response" ref="data"/> in your model to check what the output of
your Java processor is.

I hope this helps,

Alex
  

-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
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
Reply | Threaded
Open this post in threaded view
|

Re: How to get output Data from my own java processor (i am new)

Xin-4
One more question, if I have two param in the pipeline: say:
<p:param type="output" name="data1"/>
<p:param type="output" name="data2"/>

How do I get data1 or data2 from this pipeline?

Is there anything like doc('input:data1') that can be used?
Does W3C XPL have all these details?

Thanks a lot!
xin

Xin Chen wrote:

> Thanks Alessandro,
>
> for the debug attribute, I tried and it didn't work. Could you show me
> how debug uses?
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>     xmlns:oxf="http://www.orbeon.com/oxf/processors">
>
>     <p:param type="input" name="instance"/>
>     <p:param type="output" name="data"/>
>    
>     <!-- Execute REST submission -->
>     <p:processor name="oxf:java">
>         <p:input name="config">
>             <config sourcepath="../java" class="RequestFragment"/>
>         </p:input>
>         <p:input name="request" href="#instance"/>
>         <p:output name="response" id="fragmentresponse"/>
>     </p:processor>
>
>     <!-- Write back original content -->
>     <p:processor name="oxf:java">
>         <p:input name="config">
>             <config sourcepath="../java" class="InsertOriginalFragment"/>
>         </p:input>
>         <p:input name="request" href="#fragmentresponse"/>
>         <p:output name="response" ref="data" *debug="data"*/>
>     </p:processor>
> </p:config>
>
> Thanks a lot!
> xin
>
> Alessandro Vernet wrote:
>
>>Xin,
>>
>>On 9/5/07, Xin Chen <[hidden email]> wrote:
>>  
>>
>>>              *  <xsl:copy-of select="doc('input:data')"/>*
>>>---------------> Here is the tricky? I can't find the answer from
>>>documentation.
>>>    
>>>
>>
>>Here you should be able to just write <xsl:copy-of select="/*"/>. The
>>"data" output of your model is fed to the input of the view
>>stylesheet. You can also put a debug attribute on the <p:output
>>name="response" ref="data"/> in your model to check what the output of
>>your Java processor is.
>>
>>I hope this helps,
>>
>>Alex
>>  
>>
>>------------------------------------------------------------------------
>>
>>
>>--
>>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
>>  
>>
>
>------------------------------------------------------------------------
>
>
>--
>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
>  
>



--
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
Reply | Threaded
Open this post in threaded view
|

Re: How to get output Data from my own java processor (i am new)

Alessandro Vernet
Administrator
Xin,

On 9/13/07, Xin Chen <[hidden email]> wrote:
> One more question, if I have two param in the pipeline: say:
> <p:param type="output" name="data1"/>
> <p:param type="output" name="data2"/>
>
> How do I get data1 or data2 from this pipeline?
>
> Is there anything like doc('input:data1') that can be used?
> Does W3C XPL have all these details?

If the pipeline is used from the page flow, and you are reading the
output from the view, then you can only use the "instance" and "data"
output. If you have 2 documents you want to pass to the view, you need
to "aggregate" them into one document, as in:

<p:processor name="oxf:identity">
    <p:input name="data" href="aggregate('root', #data1, #data2)"/>
    <p:output name="data" ref="data"/>
</p:processor>

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
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
Reply | Threaded
Open this post in threaded view
|

Re: How to get output Data from my own java processor (i am new)

Xin-4
Hi Alex,

Thanks for that.

Aggregate is really useful in this case.
I also found out sometimes we can use xi:include as well:)

Cheers!
xin

Alessandro Vernet wrote:

>Xin,
>
>On 9/13/07, Xin Chen <[hidden email]> wrote:
>  
>
>>One more question, if I have two param in the pipeline: say:
>><p:param type="output" name="data1"/>
>><p:param type="output" name="data2"/>
>>
>>How do I get data1 or data2 from this pipeline?
>>
>>Is there anything like doc('input:data1') that can be used?
>>Does W3C XPL have all these details?
>>    
>>
>
>If the pipeline is used from the page flow, and you are reading the
>output from the view, then you can only use the "instance" and "data"
>output. If you have 2 documents you want to pass to the view, you need
>to "aggregate" them into one document, as in:
>
><p:processor name="oxf:identity">
>    <p:input name="data" href="aggregate('root', #data1, #data2)"/>
>    <p:output name="data" ref="data"/>
></p:processor>
>
>Alex
>  
>
>------------------------------------------------------------------------
>
>
>--
>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
>  
>



--
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