Preview problems

Samuel Schluep <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
Dear Silva Developers

I would like to summarize some problems, which apply to previewing and 
seem to be related:

1. I often observed authors who would like to preview their work in the 
final layout. Their work often contains more than one document, so they 
will also want to test the new navigation. Unfortunately links generated 
by the CMS often point to another view mode. I.e. when checking the site 
in the preview_html mode a TOC link points to the edit/tab_preview mode. 
Because of these inconsistencies authors tend to publish their contens 
immediately and check the site in the public view. It is clear that 
almost always some corrections will be needed, forcing the authors to 
create new versions of their content. This is cumbersome and result in 
version bloat!

2. Layout designers can fix this for the navigation, passing the 
view_method parameter from the layout_macro.html or content.html to a 
script, which will generate the navigation. But this adds much 
complexity to the layout design process. Further, while the this fix 
works for the custom navigation, TOC links will still point to another 
view mode, which is very annoying.

3. Authors also get confused if metadata is changed, but the change is 
not rendered correctly in the preview. The Silva default 
get_metadata_element always returns viewable metadata (what if the 
content has not been published yet?). Again an expert layout programmer 
can create a custom get_metadata-element script using the view_method 
parameter. Couldn't this be easier?

4. Another problem, enabling authors to preview their work in its 
current state, without having to publish the content is dLCMS specific. 
But it is caused by SilvaMetadata. dLCMS relies heavily on what I call 
Simple Ghosts, which will render the previewable of a ghost target for 
preview modes. Unfortunately I can not render the previewable metadata, 
because the SimpeGhost must use an access handler to get the target's 
metadata (see code below). The problem is that the access handler has no 
way to find out if it use the previewable or the viewable.

Some of these issues have been around for years: see issue 31 
(http://issues.infrae.com/silva/issue31) or the silva-dev thread at 
http://lists.infrae.com/pipermail/silva-dev/2003q4/000881.html (what 
happened about jw's suggestions 
http://lists.infrae.com/pipermail/silva-dev/2003q4/000887.html?).

Are there already nice solutions or are there some plans relating to 
these issues, which I have missed?

Best regards
Sam


Access handler code the dLCMS __init__:

def initialize(context):
    <snip>
    registerAccessHandler(SimpleGhost.SimpleGhost.meta_type, 
simple_ghost_access_handler)

def simple_ghost_access_handler(tool, content_type, content):
    target_content = content.get_haunted_unrestricted()
    if target_content is None:
        return None
    viewable = target_content.get_viewable()
    if viewable is None:
        ## *** get metadata if content hasn't been published yet
        viewable = target_content.get_previewable()
        if viewable is None:
            return None
    return invokeAccessHandler(tool, viewable)

-- 
Samuel Schluep, Institut für Hygiene und Arbeitsphysiologie, ETH Zürich
+41 1 632 74 24 | [email protected] | http://www.iha.bepr.ethz.ch
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.