You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Upayavira <uv...@upaya.co.uk> on 2003/12/22 12:36:45 UTC

Re: SourceWriting Transformer: how to redirect after writing files?

Gianluca Morello wrote:

> Hi all,
>  
> i have a pipeline i which i use a sourcewriting transformer to write a 
> xml file.
>  
> I wish to be able to redirect to a new page  after writing the file.
> After the writing of the file i have on the browser the output 
> message of the sourcewriting transformer.
>  
> There's a way to do that?
>  

Not sure if there is. I would suggest a couple of approaches:
1) Use XSLT to transform the result of the SWT into your desired page 
for the user (could include a <meta http-equiv="refresh"> style redirect)
2) Use the Flow processPipelineTo to write your source, and then send 
another page using sendPage

Regards, Upayavira



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


Re: SourceWriting Transformer: how to redirect after writing files?

Posted by Upayavira <uv...@upaya.co.uk>.
Gianluca Morello wrote:

>Sounds good,
>
>i'm calling the SWT pipeline from flow with redirectTo.
>I tried also processPipelineTo from flow, but i don't know how to setup a
>correct outputstream parameter.
>A null outputstream parameter is invalid. I don't need to process the output
>of the swt.
>
>Do you have any example how to use processPipelineTo?
>  
>
With a serious hack, try using:
processPipelineTo("URL", new 
Packages.org.apache.cocoon.bean.CocoonWrapper.NullOutputStream());

Only I wouldn't like to rely on the existence of that implementation of 
a null output stream. If you like this approach, you might want to make 
your own (it isn't hard).

Regards, Upayavira

>Thank you
>
>Gianluca
>
>
>
>
>
>
>----- Original Message -----
>From: "Upayavira" <uv...@upaya.co.uk>
>To: <us...@cocoon.apache.org>
>Sent: Monday, December 22, 2003 12:36 PM
>Subject: Re: SourceWriting Transformer: how to redirect after writing files?
>
>
>  
>
>>Gianluca Morello wrote:
>>
>>    
>>
>>>Hi all,
>>>
>>>i have a pipeline i which i use a sourcewriting transformer to write a
>>>xml file.
>>>
>>>I wish to be able to redirect to a new page  after writing the file.
>>>After the writing of the file i have on the browser the output
>>>message of the sourcewriting transformer.
>>>
>>>There's a way to do that?
>>>
>>>      
>>>
>>Not sure if there is. I would suggest a couple of approaches:
>>1) Use XSLT to transform the result of the SWT into your desired page
>>for the user (could include a <meta http-equiv="refresh"> style redirect)
>>2) Use the Flow processPipelineTo to write your source, and then send
>>another page using sendPage
>>
>>Regards, Upayavira
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>    
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



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


Re: SourceWriting Transformer: how to redirect after writing files?

Posted by Gianluca Morello <mo...@S1.my-tv.it>.
Dear Upayavira,
thank you for your help

this approach works fine for me.

As you suggested,
i used processPipelineTo with the outputstream of a resolver of a new file
(in which i capture the output of the WST pipeline), so  the flow scripts
can continue.

Best Regards
Gianluca





----- Original Message -----
From: "Upayavira" <uv...@upaya.co.uk>
To: <us...@cocoon.apache.org>
Sent: Monday, December 22, 2003 12:57 PM
Subject: Re: SourceWriting Transformer: how to redirect after writing files?


> Gianluca Morello wrote:
>
> >Sounds good,
> >
> >i'm calling the SWT pipeline from flow with redirectTo.
> >I tried also processPipelineTo from flow, but i don't know how to setup a
> >correct outputstream parameter.
> >A null outputstream parameter is invalid. I don't need to process the
output
> >of the swt.
> >
> >Do you have any example how to use processPipelineTo?
> >
> >
> Well, having just replied, I realised that perhaps we're doing this all
> wrong. Why not do:
>
> var resolver =
>
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE
);
> var source = resolver.resolveURI("URI for your modifiable source");
> var outputstream = source.getOutputStream();
> cocoon.processPipelineTo("page", outputstream);
> resolver.release(source);
>
> That way you don't need the SWT at all.
>
> Regards, Upayavira
>
> >Thank you
> >
> >Gianluca
> >
> >
> >
> >
> >
> >
> >----- Original Message -----
> >From: "Upayavira" <uv...@upaya.co.uk>
> >To: <us...@cocoon.apache.org>
> >Sent: Monday, December 22, 2003 12:36 PM
> >Subject: Re: SourceWriting Transformer: how to redirect after writing
files?
> >
> >
> >
> >
> >>Gianluca Morello wrote:
> >>
> >>
> >>
> >>>Hi all,
> >>>
> >>>i have a pipeline i which i use a sourcewriting transformer to write a
> >>>xml file.
> >>>
> >>>I wish to be able to redirect to a new page  after writing the file.
> >>>After the writing of the file i have on the browser the output
> >>>message of the sourcewriting transformer.
> >>>
> >>>There's a way to do that?
> >>>
> >>>
> >>>
> >>Not sure if there is. I would suggest a couple of approaches:
> >>1) Use XSLT to transform the result of the SWT into your desired page
> >>for the user (could include a <meta http-equiv="refresh"> style
redirect)
> >>2) Use the Flow processPipelineTo to write your source, and then send
> >>another page using sendPage
> >>
> >>Regards, Upayavira
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >>For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


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


Re: SourceWriting Transformer: how to redirect after writing files?

Posted by Upayavira <uv...@upaya.co.uk>.
Gianluca Morello wrote:

>Sounds good,
>
>i'm calling the SWT pipeline from flow with redirectTo.
>I tried also processPipelineTo from flow, but i don't know how to setup a
>correct outputstream parameter.
>A null outputstream parameter is invalid. I don't need to process the output
>of the swt.
>
>Do you have any example how to use processPipelineTo?
>  
>
Well, having just replied, I realised that perhaps we're doing this all 
wrong. Why not do:

var resolver = 
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
var source = resolver.resolveURI("URI for your modifiable source");
var outputstream = source.getOutputStream();
cocoon.processPipelineTo("page", outputstream);
resolver.release(source);

That way you don't need the SWT at all.

Regards, Upayavira

>Thank you
>
>Gianluca
>
>
>
>
>
>
>----- Original Message -----
>From: "Upayavira" <uv...@upaya.co.uk>
>To: <us...@cocoon.apache.org>
>Sent: Monday, December 22, 2003 12:36 PM
>Subject: Re: SourceWriting Transformer: how to redirect after writing files?
>
>
>  
>
>>Gianluca Morello wrote:
>>
>>    
>>
>>>Hi all,
>>>
>>>i have a pipeline i which i use a sourcewriting transformer to write a
>>>xml file.
>>>
>>>I wish to be able to redirect to a new page  after writing the file.
>>>After the writing of the file i have on the browser the output
>>>message of the sourcewriting transformer.
>>>
>>>There's a way to do that?
>>>
>>>      
>>>
>>Not sure if there is. I would suggest a couple of approaches:
>>1) Use XSLT to transform the result of the SWT into your desired page
>>for the user (could include a <meta http-equiv="refresh"> style redirect)
>>2) Use the Flow processPipelineTo to write your source, and then send
>>another page using sendPage
>>
>>Regards, Upayavira
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>    
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



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


Re: SourceWriting Transformer: how to redirect after writing files?

Posted by Gianluca Morello <mo...@S1.my-tv.it>.
Sounds good,

i'm calling the SWT pipeline from flow with redirectTo.
I tried also processPipelineTo from flow, but i don't know how to setup a
correct outputstream parameter.
A null outputstream parameter is invalid. I don't need to process the output
of the swt.

Do you have any example how to use processPipelineTo?

Thank you

Gianluca






----- Original Message -----
From: "Upayavira" <uv...@upaya.co.uk>
To: <us...@cocoon.apache.org>
Sent: Monday, December 22, 2003 12:36 PM
Subject: Re: SourceWriting Transformer: how to redirect after writing files?


> Gianluca Morello wrote:
>
> > Hi all,
> >
> > i have a pipeline i which i use a sourcewriting transformer to write a
> > xml file.
> >
> > I wish to be able to redirect to a new page  after writing the file.
> > After the writing of the file i have on the browser the output
> > message of the sourcewriting transformer.
> >
> > There's a way to do that?
> >
>
> Not sure if there is. I would suggest a couple of approaches:
> 1) Use XSLT to transform the result of the SWT into your desired page
> for the user (could include a <meta http-equiv="refresh"> style redirect)
> 2) Use the Flow processPipelineTo to write your source, and then send
> another page using sendPage
>
> Regards, Upayavira
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>




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