On 8/16/05, Alexandre Poitras <[EMAIL PROTECTED]> wrote:
> I have been wondering since yesterday how to apply different XSL
> stylesheets to a same XML ressource of a given ressource type based on
> the URL entered. The problem I have is the XSL applied to a custom
> ressource type is always the same but I want to provide different
> "user views" of the same data. For instance, in my future website, I
> want to be able to display a same article in a brief format or in a
> more detailled format. Of course, I could do that easily by passing a
> parameter to the XSL stylesheet but it involve writting a custom
> pipeline each time I want to use different XSL stylesheets for a
> resource.

See
http://solprovider.com/lenya/multiple

It solves the "writing a custom pipeline each time I want to use
different XSL stylesheet".

> I was looking in the doctypes.xmap file to try to find a more
> appropriate solution. But there is something I still don't get with
> the "url space" used for determing custom ressource type. The standard
> right now is  {rendertype}/{area}/{document-path} and is sent to
> doctypes.xmap as {rendertype}/{area}/{doctype}/{document-path} after
> the doctype has been determined based on the content of the XML file.
> Fom what I understand, the XSL stylesheet is determined by the doctype
> part and the XML file by the document-path.

There is a caching issue with doctypes.  Once a document's doctype is
set, Lenya never checks it again.  Overriding the doctype in
doctypes.xmap based on the current URL will not cause the new doctype
to be used; the first doctype chosen will always be used.

> I was wondering why the original url isn't like this
> {rendertype}/{area}/{viewtype}?documentPath={document-path} where the
> documentPath parameter is optional depending if you need it or not.
> Thus, after mouting the doctypes.xmap file, the url could look like
> this {rendertype}/{area}/{doctype}/{viewtype}?documentPath={document-path}.
> By using this solution, I would be able to solve my problem by sending
> url like these :
> {renderType}/{area}/detailledArticle?documentPath={article-path} and
> {renderType}/{area}/briefArticle?documentPath={article-path}
> 
> I think the documentPath should be a parameter and not be contain in
> the adress because the "user view" doesn't change with it. But that's
> my opinion. What do you think of it?

My opinion is the Area in the URL should specify the Sitemap.  The
querystring should be used for internal issues, but anything visible
to visitors should not require using the querystring, as Usecases
currently do.  Authoring and Admin could be handled by the
querystring.  (I believe Admin functions have been changed for 1.4.)
The URLs would be:
/live/pathToDocument
/live/pathToDocument?editInformation (shows list of revisions)
/live/pathToDocument?edit={revisionNumber}&editor=kupu
/myXMAP/pathToDocument (uses an alternate XMAP as Usecases do now)
/myXMAP/stylesheet/pathToDocument (with some easy customization of the XMAP)

This would be easy to implement with minor modifications to the
current sitemaps, but it is nobody's priority.

solprovider

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

Reply via email to