cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@odoko.co.uk>
Subject Re: Using the output of a pipeline to call another pipeline?
Date Tue, 27 Sep 2005 10:12:16 GMT
Jonas Lundberg wrote:
> I've got a very basic question that I got stuck with.... maybe someone
> can help me out?
> 
> I have a web publishing system that stores all images in eXist, using
> a number as the file name, e.g. 44500.jpg
> 
> Each image has a metadata file, describing at what URL the image
> should be shown (and also some other things, not shown here), e.g.
> <metadata>
> <live><at>webdesign/cocoon</at></live>
> <filename>banner.jpg</filename>
> </metadata>
> 
> In the html files, the url to the file points at its virutal location,
> and virtual name, e.g. webdesign/cocoon/banner.jpg
> Thus, I could write a cocoon sitemap matcher like this:
> 
> <map:match pattern="*/*/*.jpg>
>   <map:generate src="xq/{1}.xq" type="xquery">
>    <map:parameter name="file" value="{1}/{2}/{3}"/>
>   </map:generate>
> ? How to call the second pipeline with the result of the query?
> </map:match>
> 
> The xquery generates the file name to use in the second pipeline, like this
> <file>
> 44500.jpg
> </file>
> 
> The image is then to be fetched from eXist using this pipeline:
> <map:match pattern="*.jpg">
> <map:read type="image"
>                   
> src="http://guest:guest@localhost:8080/cocoon/webdav/db/contents/jpeg/{1}.jpg"
>                    mime-type="text/jpg "/>
> </map:match>
> 
> But how do I call the second pipeline, using the file name created by
> the generator in the first pipeline? This is a very basic question,
> but I got stuck with it anyway... Any ideas?

Surely all yo do is translate the results of the query into HTML using 
XSLT, you'd have <img src="44500.jpg"/>, which would get your image 
directly out of your db for you.

Or am I missing something?

Regards, Upayavira


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


Mime
View raw message