Thorsten Scherler schrieb:
> On Mon, 2007-05-14 at 11:38 +0200, Andreas Hartmann wrote:
> ...
>>> Meaning another option is to limit the revision to the main document,
>>> which is as well producing the overview in
>>> http://localhost:8888/default/authoring/index.html?lenya.usecase=tab.revisions
>>>
>>> The revision link would open only the document (no nav, no menu, no
>>> nothing else but the result of
>>> {resource-type:format-xhtml}?rendertype={1}.
>>>
>>> wdyt?
>> That would certainly be an option, but it would require hard-coding
>> the revision handling in sitemaps. We'd have to introduce a generic
>> concept of "page" vs. "revision" rendering.
> 
> Requesting
> http://localhost:8888/default/authoring/index.html?lenya.revision=2
> is triggering which code?

The resource type module sitemaps pass the lenya.revision parameter to
the DocumentSource, from there it goes to the RepositorySource. The
actual evaluation happens in the RepositorySource.

> I just was looking were lenya.revision=2 get resolved. Can you point me
> to the code?
> 
> I thought that I could find something like:
> 
> RCML rcml = getSourceDocument().getRepositoryNode().getRcml();
> int version= getParameter("lenya.revision");
> Document doc = rcml.getBackupEntry(version);

That's in RepositorySource:

if (revisionNumber == -1) {
    this.content = (ContentHolder) session.getRepositoryItem(
                                   factory, sourceUri);
}
else {
    Node node = (Node) session.getRepositoryItem(factory, sourceUri);
    this.content = node.getHistory().getRevision(revisionNumber);
}


> We would need to write rcml.getBackupEntry(int version){} and above goes
> in a generator that returns the sax out of the doc.
> 
> That would not make it necessary to hard code the revision handling.
> 
> Having a match like 
> <map:match type="request-parameter" pattern="lenya.revision">
>  <map:generate type="revision"/>
>  <map:serialize type="xml"/>
> </map:match>
> 
> Not sure whether I explained myself very well.

IMO revision handling should be completely orthogonal to pipeline
processing. Otherwise, the danger of forgetting something is too big,
and the code becomes harder to maintain.

-- Andreas


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch


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

Reply via email to