Hi Bryce,

On Mon, Jul 7, 2008 at 4:44 AM, Bryce Ewing <[EMAIL PROTECTED]> wrote:
> ...I am wondering if there is any way to do a two (or more) pass rendering for
> content,...

I don't think this is currently possible without using workarounds.

> ...Multi rendering:
>   GET /alpha/beta.html
>   ... (not sure about this part) ...
>   uses two scripts to render the content, one which takes it from source to
> intermediary then a second one to render to html...

What could work (as a temporary solution) might be for your script to
make another http request that generates the first format, captures
that output and provides it to the module (FOP in your example) that
generates the second format.

But maybe someone has a better idea about how to do pipelines with the
current codebase?

Note that you could also create a specific servlet for this FOP/PDF
case, wire it to .pdf requests and have it use the repository document
view XML as input to an xslt transform script, that feeds into FOP
(see http://xmlgraphics.apache.org/fop/0.94/embedding.html).

>... Maybe something like this would work?
>   GET /alpha/beta.xml.html
>   resource /alpha/beta.xml (which has sling:resourceType = "test2")
>   uses /apps/test2/html.ftl to render the node beta.xml -> beta.xml.html
>   resource /alpha/beta (which has sling:resourceType = "test1")
>   uses /apps/test1/html.ftl to render the node beta -> beta.xml...

Do you mean encoding in the URL the steps used to generate the
response? I don't like that too much.

I'd prefer implementing real pipelines, using a specific *script*
extension to control a simple pipeline engine:

GET /foo/bar.pdf (resource type foo)
-> handled by /apps/foo/pdf.pipeline script

Where pdf.pipeline might be a simple pipeline control language:

transform /apps/foo/xslt/xslfo.xsl
serialize org.apache.sling.serializers.fop
  options outputFormat=pdf

Carsten mentioned Commons Sandbox Pipeline as something that might
help implementing this,
(http://markmail.org/message/2mtvwt4cxfpkgkas), and there's also the
experimental Cocoon Corona project, a minimal version of Cocoon that
includes pipelines.

So currently (and I'd love to be proved wrong on this one) I think
you'd have to resort to workarounds to do this (or implement a custom
.pdf servlet), and I think we need to introduce simple pipelines for
such cases at some points. Contributions are most welcome as usual ;-)

-Bertrand




>
> A specific example of where this would come in handy would be:
>   /alpha/beta -> /alpha/beta.xml -> /alpha/beta.xml.pdf (where the xml step
> is fop)
>
> Maybe I am going down a completely wrong track with the multi-pass rendering
> so more specifically how would I render a pdf (via first creating fop)?
>
> Cheers
> Bryce
>



-- 
  Bertrand Delacretaz
  http://www.codeconsult.ch

Reply via email to