Andreas Hartmann wrote:
[EMAIL PROTECTED] wrote:

[...]

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%%">


Just a random thought - another option might be to use "named matchers",
maybe with default values for parameters:

Well, I guess this would be quite close to virtual pipeline components.

-- Andreas


<map:match name="content">
  <map:param name="pubId" default="{page-envelope:publication-id}"/>
  <map:param name="uuid" default="{page-envelope:document-uuid}"/>
  <map:generate src="lenyadoc://{$pubId}/{$uuid} ..."
  ...
</map:match>


<map:generate type="matcher" src="content">
  <map:parameter name="pubId" value="{1}"/>
  <map:parameter name="uuid" value="{2}"/>
</map:generate>
<map:transform ...


-- Andreas


       <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




--
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
[EMAIL PROTECTED]                     [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to