Hi Bertrand,
Pipelines sound like an ideal way of doing this, some comments below.
Bertrand Delacretaz wrote:
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.
Thankfully I am not requiring this right now, so would be better to work
on a more long term solution than just a work around.
... 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 agree, was mainly using that as an example, I would rather not have to
know when entering a url that it was first transformed into xml then
into pdf.
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
When you said a pipeline it got me thinking about why something like
this would necessarily be best implemented as a script (also thinking
the same in regards to the image processing). What I was thinking is
would it be better to implement this as nodes in jcr rather than a
custom script language e.g. (using json notation):
in /apps/foo {
"pdf.pipeline" : {
"stages": ["xml", "pdf"]
}
}
would allow for running scripts /apps/foo/xml.ftl then /apps/foo/pdf.ftl
(for example), was thinking for this one it would be good to be able to
change the resource type between stages as well (maybe using ordered
child nodes to store the information rather than a multivalue property) e.g.
{
"pdf.pipeline" : {
"generatefo": {
"outputFormat":"xml",
"resourceType":"bar"
},
"serialize": {
"outputFormat":"pdf"
}
}
}
would run /apps/foo/xml.ftl then /apps/bar/pdf.ftl (for example).
OR use scripts specifically
{
"pdf.pipeline" : {
"jcr:path:stages": ["/apps/foo/test.ftl", "/apps/bar/test2.ftl"]
}
}
would allow for running the mentioned scripts.
More wondering what the thoughts are on the general idea of using the
nodes in jcr rather than a scripting language for this purpose?
Cheers
Bryce