On 8/16/06, Jörn Nettingsmeier <[EMAIL PROTECTED]> wrote:
Andreas Hartmann wrote:
> Joern Nettingsmeier wrote:
>>> You get the path in the site structure (formerly known as document
>>> ID) with
>>> {doc-info:{pubId}:{area}:{uuid}:{language}:path}
>>> I understand that this syntax is quite verbose, but the implicit
>>> page envelope syntax caused some problems - you have to be very
>>> careful when writing pipelines which can be accessed for arbitrary
>>> documents.
>> thanks for the help. can you elaborate on the problems with
>> {page-envelope:*}? i've been using it a lot in module sitemaps, but i
>> have this nagging feeling that i'm going to regret it some day.
> The problem with the page envelope is that you assume that a pipeline
> applies to the currently requested document. This way, you lose the
> ability to call the pipeline for arbitrary documents. Actually, it
> violates orthogonality - you put the mechanism of getting the parameter
> (the document) and the actual functionality in the same place.
> You should rather use a (reusable) pipeline like a method - by declaring
> parameters in the method signature, you make it generic.
thanks for clarifying.
In 1.3, the ContentInputModule {content:variable:document} retrieves
information about the specified Resource. I think that satisfies
Andreas' requirement. PageEnvelope is still used, mostly to decide
the current publication and language.
the problem with cocoon is that there is a trade-off between
re-usablility of pipelines and readability, and it's a crooked one.
make your pipelines just a little more generic, and they immediately get
extremely cluttered with a gazillion wildcard matchers and those
oh-so-stupid-what-were-they-thinking magic variable numbers all over the
place.
oh well, the wildcard matcher was designed for simple request matching,
not as a parameter passing mechanism...
We can fix that for 1.3, and pass the improvements to Cocoon. How
about changing the wildcard matcher so it can name variables?
<!-- /lenyabody-{rendertype}/{publication-id}/{area}/{doctype}/{url} -->
<map:match
pattern="lenyabody-%rendertype%/%pub%/%area%/%doctype%/%%documentpath%%">
<map:aggregate element="cmsbody">
<map:part
src="cocoon://navigation/{pub}/{area}/breadcrumb/{documentpath}.xml"/>
Would that syntax be useful? Could the Typical User understand it? Is
'%' a good choice?
DESIGN NOTES:
- If formats are mixed, the * and ** are still available in numbered
variables. The % syntax variables are not assigned to numbered
variables.
- The named variables are available in nested pipelines without the
{../#} syntax.
- Variable names cannot contain colons. The colon specifies the
variable is from an InputModule, not a pipeline variable.
- Reusing the name of a variable in nested pipelines is bad practice.
Variables must honor scope. A parent pipeline's variables remain
available. If a name is reused, the latest wins in the nested
pipeline. Using parent pipeline's variables with the {../myvar}
syntax is silly and defeats the purpose, so the syntax is not
supported, and anybody who complains is sent an ICBM. When leaving
the nested pipeline, its variables are not available.
solprovider
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]