forrest-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: write a file in forrest via sitemap
Date Wed, 04 Mar 2009 11:24:21 GMT
2009/3/4 Dr. Bhatia Praveen <praveen.bhatia@sumpurn.com>:
>  The example given by Ross, perhaps can solve this type of need, but if it
> is simplified I could try to experiment with it.

It is hard to simplify it any further without knwoing what parts you
don't currently understand. What you want to do is pretty simple for
those of use who understand how Forrest pipelines work and how to
overrride those pipelines in a project sitemap. Unfortunately, you
have to climb that learning curve before it gets simple.

If you have no idea what the pipeline I posted into my earlier message
means then you need to start with developing a basic understanding of
how to customise Forrest [2].

Once you understand that you need to get to grips with the
SourceWritingTransformer. The full documentation for the transformer I
refer to is on the Cocoon website [1].

Finally you need to know how to override specifc transformations in
the Forrest sitemaps. However, your requirement above is quite general
and you need identify specific stages you want to write to disk before
we can give specific help.

BUT...

Many of the intermediate steps are allready available by requesting a
speific URL. For example, if you simply want a copy of the internal
intermediate format (XDoc) for all pages you can turn on the XML link
in skin-conf [3]:

<!-- The xml source link makes it possible to access the xml rendition
    of the source frim the html page, and to have it generated statically.
    This can be used to enable other sites and services to reuse the
    xml format for their uses. Keep this disabled if you don't want other
    sites to easily reuse your pages.-->
  <disable-xml-link>false</disable-xml-link>

Now do "forrest run" and you have an xdoc representation of every file.

Ross


[1] http://cocoon.apache.org/2.0/userdocs/transformers/sourcewriting-transformer.html
[2] http://forrest.apache.org/docs_0_90/your-project.html#sitemap.xmap
[3] http://svn.apache.org/repos/asf/forrest/trunk/main/fresh-site/src/documentation/skinconf.xml

> Praveen
>
>
> ----- Original Message ----- From: "Ross Gardler" <rgardler@apache.org>
> To: <user@forrest.apache.org>; "Dr. Bhatia Praveen"
> <praveen.bhatia@sumpurn.com>
> Sent: Tuesday, March 03, 2009 10:55 PM
> Subject: Re: write a file in forrest via sitemap
> - Show quoted text -
>
>
> 2009/3/2 Dr. Bhatia Praveen <praveen.bhatia@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
>
>



-- 
--
Ross Gardler

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

Mime
View raw message