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.
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...
some sort of "best practice" hints would be cool, maybe pointers to
publications or modules that Do It Right(tm) ?
A good example is indexing in the lucene module - the area, uuid etc.
are passed to the pipeline, this way you can index arbitrary documents
from the same page context.
hmm. i see the mechanism you were talking about, but still this is one
of the more frightful sitemaps in lenya.
plus it contradicts your points in some of its pipelines.
for example, there's a matcher for "opensearch.xml", which looks like a
user request for a file, but it's obviously not, since the pipeline uses
{page-envelope:*} all over the place, so "opensearch.xml" is another
internal magic token disguised as a file request out of sheer
evil-mindedness. sigh.
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: [EMAIL PROTECTED], Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]