cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Markus <t.mar...@proventis.net>
Subject Re: store contents of a pipeline
Date Wed, 28 Jan 2009 07:33:39 GMT
problem found. a cocoon:/{1} created always an internal-only request and 
my sub sitemap expects an external request. how can i create an external 
request from an internal action? i dont want to reimplement SitemapSource

regards
thomas


Thomas Markus schrieb:
> hi all,
>
> i try to cache the output from a sitemap (and i cant use cached 
> pipelines). this sitemap returns only generated content (html and 
> images). i created an action thats verifies my cache and calls an uri 
> to store pipeline output.  my applications works fine without this 
> action.
>
> it "works" but i have 2 problems:
> - html content is parsed as xml. my original pipeline has a <serialize 
> type="html" /> but content is in xml (with <?xml?> header and 
> entities). binary content like images are ok
> - property mimetype from source is always empty (see java part below)
>
> how can i access the correct content and mimetype? system is cocoon 2.1.7
>
> regards
> thomas
>
> <!--pipeline -->
> <map:pipelines>
>
>    <map:pipeline internal-only="true">
>        <map:match pattern="**">
>            <map:mount uri-prefix="" src="../sitemap.xmap" />
>        </map:match>
>    </map:pipeline>
>
>    <map:pipeline>
>        <map:match pattern="**">                       <map:act 
> type="checkcache" src="cocoon:/{1}">
>                <map:read src="{file}" mimetype="{mimetype}" />
>            </map:act>
>            <map:mount uri-prefix="" src="../sitemap.xmap" />
>        </map:match>
>    </map:pipeline>
>
> </map:pipelines>
>
>
> /* action snippet */
> Source src = resolver.resolveURI(source);
> try {
>    FileOutputStream out = new FileOutputStream(file);
>    try {
>        InputStream in = src.getInputStream();
>        IOUtil.copy(in, out);
>    } finally {
>        out.close();
>    }
>    // this is never correct!
>    src.getMimeType();
> } finally {
>    resolver.release(src);
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message