cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Helmut Tammen <HTam...@htsystemloesungen.de>
Subject Re: [Portal, Woody, PDF]: PDF Output in new window
Date Sat, 17 Jan 2004 14:08:44 GMT
Joerg Heinicke schrieb:

> On 16.01.2004 16:11, Helmut Tammen wrote:
> 
>> I´ve developed a woody app that has some input fields on a form and a 
>> "Print" button. Pressing the button leads to a pipeline that generates 
>> PDF Output of the form fields.
>> This is o.k. as long as I run the woody application as standalone app. 
>> When I run it as coplet in the portal the pdf-output is rendered as 
>> text and displayed in the portal.
> 
> 
> If it's rendered as text something else is wrong (wrong mime-type for 
> example).
> 
>> Is there a way to tell the pdf-pipeline generating the output in a new 
>> window (javascript: window.open()) ?
> 
> 
> If the print button submits the form you just have to adapt the target 
> of the form: 
> http://selfhtml.teamone.de/html/formulare/definieren.htm#zielfenster 
> (@target on the form element). Woody supports this in the default styles 
> by copying all attributes from wi:form-template, i.e. just add it to 
> your from template wt:form-template.
> 
> A bit more complicated is the window.open() version as you have to 
> collect the form values yourself and it's not needed I think.
> 
> Joerg

I have to go a bit more into detail, I think.

Beside the input fields and the print-button there are also some more 
buttons at the form. These should not lead to a new window. They send 
the request to the portal resp. the actual continuation.
     <wt:form-template action="portal" method="POST">
Even the print-event should first go back to the continuation 
(flowscript) because the data of the input fields are first interpreted 
and the resulting data for the PDF is generated and saved as 
{continuation.id}.xml. After that has been done I call
   cocoon.sendPageAndWait(continuation.id + "-print-pipeline", {} );
to print the data (generate the PDF).
My print-pipeline looks like that:
      <map:match pattern="*-print-pipeline">
        <map:generate src="tmp/{1}.xml"/>
        <map:transform src="xsl/dienstreisen_fop.xsl"/>
        <map:serialize type="fo2pdf"/>
      </map:match>
It´s generating text output when using it in the portal. Otherwise PDF 
is generated.

Helmut


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message