Click trigger run xslt/xslfo and output to pdf

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

Click trigger run xslt/xslfo and output to pdf

JohnBampton
Hello all,

I have my form with its model.  I want to add a button so that when clicked a pdf is created via and XSLT/XSL-FO transformation and it output in a new window.

Anyone got a code example for this?  Or any ideas at least?

I cannot find any documentation or example on this.  Why doesn't orbeon have an example.

Regards,

John.  
Reply | Threaded
Open this post in threaded view
|

Re: Click trigger run xslt/xslfo and output to pdf

JohnBampton
Can someone please help me!?  I know how to write XSLT/XSL-FO that is not my problem.

It is linking the form to the process.





JohnBampton wrote
Hello all,

I have my form with its model.  I want to add a button so that when clicked a pdf is created via and XSLT/XSL-FO transformation and it output in a new window.

Anyone got a code example for this?  Or any ideas at least?

I cannot find any documentation or example on this.  Why doesn't orbeon have an example.

Regards,

John.  
Reply | Threaded
Open this post in threaded view
|

Re: Click trigger run xslt/xslfo and output to pdf

JohnBampton
In reply to this post by JohnBampton
Come on people please help me.  I know how to write XSLT I just need the xforms code


JohnBampton wrote
Hello all,

I have my form with its model.  I want to add a button so that when clicked a pdf is created via and XSLT/XSL-FO transformation and it output in a new window.

Anyone got a code example for this?  Or any ideas at least?

I cannot find any documentation or example on this.  Why doesn't orbeon have an example.

Regards,

John.  
Reply | Threaded
Open this post in threaded view
|

Re: Re: Click trigger run xslt/xslfo and output to pdf

Hank Ratzesberger

As Bugs says, aint I a stinker.

John,

Do you have an xpl file that will run to create the pdf?
I think you will need this since I don't see how to do xslt
on an xforms instance (not a bad idea though!, actually
you can do this in Orbeon with xxforms:call-xpl)

If you have an xpl file that will do the work, you can use the
xforms load element. If you want the download to open the file
save dialog, look into the content-disposition header in the
http-serializer.

to it in the page-flow.xml file.
<xforms:trigger appearance="minimal">
  <xforms:label> <xforms:output value="'mylabel'" /> </xforms:label>
  <xforms:action ev:event="DOMActivate">
    <xforms:load resource="/myurl?parameters=sure" f:url-type="resource" xxforms:show-progress="false"/>
  </xforms:action>
</xforms:trigger>

HTH, let us know if otherwise,
Hank

Hank Ratzesberger
Institute for Crustal Studies

>
> Come on people please help me.  I know how to write XSLT I just need the
> xforms code
>
>
>
> JohnBampton wrote:
>>
>> Hello all,
>>
>> I have my form with its model.  I want to add a button so that when
>> clicked a pdf is created via and XSLT/XSL-FO transformation and it output
>> in a new window.
>>
>> Anyone got a code example for this?  Or any ideas at least?
>>
>> I cannot find any documentation or example on this.  Why doesn't orbeon
>> have an example.
>>
>> Regards,
>>
>> John.
>>
>
> --
> View this message in context: http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to-pdf-tp25130860p25182209.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Click trigger run xslt/xslfo and output to pdf

JohnBampton
Hi,

no i don't have an xpl file.  I don;t know anything about this.

Can you give me an example please


Regards,

John.

Hank Ratzesberger wrote
As Bugs says, aint I a stinker.

John,

Do you have an xpl file that will run to create the pdf?
I think you will need this since I don't see how to do xslt
on an xforms instance (not a bad idea though!, actually
you can do this in Orbeon with xxforms:call-xpl)

If you have an xpl file that will do the work, you can use the
xforms load element. If you want the download to open the file
save dialog, look into the content-disposition header in the
http-serializer.

to it in the page-flow.xml file.
<xforms:trigger appearance="minimal">
  <xforms:label> <xforms:output value="'mylabel'" /> </xforms:label>
  <xforms:action ev:event="DOMActivate">
    <xforms:load resource="/myurl?parameters=sure" f:url-type="resource" xxforms:show-progress="false"/>
  </xforms:action>
</xforms:trigger>

HTH, let us know if otherwise,
Hank

Hank Ratzesberger
Institute for Crustal Studies

>
> Come on people please help me.  I know how to write XSLT I just need the
> xforms code
>
>
>
> JohnBampton wrote:
>>
>> Hello all,
>>
>> I have my form with its model.  I want to add a button so that when
>> clicked a pdf is created via and XSLT/XSL-FO transformation and it output
>> in a new window.
>>
>> Anyone got a code example for this?  Or any ideas at least?
>>
>> I cannot find any documentation or example on this.  Why doesn't orbeon
>> have an example.
>>
>> Regards,
>>
>> John.
>>
>
> --
> View this message in context: http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to-pdf-tp25130860p25182209.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>




--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Click trigger run xslt/xslfo and output to pdf

Hank Ratzesberger

Hi John,

So, there are several technologies at work.  First is the
server-side XML pipelining language XPL, which is a W3C
submission (although the XProc, inspired by XPL, has momentum).

You will want to take a look at the Government forms example:

http://www.orbeon.com/ops/forms/

OK, it looks like the website has a problem tonight, but
nevertheless, this is where to start.

It has a pipeline (xpl) that produces the pdf, below. Notice
there is an "input" which is the xml you (most likely) POSTed.
Or perhaps you used GET with some parameters to identify the
XML.  This one does a submission, but yours could do an xslt.

<p:pipeline xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:oxf="http://www.orbeon.com/oxf/processors"
    xmlns:xforms="http://www.w3.org/2002/xforms">

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output"/>

    <!-- Execute REST submission -->
    <p:processor name="oxf:xforms-submission">
        <p:input name="submission">
            <xforms:submission serialization="none" method="get"
                               action="/exist/rest/db/orbeon/forms/{/*/form-id}/{/*/document-id}"/>
        </p:input>
        <p:input name="request" href="#instance"/>
        <p:output name="response" id="document"/>
    </p:processor>

    <!-- Produce PDF document -->
    <p:processor name="oxf:pdf-template">
        <p:input name="data" href="#document"/>
        <p:input name="model" href="#instance#xpointer(doc(concat('../forms/', /*/form-id, '/pdf-model.xml')))"/>
        <p:output name="data" ref="data"/>
    </p:processor>

</p:pipeline>


You match your xpl to a url with the page-flow.xml in the resources directory. e.g.

 <page path-info="/url/of/my/service" model="oxf:/path/to/my.xpl"/>

http://www.orbeon.com/ops/doc/reference-page-flow

Then, in your page, you use XForms and probably the load or trigger
elements, which were mentioned previously.

So, yes, lots of specifications and features, but probably a way to
get done what you need.  I hope that's a start.

--Hank




>
> Hi,
>
> no i don't have an xpl file.  I don;t know anything about this.
>
> Can you give me an example please
>
>
> Regards,
>
> John.
>
>
> Hank Ratzesberger wrote:
>>
>>
>> As Bugs says, aint I a stinker.
>>
>> John,
>>
>> Do you have an xpl file that will run to create the pdf?
>> I think you will need this since I don't see how to do xslt
>> on an xforms instance (not a bad idea though!, actually
>> you can do this in Orbeon with xxforms:call-xpl)
>>
>> If you have an xpl file that will do the work, you can use the
>> xforms load element. If you want the download to open the file
>> save dialog, look into the content-disposition header in the
>> http-serializer.
>>
>> to it in the page-flow.xml file.
>> <xforms:trigger appearance="minimal">
>>   <xforms:label> <xforms:output value="'mylabel'" /> </xforms:label>
>>   <xforms:action ev:event="DOMActivate">
>>     <xforms:load resource="/myurl?parameters=sure" f:url-type="resource"
>> xxforms:show-progress="false"/>
>>   </xforms:action>
>> </xforms:trigger>
>>
>> HTH, let us know if otherwise,
>> Hank
>>
>> Hank Ratzesberger
>> Institute for Crustal Studies
>>
>>>
>>> Come on people please help me.  I know how to write XSLT I just need the
>>> xforms code
>>>
>>>
>>>
>>> JohnBampton wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I have my form with its model.  I want to add a button so that when
>>>> clicked a pdf is created via and XSLT/XSL-FO transformation and it
>>>> output
>>>> in a new window.
>>>>
>>>> Anyone got a code example for this?  Or any ideas at least?
>>>>
>>>> I cannot find any documentation or example on this.  Why doesn't orbeon
>>>> have an example.
>>>>
>>>> Regards,
>>>>
>>>> John.
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to-pdf-tp25130860p25182209.html
>>> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to-pdf-tp25130860p25183373.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Click trigger run xslt/xslfo and output to pdf

JohnBampton
Hi Hank,
thanks for the quick reply.
Could you please give me an example of the pipeline with the xslt part in it?
Regards,
John.

Hank Ratzesberger wrote
Hi John,

So, there are several technologies at work.  First is the
server-side XML pipelining language XPL, which is a W3C
submission (although the XProc, inspired by XPL, has momentum).

You will want to take a look at the Government forms example:

http://www.orbeon.com/ops/forms/

OK, it looks like the website has a problem tonight, but
nevertheless, this is where to start.

It has a pipeline (xpl) that produces the pdf, below. Notice
there is an "input" which is the xml you (most likely) POSTed.
Or perhaps you used GET with some parameters to identify the
XML.  This one does a submission, but yours could do an xslt.

<p:pipeline xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:oxf="http://www.orbeon.com/oxf/processors"
    xmlns:xforms="http://www.w3.org/2002/xforms">

    <p:param name="instance" type="input"/>
    <p:param name="data" type="output"/>

   
    <p:processor name="oxf:xforms-submission">
        <p:input name="submission">
            <xforms:submission serialization="none" method="get"
                               action="/exist/rest/db/orbeon/forms/{/*/form-id}/{/*/document-id}"/>
        </p:input>
        <p:input name="request" href="#instance"/>
        <p:output name="response" id="document"/>
    </p:processor>

   
    <p:processor name="oxf:pdf-template">
        <p:input name="data" href="#document"/>
        <p:input name="model" href="#instance#xpointer(doc(concat('../forms/', /*/form-id, '/pdf-model.xml')))"/>
        <p:output name="data" ref="data"/>
    </p:processor>

</p:pipeline>


You match your xpl to a url with the page-flow.xml in the resources directory. e.g.

 <page path-info="/url/of/my/service" model="oxf:/path/to/my.xpl"/>

http://www.orbeon.com/ops/doc/reference-page-flow

Then, in your page, you use XForms and probably the load or trigger
elements, which were mentioned previously.

So, yes, lots of specifications and features, but probably a way to
get done what you need.  I hope that's a start.

--Hank




>
> Hi,
>
> no i don't have an xpl file.  I don;t know anything about this.
>
> Can you give me an example please
>
>
> Regards,
>
> John.
>
>
> Hank Ratzesberger wrote:
>>
>>
>> As Bugs says, aint I a stinker.
>>
>> John,
>>
>> Do you have an xpl file that will run to create the pdf?
>> I think you will need this since I don't see how to do xslt
>> on an xforms instance (not a bad idea though!, actually
>> you can do this in Orbeon with xxforms:call-xpl)
>>
>> If you have an xpl file that will do the work, you can use the
>> xforms load element. If you want the download to open the file
>> save dialog, look into the content-disposition header in the
>> http-serializer.
>>
>> to it in the page-flow.xml file.
>> <xforms:trigger appearance="minimal">
>>   <xforms:label> <xforms:output value="'mylabel'" /> </xforms:label>
>>   <xforms:action ev:event="DOMActivate">
>>     <xforms:load resource="/myurl?parameters=sure" f:url-type="resource"
>> xxforms:show-progress="false"/>
>>   </xforms:action>
>> </xforms:trigger>
>>
>> HTH, let us know if otherwise,
>> Hank
>>
>> Hank Ratzesberger
>> Institute for Crustal Studies
>>
>>>
>>> Come on people please help me.  I know how to write XSLT I just need the
>>> xforms code
>>>
>>>
>>>
>>> JohnBampton wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I have my form with its model.  I want to add a button so that when
>>>> clicked a pdf is created via and XSLT/XSL-FO transformation and it
>>>> output
>>>> in a new window.
>>>>
>>>> Anyone got a code example for this?  Or any ideas at least?
>>>>
>>>> I cannot find any documentation or example on this.  Why doesn't orbeon
>>>> have an example.
>>>>
>>>> Regards,
>>>>
>>>> John.
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to-pdf-tp25130860p25182209.html
>>> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the ops-users@ow2.org mailing
>> list.
>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
>> For general help: mailto:sympa@ow2.org?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to-pdf-tp25130860p25183373.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com.
>
>




--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Click trigger run xslt/xslfo and output to pdf

Hank Ratzesberger

John,

You mentioned XSLT earlier, and I presumed you needed to do some
transform before you make the pdf.  In any case, here is a
snippet, just a shell of what a REST style web service might
look like.  The xml-serializer is a simple way to serialize the
XML to http.

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

        <p:param name="instance" type="input"/>

        <p:processor name="oxf:xslt">
                <p:input name="config">
                        <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/ 
XSL/Transform">
                                <xsl:template match="/">
                                        <!-- do something -->
                                </xsl:template>
                        </xsl:stylesheet>
                </p:input>
                <p:input name="data" href="#instance"/>
                <p:output name="data" id="newdata"/>
        </p:processor>

        <p:processor name="oxf:xml-serializer">
                <p:input name="config">
                        <config>
                                <content-type>text/xml</content-type>
                        </config>
                </p:input>
                <p:input name="data" href="#newdata"/>
        </p:processor>

</p:config>

Morning consumed by a myriad of tasks and distractions....

If you had an outline of the program flow or what you wanted
to happen, I could suggest what XPL processors and what XForms
features are available to accomplish the steps.

Cheers,
Hank

On Aug 27, 2009, at 10:39 PM, JohnBampton wrote:

>
> Hi Hank,
> thanks for the quick reply.
> Could you please give me an example of the pipeline with the xslt  
> part in
> it?
> Regards,
> John.
>
>
> Hank Ratzesberger wrote:
>>
>>
>> Hi John,
>>
>> So, there are several technologies at work.  First is the
>> server-side XML pipelining language XPL, which is a W3C
>> submission (although the XProc, inspired by XPL, has momentum).
>>
>> You will want to take a look at the Government forms example:
>>
>> http://www.orbeon.com/ops/forms/
>>
>> OK, it looks like the website has a problem tonight, but
>> nevertheless, this is where to start.
>>
>> It has a pipeline (xpl) that produces the pdf, below. Notice
>> there is an "input" which is the xml you (most likely) POSTed.
>> Or perhaps you used GET with some parameters to identify the
>> XML.  This one does a submission, but yours could do an xslt.
>>
>> <p:pipeline xmlns:p="http://www.orbeon.com/oxf/pipeline"
>>     xmlns:oxf="http://www.orbeon.com/oxf/processors"
>>     xmlns:xforms="http://www.w3.org/2002/xforms">
>>
>>     <p:param name="instance" type="input"/>
>>     <p:param name="data" type="output"/>
>>
>>     <!-- Execute REST submission -->
>>     <p:processor name="oxf:xforms-submission">
>>         <p:input name="submission">
>>             <xforms:submission serialization="none" method="get"
>>
>> action="/exist/rest/db/orbeon/forms/{/*/form-id}/{/*/document-id}"/>
>>         </p:input>
>>         <p:input name="request" href="#instance"/>
>>         <p:output name="response" id="document"/>
>>     </p:processor>
>>
>>     <!-- Produce PDF document -->
>>     <p:processor name="oxf:pdf-template">
>>         <p:input name="data" href="#document"/>
>>         <p:input name="model"
>> href="#instance#xpointer(doc(concat('../forms/', /*/form-id,
>> '/pdf-model.xml')))"/>
>>         <p:output name="data" ref="data"/>
>>     </p:processor>
>>
>> </p:pipeline>
>>
>>
>> You match your xpl to a url with the page-flow.xml in the resources
>> directory. e.g.
>>
>>  <page path-info="/url/of/my/service" model="oxf:/path/to/my.xpl"/>
>>
>> http://www.orbeon.com/ops/doc/reference-page-flow
>>
>> Then, in your page, you use XForms and probably the load or trigger
>> elements, which were mentioned previously.
>>
>> So, yes, lots of specifications and features, but probably a way to
>> get done what you need.  I hope that's a start.
>>
>> --Hank
>>
>>
>>
>>
>>>
>>> Hi,
>>>
>>> no i don't have an xpl file.  I don;t know anything about this.
>>>
>>> Can you give me an example please
>>>
>>>
>>> Regards,
>>>
>>> John.
>>>
>>>
>>> Hank Ratzesberger wrote:
>>>>
>>>>
>>>> As Bugs says, aint I a stinker.
>>>>
>>>> John,
>>>>
>>>> Do you have an xpl file that will run to create the pdf?
>>>> I think you will need this since I don't see how to do xslt
>>>> on an xforms instance (not a bad idea though!, actually
>>>> you can do this in Orbeon with xxforms:call-xpl)
>>>>
>>>> If you have an xpl file that will do the work, you can use the
>>>> xforms load element. If you want the download to open the file
>>>> save dialog, look into the content-disposition header in the
>>>> http-serializer.
>>>>
>>>> to it in the page-flow.xml file.
>>>> <xforms:trigger appearance="minimal">
>>>>   <xforms:label> <xforms:output value="'mylabel'" /> </
>>>> xforms:label>
>>>>   <xforms:action ev:event="DOMActivate">
>>>>     <xforms:load resource="/myurl?parameters=sure" f:url-
>>>> type="resource"
>>>> xxforms:show-progress="false"/>
>>>>   </xforms:action>
>>>> </xforms:trigger>
>>>>
>>>> HTH, let us know if otherwise,
>>>> Hank
>>>>
>>>> Hank Ratzesberger
>>>> Institute for Crustal Studies
>>>>
>>>>>
>>>>> Come on people please help me.  I know how to write XSLT I just  
>>>>> need
>>>>> the
>>>>> xforms code
>>>>>
>>>>>
>>>>>
>>>>> JohnBampton wrote:
>>>>>>
>>>>>> Hello all,
>>>>>>
>>>>>> I have my form with its model.  I want to add a button so that  
>>>>>> when
>>>>>> clicked a pdf is created via and XSLT/XSL-FO transformation  
>>>>>> and it
>>>>>> output
>>>>>> in a new window.
>>>>>>
>>>>>> Anyone got a code example for this?  Or any ideas at least?
>>>>>>
>>>>>> I cannot find any documentation or example on this.  Why doesn't
>>>>>> orbeon
>>>>>> have an example.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> John.
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output- 
>>>>> to-pdf-tp25130860p25182209.html
>>>>> Sent from the ObjectWeb OPS - Users mailing list archive at  
>>>>> Nabble.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
>>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to- 
>>> pdf-tp25130860p25183373.html
>>> Sent from the ObjectWeb OPS - Users mailing list archive at  
>>> Nabble.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
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Click-trigger- 
> run-xslt-xslfo-and-output-to-pdf-tp25130860p25184315.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.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
> OW2 mailing lists service home page: http://www.ow2.org/wws
Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Click trigger run xslt/xslfo and output to pdf

JohnBampton
Hi Hank,

I want the xslt/xsl-fo to run to create the pdf, I already know how to program in xslt.  I just need to work out how to include it with xforms.  Does the snippet below do that?

Regards,

John.

Hank Ratzesberger wrote
John,

You mentioned XSLT earlier, and I presumed you needed to do some
transform before you make the pdf.  In any case, here is a
snippet, just a shell of what a REST style web service might
look like.  The xml-serializer is a simple way to serialize the
XML to http.

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

        <p:param name="instance" type="input"/>

        <p:processor name="oxf:xslt">
                <p:input name="config">
                        <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/ 
XSL/Transform">
                                <xsl:template match="/">
                                       
                                </xsl:template>
                        </xsl:stylesheet>
                </p:input>
                <p:input name="data" href="#instance"/>
                <p:output name="data" id="newdata"/>
        </p:processor>

        <p:processor name="oxf:xml-serializer">
                <p:input name="config">
                        <config>
                                <content-type>text/xml</content-type>
                        </config>
                </p:input>
                <p:input name="data" href="#newdata"/>
        </p:processor>

</p:config>

Morning consumed by a myriad of tasks and distractions....

If you had an outline of the program flow or what you wanted
to happen, I could suggest what XPL processors and what XForms
features are available to accomplish the steps.

Cheers,
Hank

On Aug 27, 2009, at 10:39 PM, JohnBampton wrote:

>
> Hi Hank,
> thanks for the quick reply.
> Could you please give me an example of the pipeline with the xslt  
> part in
> it?
> Regards,
> John.
>
>
> Hank Ratzesberger wrote:
>>
>>
>> Hi John,
>>
>> So, there are several technologies at work.  First is the
>> server-side XML pipelining language XPL, which is a W3C
>> submission (although the XProc, inspired by XPL, has momentum).
>>
>> You will want to take a look at the Government forms example:
>>
>> http://www.orbeon.com/ops/forms/
>>
>> OK, it looks like the website has a problem tonight, but
>> nevertheless, this is where to start.
>>
>> It has a pipeline (xpl) that produces the pdf, below. Notice
>> there is an "input" which is the xml you (most likely) POSTed.
>> Or perhaps you used GET with some parameters to identify the
>> XML.  This one does a submission, but yours could do an xslt.
>>
>> <p:pipeline xmlns:p="http://www.orbeon.com/oxf/pipeline"
>>     xmlns:oxf="http://www.orbeon.com/oxf/processors"
>>     xmlns:xforms="http://www.w3.org/2002/xforms">
>>
>>     <p:param name="instance" type="input"/>
>>     <p:param name="data" type="output"/>
>>
>>    
>>     <p:processor name="oxf:xforms-submission">
>>         <p:input name="submission">
>>             <xforms:submission serialization="none" method="get"
>>
>> action="/exist/rest/db/orbeon/forms/{/*/form-id}/{/*/document-id}"/>
>>         </p:input>
>>         <p:input name="request" href="#instance"/>
>>         <p:output name="response" id="document"/>
>>     </p:processor>
>>
>>    
>>     <p:processor name="oxf:pdf-template">
>>         <p:input name="data" href="#document"/>
>>         <p:input name="model"
>> href="#instance#xpointer(doc(concat('../forms/', /*/form-id,
>> '/pdf-model.xml')))"/>
>>         <p:output name="data" ref="data"/>
>>     </p:processor>
>>
>> </p:pipeline>
>>
>>
>> You match your xpl to a url with the page-flow.xml in the resources
>> directory. e.g.
>>
>>  <page path-info="/url/of/my/service" model="oxf:/path/to/my.xpl"/>
>>
>> http://www.orbeon.com/ops/doc/reference-page-flow
>>
>> Then, in your page, you use XForms and probably the load or trigger
>> elements, which were mentioned previously.
>>
>> So, yes, lots of specifications and features, but probably a way to
>> get done what you need.  I hope that's a start.
>>
>> --Hank
>>
>>
>>
>>
>>>
>>> Hi,
>>>
>>> no i don't have an xpl file.  I don;t know anything about this.
>>>
>>> Can you give me an example please
>>>
>>>
>>> Regards,
>>>
>>> John.
>>>
>>>
>>> Hank Ratzesberger wrote:
>>>>
>>>>
>>>> As Bugs says, aint I a stinker.
>>>>
>>>> John,
>>>>
>>>> Do you have an xpl file that will run to create the pdf?
>>>> I think you will need this since I don't see how to do xslt
>>>> on an xforms instance (not a bad idea though!, actually
>>>> you can do this in Orbeon with xxforms:call-xpl)
>>>>
>>>> If you have an xpl file that will do the work, you can use the
>>>> xforms load element. If you want the download to open the file
>>>> save dialog, look into the content-disposition header in the
>>>> http-serializer.
>>>>
>>>> to it in the page-flow.xml file.
>>>> <xforms:trigger appearance="minimal">
>>>>   <xforms:label> <xforms:output value="'mylabel'" /> </
>>>> xforms:label>
>>>>   <xforms:action ev:event="DOMActivate">
>>>>     <xforms:load resource="/myurl?parameters=sure" f:url-
>>>> type="resource"
>>>> xxforms:show-progress="false"/>
>>>>   </xforms:action>
>>>> </xforms:trigger>
>>>>
>>>> HTH, let us know if otherwise,
>>>> Hank
>>>>
>>>> Hank Ratzesberger
>>>> Institute for Crustal Studies
>>>>
>>>>>
>>>>> Come on people please help me.  I know how to write XSLT I just  
>>>>> need
>>>>> the
>>>>> xforms code
>>>>>
>>>>>
>>>>>
>>>>> JohnBampton wrote:
>>>>>>
>>>>>> Hello all,
>>>>>>
>>>>>> I have my form with its model.  I want to add a button so that  
>>>>>> when
>>>>>> clicked a pdf is created via and XSLT/XSL-FO transformation  
>>>>>> and it
>>>>>> output
>>>>>> in a new window.
>>>>>>
>>>>>> Anyone got a code example for this?  Or any ideas at least?
>>>>>>
>>>>>> I cannot find any documentation or example on this.  Why doesn't
>>>>>> orbeon
>>>>>> have an example.
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> John.
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output- 
>>>>> to-pdf-tp25130860p25182209.html
>>>>> Sent from the ObjectWeb OPS - Users mailing list archive at  
>>>>> Nabble.com.
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> You receive this message as a subscriber of the ops-users@ow2.org
>>>> mailing
>>>> list.
>>>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
>>>> For general help: mailto:sympa@ow2.org?subject=help
>>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to- 
>>> pdf-tp25130860p25183373.html
>>> Sent from the ObjectWeb OPS - Users mailing list archive at  
>>> Nabble.com.
>>>
>>>
>>
>>
>>
>>
>> --
>> You receive this message as a subscriber of the ops-users@ow2.org  
>> mailing
>> list.
>> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
>> For general help: mailto:sympa@ow2.org?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Click-trigger- 
> run-xslt-xslfo-and-output-to-pdf-tp25130860p25184315.html
> Sent from the ObjectWeb OPS - Users mailing list archive at  
> Nabble.com.
>
>
> --
> You receive this message as a subscriber of the ops-users@ow2.org  
> mailing list.
> To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
> For general help: mailto:sympa@ow2.org?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws

Hank Ratzesberger
NEES@UCSB
Institute for Crustal Studies,
University of California, Santa Barbara
805-893-8042







--
You receive this message as a subscriber of the ops-users@ow2.org mailing list.
To unsubscribe: mailto:ops-users-unsubscribe@ow2.org
For general help: mailto:sympa@ow2.org?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Click trigger run xslt/xslfo and output to pdf

Hank Ratzesberger

Hi John,



>
> Hi Hank,
>
> I want the xslt/xsl-fo to run to create the pdf, I already know how to
> program in xslt.  I just need to work out how to include it with xforms.
> Does the snippet below do that?

No, it is only an example.

From here, I can only provide general examples. The one
furthest below comes from the Government Forms example
and it does produce a pdf file, but in the context of
that application.

If you deploy the latest stable build, I expect that
example will work and you can copy from it or otherwise
use it as an example.

From here, we can only try to clear up the concepts of how
things work or possibly respond to bugs or questions to
specific code, especially if it can run in one of the
sandboxes.

Do you have a sample that we can try in the sandbox?

But we do believe OF is a great system and hope you
can have success using it.

Regards,
Hank

http://www.orbeon.com/ops/doc/processors-converters#d48e604


>
> Regards,
>
> John.
>
>
> Hank Ratzesberger wrote:
>>
>>
>> John,
>>
>> You mentioned XSLT earlier, and I presumed you needed to do some
>> transform before you make the pdf.  In any case, here is a
>> snippet, just a shell of what a REST style web service might
>> look like.  The xml-serializer is a simple way to serialize the
>> XML to http.
>>
>> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
>>  xmlns:oxf="http://www.orbeon.com/oxf/processors"
>>  xmlns:xforms="http://www.w3.org/2002/xforms">
>>
>> <p:param name="instance" type="input"/>
>>
>> <p:processor name="oxf:xslt">
>> <p:input name="config">
>> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/
>> XSL/Transform">
>> <xsl:template match="/">
>> <!-- do something -->
>> </xsl:template>
>> </xsl:stylesheet>
>> </p:input>
>> <p:input name="data" href="#instance"/>
>> <p:output name="data" id="newdata"/>
>> </p:processor>
>>
>> <p:processor name="oxf:xml-serializer">
>> <p:input name="config">
>> <config>
>> <content-type>text/xml</content-type>
>> </config>
>> </p:input>
>> <p:input name="data" href="#newdata"/>
>> </p:processor>
>>
>> </p:config>
>>
>> Morning consumed by a myriad of tasks and distractions....
>>
>> If you had an outline of the program flow or what you wanted
>> to happen, I could suggest what XPL processors and what XForms
>> features are available to accomplish the steps.
>>
>> Cheers,
>> Hank
>>
>> On Aug 27, 2009, at 10:39 PM, JohnBampton wrote:
>>
>>>
>>> Hi Hank,
>>> thanks for the quick reply.
>>> Could you please give me an example of the pipeline with the xslt
>>> part in
>>> it?
>>> Regards,
>>> John.
>>>
>>>
>>> Hank Ratzesberger wrote:
>>>>
>>>>
>>>> Hi John,
>>>>
>>>> So, there are several technologies at work.  First is the
>>>> server-side XML pipelining language XPL, which is a W3C
>>>> submission (although the XProc, inspired by XPL, has momentum).
>>>>
>>>> You will want to take a look at the Government forms example:
>>>>
>>>> http://www.orbeon.com/ops/forms/
>>>>
>>>> OK, it looks like the website has a problem tonight, but
>>>> nevertheless, this is where to start.
>>>>
>>>> It has a pipeline (xpl) that produces the pdf, below. Notice
>>>> there is an "input" which is the xml you (most likely) POSTed.
>>>> Or perhaps you used GET with some parameters to identify the
>>>> XML.  This one does a submission, but yours could do an xslt.
>>>>
>>>> <p:pipeline xmlns:p="http://www.orbeon.com/oxf/pipeline"
>>>>     xmlns:oxf="http://www.orbeon.com/oxf/processors"
>>>>     xmlns:xforms="http://www.w3.org/2002/xforms">
>>>>
>>>>     <p:param name="instance" type="input"/>
>>>>     <p:param name="data" type="output"/>
>>>>
>>>>     <!-- Execute REST submission -->
>>>>     <p:processor name="oxf:xforms-submission">
>>>>         <p:input name="submission">
>>>>             <xforms:submission serialization="none" method="get"
>>>>
>>>> action="/exist/rest/db/orbeon/forms/{/*/form-id}/{/*/document-id}"/>
>>>>         </p:input>
>>>>         <p:input name="request" href="#instance"/>
>>>>         <p:output name="response" id="document"/>
>>>>     </p:processor>
>>>>
>>>>     <!-- Produce PDF document -->
>>>>     <p:processor name="oxf:pdf-template">
>>>>         <p:input name="data" href="#document"/>
>>>>         <p:input name="model"
>>>> href="#instance#xpointer(doc(concat('../forms/', /*/form-id,
>>>> '/pdf-model.xml')))"/>
>>>>         <p:output name="data" ref="data"/>
>>>>     </p:processor>
>>>>
>>>> </p:pipeline>
>>>>
>>>>
>>>> You match your xpl to a url with the page-flow.xml in the resources
>>>> directory. e.g.
>>>>
>>>>  <page path-info="/url/of/my/service" model="oxf:/path/to/my.xpl"/>
>>>>
>>>> http://www.orbeon.com/ops/doc/reference-page-flow
>>>>
>>>> Then, in your page, you use XForms and probably the load or trigger
>>>> elements, which were mentioned previously.
>>>>
>>>> So, yes, lots of specifications and features, but probably a way to
>>>> get done what you need.  I hope that's a start.
>>>>
>>>> --Hank
>>>>
>>>>
>>>>
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> no i don't have an xpl file.  I don;t know anything about this.
>>>>>
>>>>> Can you give me an example please
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>> John.
>>>>>
>>>>>
>>>>> Hank Ratzesberger wrote:
>>>>>>
>>>>>>
>>>>>> As Bugs says, aint I a stinker.
>>>>>>
>>>>>> John,
>>>>>>
>>>>>> Do you have an xpl file that will run to create the pdf?
>>>>>> I think you will need this since I don't see how to do xslt
>>>>>> on an xforms instance (not a bad idea though!, actually
>>>>>> you can do this in Orbeon with xxforms:call-xpl)
>>>>>>
>>>>>> If you have an xpl file that will do the work, you can use the
>>>>>> xforms load element. If you want the download to open the file
>>>>>> save dialog, look into the content-disposition header in the
>>>>>> http-serializer.
>>>>>>
>>>>>> to it in the page-flow.xml file.
>>>>>> <xforms:trigger appearance="minimal">
>>>>>>   <xforms:label> <xforms:output value="'mylabel'" /> </
>>>>>> xforms:label>
>>>>>>   <xforms:action ev:event="DOMActivate">
>>>>>>     <xforms:load resource="/myurl?parameters=sure" f:url-
>>>>>> type="resource"
>>>>>> xxforms:show-progress="false"/>
>>>>>>   </xforms:action>
>>>>>> </xforms:trigger>
>>>>>>
>>>>>> HTH, let us know if otherwise,
>>>>>> Hank
>>>>>>
>>>>>> Hank Ratzesberger
>>>>>> Institute for Crustal Studies
>>>>>>
>>>>>>>
>>>>>>> Come on people please help me.  I know how to write XSLT I just
>>>>>>> need
>>>>>>> the
>>>>>>> xforms code
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> JohnBampton wrote:
>>>>>>>>
>>>>>>>> Hello all,
>>>>>>>>
>>>>>>>> I have my form with its model.  I want to add a button so that
>>>>>>>> when
>>>>>>>> clicked a pdf is created via and XSLT/XSL-FO transformation
>>>>>>>> and it
>>>>>>>> output
>>>>>>>> in a new window.
>>>>>>>>
>>>>>>>> Anyone got a code example for this?  Or any ideas at least?
>>>>>>>>
>>>>>>>> I cannot find any documentation or example on this.  Why doesn't
>>>>>>>> orbeon
>>>>>>>> have an example.
>>>>>>>>
>>>>>>>> Regards,
>>>>>>>>
>>>>>>>> John.
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-
>>>>>>> to-pdf-tp25130860p25182209.html
>>>>>>> Sent from the ObjectWeb OPS - Users mailing list archive at
>>>>>>> Nabble.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
>>>>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to-
>>>>> pdf-tp25130860p25183373.html
>>>>> Sent from the ObjectWeb OPS - Users mailing list archive at
>>>>> Nabble.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
>>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>>
>>>>
>>>
>>> --
>>> View this message in context: http://www.nabble.com/Click-trigger-
>>> run-xslt-xslfo-and-output-to-pdf-tp25130860p25184315.html
>>> Sent from the ObjectWeb OPS - Users mailing list archive at
>>> Nabble.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
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>> Hank Ratzesberger
>> NEES@UCSB
>> Institute for Crustal Studies,
>> University of California, Santa Barbara
>> 805-893-8042
>>
>>
>>
>>
>>
>>
>>
>> --
>> 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
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Click-trigger-run-xslt-xslfo-and-output-to-pdf-tp25130860p25199644.html
> Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.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
OW2 mailing lists service home page: http://www.ow2.org/wws