Thomas Comiotto wrote:
Hi all,

What is the preferred way to implement flexible uri mapping with 1.2 ? I am currently backporting some of the existing webdav code to 1.2 and unfortunately I am finding myself writing ugly hacks to circumvent pageEnvelope dependencies in almost every corner of the 1.2 api:(

What I would like to achieve is configurable uri mapping (or proxying if you will) on publication level, so _after_ the PageEnvelopeModule has been initialized.

Example:

GET /webdav/{documentid}/.assets/resource.png
to:
GET /resources/authoring/{documentid}/resource.png

I'm not quite sure if I understand this correctly.

The basic mechanism is

  URL -> [DocumentBuilder] -> Document -> [PathMapper] -> File

The page envelope, workflow, revision controller etc. should work
on the Document object (using the getFile() etc. methods to resolve
paths).

Which stage of this process do you want to customize?


You get the point. The above request initializes PageEnvelopeModule with an nonexistent document and althought it's easy to use DocumentBuilder to build an arbitrary document letting pageEnvelope alone, it seems to be not that easy to get the needed RevisionController and workflow states for this document since at least the workflow code is heavilly depending on the PageEnvelopeModule AFAICS.

Yes - the workflow, revision controller etc. use the document
which is attached to the page envelope. This document is determined
by the DocumentBuilder. The connections are pretty hard-wired, I don't
see an immediate solution to disentangle this (at least when you use
the task concept).


Note that the above example is not the only usecase we have to tackle; We also have doctypes that are aggretated before being passed to the webdav client, e.g.

I guess that can't be implemented in a straigtforward way in 1.2
(without redesigning the API or adding custom code to the core).


LOCK /webdav/{myAggregatedDoctypeDocId}/index_ru.xml
where agrDocId consists of several other documents that have to be checked out, edited etc.. on the above request.

As a hack I tryed to pass arbitrary doc to the pageEnvelope by calling pageEnvelope.setDocument(doc) but that didn't do the trick and I have all the pageEnvelope depending classes still pointing to nonexistent doc.
>
I don't mind writing hacks but how can I access RC and workflow states of _arbitrary_ documents in 1.2?

You could try to call the workflow and RC classes directly.
If they access the page envelope, then it's a bug (IIRC there are
such problems in 1.2).

Or what is the preferred way of implementing URI namespace schemes that differ from the one that lenya uses except of putting a proxy in front of the whole thing?

The API doesn't support this. The URL is mapped 1:1 to the document ID.

I'm not sure if this helps, maybe I'll have to see some code examples
to better understand what you're trying to achieve.

-- Andreas


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