See the FragmentExtractor system. http://cocoon.apache.org/2.1/userdocs/transformers/extractor-transformer.htm l http://cocoon.apache.org/2.1/userdocs/generators/extractor-generator.html
You could just break your pipeline into 3 pipelines, and use the "cocoon" protocol to link them together into a tree shape. This will give you your "tee" and allow you to reuse the pregenerated content E, which will be cached for you: 1) data layer and business logic (i.e. up to point E) Generators: A B C --| | | | |- the data layer ----------------------- | | | Aggregation: D --| | Transformation: E ---- the business logic 2) graphics Transformation: E ---- the | business logic jpg/png ---- the prettfying layer 3) texts Transformation: E ---- the | business logic -------------------------- --| | | | | |- the prettfying Formatting: rtf xsl pdf html --| layer These second two pipelines are based on the other pipeline E. e.g. <!-- pipeline one, called "E" for want of a better name --> <map:pipeline match="E/**"> <map:aggregate etc. etc. ... </map:pipeline> <map:pipeline match="graphics/**"> <map:generate src="cocoon:/E/**"/> <map:transform src="E-to-graphics.xsl"/> etc... </map:pipeline> <map:pipeline match="texts/**"> <map:generate src="cocoon:/E/**"/> <map:transform src="E-to-texts.xsl"/> etc... (serialize as RTF, PDF, or HTML) </map:pipeline> The "cocoon:" protocol is your friend! Cheers Con > -----Original Message----- > From: Anoop Aryal [mailto:[EMAIL PROTECTED] > Sent: Thursday, 19 June 2003 04:52 > To: [EMAIL PROTECTED] > Subject: retaining data from a partial pipeline for > subsequent requests > > > hi, > i'm evaluating cocoon to see if it suits our needs. i've used fop > extensively before. and i know just enough of cocoon to be dangerous. > this is kinda long but i put a lot of time in drawing in ascii to make > it clearer; hopefully ;) > > the problem: > ------------- > > in keeping with the SOC, i have the following setup: > > Generators: A B C --| > | | | |- the > data layer > ----------------------- | > | | > Aggregation: D --| > | > Transformation: E ---- the > | > business logic > -------------------------- --| > | | | | |- the > prettfying > Formatting: rtf xsl pdf html --| layer > > > in the html, i refer to images (charts, which i'm generating > using Fins) > that are generated according to the data generated at E. But > as they are > subsequent requests from the browser don't have access to the > data since > the pipeline that generated the data was done and over with after > generating the html. So, i'm left with two options: > > i) regenerate the data up to E: > > Generators: A B C --| > | | | |- the > data layer > ----------------------- | > | | > Aggregation: D --| > | > Transformation: E ---- the > | > business logic > jpg/png ---- the > prettfying > layer > > or, > ii) save the data from the pipeline into the session (from A, > B, C) when > generating the html and use that as such: > Generator: F (reads data from the session previously set by A,B,C) and > generates xml to feed into the fins transformer. > > Current solution: > ----------------- > as option (i) would require me to regenerate the dataset, i > opted to use > option (ii). but then, since i can only shove the data into sessions > from an xsp (?) i only have the raw form of data from (A, B, C) in the > session. F would then have to do what D and E does. complete breakdown > of SOC. > > Wishful/hopeful thinking: > ------------------------- > something like this would be optimal: > > Generators: A B C > | | | > ----------------------- > | > Aggregation: D > | > Transformation: E ----------------- tee* -- > | | > -------------------------- | > | | | | | > Formatting: rtf xsl pdf html** | > | > | > formatted as a png/jpg/svg and > stored in cocoon cache using a > unique key** for the subsiquent > request > > *) tee as in make a copy and pass one copy to the html > formatting step. > and another to the image formatting step. > **) the key would be predetermined so that the src element in the html > would know which image url to put in. and another pipeline would deal > with requests for images keyed off this way. > > (That does sound out of wack. told you, i know enough to be dangerous) > > > > So, the question is, how do you generate images that are referenced by > some html when the images are another view of the data that > the html is > displaying without regenerating the data for the image generation? > ideas? > > thanks in advance, > anoop > [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]