Re: xslt renderer: 2 questions

Eric Casteleijn <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
Marc Petitmermet wrote:
> dear developers
> 
> - would it be possible to use the renderer for non-silva content? e.g. 
> for an uploaded silva file asset which is an xml file from a external 
> program. or should this xml file be included into a silva document using 
> external sources?

Well, for truly non-silva content no. But any content-type used and 
displayed in silva can be rendered with a renderer, be it XSLT or 
otherwise. You need to have a CVS checkout of the HEAD though, because 
only yesterday I succeeded in removing any hardcoded dependencies on 
Silva Document. Also in the works is a demo Silva Extension that shows 
exactly how to build and register your own renderer. Using that 
Extension as a basis, it will be really easy to do so.

> - is it possible to let the user choose the renderer with a link in the 
> public view of a page? e.g. i have a standard listing with the default 
> renderer but i would like to have more views with more details of the 
> same data. for this task the user should be able to click on some links 
> on the page.

Currently, no, or not easily. A user with author or higher role can set 
the renderer for a specific object in the properties screen. Managers 
can set the default renderer for all objects of a given type in the 
service. Letting users change the renderer for a content-type is 
possible with a little coding and some UI building though. The trick is 
that you don't want the end user to change the renderer for an object 
for everybody, so you don't want to change the property on the object, 
but you want the renderer engine to think it has. I will think about 
this some more, and maybe this will be in one of the next versions.

For everybody using the renderer system now: if you upgrade to Silva 
HEAD, (and you really should because it makes your life easier if you 
are working with the renderers) you should do a refresh all on the 
service extensions page, because the renderer property is no longer in 
the metadata (since it isn't really metadata, if you want to get all 
philosophical, and  because not having it be metadata had endless 
implementation advantages.) and a refresh all will take care of that. If 
you have set renderers for specific objects, they will, however, switch 
back to the default.

eric
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.