Hi Ross,Gavin
   I will explain the need more clearly.
When transformations take place by the sitemap pipeline, lot of useful information also gets generated in the process by transformations like xslt transformations. I would like to store these useful informations for record or later use in another pipeline. Hence, I would like to know how in a sequence of transformation pipeline I could:
1) Open a file to write
2) Write "intermediate useful information" as some xml data into the file
3) close the file
4) continue with the transformation in the pipeline and display in html/pdf as forrest does.

On a similar note:
In "forrest run" can we have a copy of the displayed xml/html as a file by transformations (without using "forrest site")

The example given by Ross, perhaps can solve this type of need, but if it is simplified I could try to experiment with it.
best wishes
Praveen


----- Original Message ----- From: "Ross Gardler" <rgard...@apache.org> To: <user@forrest.apache.org>; "Dr. Bhatia Praveen" <praveen.bha...@sumpurn.com>
Sent: Tuesday, March 03, 2009 10:55 PM
Subject: Re: write a file in forrest via sitemap


2009/3/2 Dr. Bhatia Praveen <praveen.bha...@sumpurn.com>:
Hello,
How can one use forrest (when running in say run), to write data into a
file?

It's hard to answer such a general question, as Gavin says can you
provide more details.

In the meantime you can look at the note taking pluging in the
whiteboard. This enables a dispatcher contract that allows the user to
add a note field to a forrest page. In particular you should be
looking at org.apache.cocoon.transformation.SourceWritingTransformer
(see cocoon docs):


For example in the above plugin see input.xmap:

     <map:match pattern="noteTaking/do/addNote.xml">
       <map:generate type="request"/>
       <map:transform
src="{lm:noteTaking.transform.postedNotes.sourceWriterNotes}">
         <map:parameter name="notesFile"
value="{properties:noteTaking.repository.URL}{properties:noteTaking.filename}"/>
       </map:transform>
       <map:transform type="write-source"/>
       <map:transform
src="{lm:noteTaking.transform.writeResult.acknowledgement}">
         <map:parameter name="use-request-parameters" value="true"/>
       </map:transform>
       <map:serialize type="xml-document"/>
     </map:match>



--
--
Ross Gardler

OSS Watch - awareness and understanding of open source software
development and use in education
http://www.oss-watch.ac.uk



--------------------------------------------------------------------------------



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.0.233 / Virus Database: 270.11.5/1977 - Release Date: 02/18/09 20:55:00