Author: jmorliaguet
Date: Sat Nov 26 21:04:48 2005
New Revision: 1938

Added:
   cpsskins/branches/jmo-perspectives/browser/rendering/context.py   (contents, 
props changed)
   cpsskins/branches/jmo-perspectives/browser/rendering/renderer.py   
(contents, props changed)
   cpsskins/branches/jmo-perspectives/browser/rendering/viewer.py   (contents, 
props changed)
Removed:
   cpsskins/branches/jmo-perspectives/browser/rendering/engine.py
Modified:
   cpsskins/branches/jmo-perspectives/browser/editing/edit_menu.pt
   cpsskins/branches/jmo-perspectives/browser/editing/portlet_editor.pt
   cpsskins/branches/jmo-perspectives/browser/editing/presentation_editor.pt
   cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py
   cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml
   cpsskins/branches/jmo-perspectives/browser/negociation/interfaces.py
   cpsskins/branches/jmo-perspectives/browser/negociation/views.py
   cpsskins/branches/jmo-perspectives/browser/skin/template.pt
   cpsskins/branches/jmo-perspectives/browser/tree/configure.zcml
   cpsskins/branches/jmo-perspectives/configuration/renderers/metaconfigure.py
   cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt
Log:

- cleanup

- converted pages in (cpsskins.browser.negociation) to a view
  (they are never published)

- removed the 'Effective' adjective in getEffectiveTheme ...



Modified: cpsskins/branches/jmo-perspectives/browser/editing/edit_menu.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/editing/edit_menu.pt     
(original)
+++ cpsskins/branches/jmo-perspectives/browser/editing/edit_menu.pt     Sat Nov 
26 21:04:48 2005
@@ -2,10 +2,10 @@
   <body metal:fill-slot="body"
     class="panel" i18n:domain="cpsskins"
     tal:define="tmutil context/@@getThemeManager;
-                perspective context/@@getPerspective;
+                perspective view/getPerspective;
                 format_name request/form/format|string:;
                 location request/form/location|nothing;
-                current_theme context/@@getEffectiveTheme;
+                effective_theme view/getTheme;
                 displayable context/displayable:this;
                 actual_display python: displayable.getDisplay(perspective);
                 display python: displayable.getEffectiveDisplay(perspective);
@@ -52,7 +52,7 @@
     <div style="clear:both"></div>
 
     <div class="editActions"
-     tal:define="actions 
current_theme/@@view_get_menu/cpsskins_editing_actions"
+     tal:define="actions context/@@view_get_menu/cpsskins_editing_actions"
      tal:condition="actions">
       <a href="#"
          tal:repeat="info actions"

Modified: cpsskins/branches/jmo-perspectives/browser/editing/portlet_editor.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/editing/portlet_editor.pt        
(original)
+++ cpsskins/branches/jmo-perspectives/browser/editing/portlet_editor.pt        
Sat Nov 26 21:04:48 2005
@@ -1,12 +1,13 @@
+<tal:block define="tmutil context/@@getThemeManager;
+                   negociation nocall:context/@@negociation;
+                   effective_theme negociation/getTheme">
 <html metal:use-macro="context/@@popup_macros/page">
   <head>
-    <tal:style metal:fill-slot="style"
-               define="tmutil context/@@getThemeManager;
-                       current_theme context/@@getEffectiveTheme">
+    <tal:style metal:fill-slot="style">
       <link rel="Stylesheet" type="text/css"
             href="/++skin++cpsskins/@@/++resource++widgets.css" />
       <style type="text/css" media="all"
-             tal:content="string:@import 
url(${current_theme/@@absolute_url}/renderCSS);" />
+            tal:content="string:@import 
url(${effective_theme/@@absolute_url}/renderCSS);" />
     </tal:style>
     <tal:script metal:fill-slot="script">
       <script type="text/javascript"
@@ -52,3 +53,4 @@
 
   </body>
 </html>
+</tal:block>

Modified: 
cpsskins/branches/jmo-perspectives/browser/editing/presentation_editor.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/editing/presentation_editor.pt   
(original)
+++ cpsskins/branches/jmo-perspectives/browser/editing/presentation_editor.pt   
Sat Nov 26 21:04:48 2005
@@ -3,7 +3,7 @@
     <div class="editArea"
          tal:define="info context/presentable:getPresentationInfo;
                      presentations info/presentations;
-                     current_perspective context/@@getPerspective;
+                     current_perspective negociation/getPerspective;
                      default_presentation presentations/default|nothing;
                      format_names info/format_names">
 

Modified: cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py  
(original)
+++ cpsskins/branches/jmo-perspectives/browser/negociation/__init__.py  Sat Nov 
26 21:04:48 2005
@@ -17,4 +17,3 @@
 """
 __docformat__ = "reStructuredText"
 
-from cpsskins.browser.negociation.views import NegociationView

Modified: cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml       
(original)
+++ cpsskins/branches/jmo-perspectives/browser/negociation/configure.zcml       
Sat Nov 26 21:04:48 2005
@@ -1,56 +1,16 @@
 <configure
-    xmlns="http://namespaces.zope.org/browser";
-    xmlns:zope="http://namespaces.zope.org/zope";>
+    xmlns="http://namespaces.zope.org/browser";>
 
   <!-- Negociation view -->
 
-  <zope:adapter
-      for="zope.interface.Interface
-           zope.publisher.interfaces.IRequest"
-      provides=".interfaces.INegociation"
-      factory=".NegociationView"
-  />
-
-  <pages
+  <view
       for="*"
+      name="negociation"
+      provides=".interfaces.INegociation"
+      class=".views.NegociationView"
       permission="zope.Public"
-      class=".NegociationView">
-
-    <page
-        name="getDefaultThemeView"
-        attribute="getDefaultThemeView"
-    />
-
-    <page
-        name="getDefaultPageView"
-        attribute="getDefaultPageView"
-    />
-
-    <page
-        name="getEffectiveTheme"
-        attribute="getEffectiveTheme"
-    />
-
-    <page
-        name="getEffectivePage"
-        attribute="getEffectivePage"
-    />
-
-    <page
-        name="getThemeInContext"
-        attribute="getThemeInContext"
-    />
-
-    <page
-        name="getPerspective"
-        attribute="getPerspective"
-    />
-
-    <page
-        name="getEffectiveEngine"
-        attribute="getEffectiveEngine"
-    />
-
-  </pages>
+      allowed_interface=".interfaces.INegociation"
+      layer="cpsskins"
+  />
 
 </configure>

Modified: cpsskins/branches/jmo-perspectives/browser/negociation/interfaces.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/negociation/interfaces.py        
(original)
+++ cpsskins/branches/jmo-perspectives/browser/negociation/interfaces.py        
Sat Nov 26 21:04:48 2005
@@ -21,26 +21,21 @@
 
 class INegociation(Interface):
 
-    def getDefaultThemeView():
-        """ """
-
-    def getDefaultPageView():
-        """ """
-
-    def getEffectiveTheme(context, request):
+    def getTheme():
         """Return the effective theme
         (the one that will be effectively displayed)"""
 
-    def getEffectivePage(context, request):
+    def getPage():
         """Return the effective page
         (the one that will be effectively displayed)"""
 
-    def getThemeInContext(context, request):
-        """Return the theme in which the element is located.
-
-        A context must be provided with.
-        """
+    def getEngine():
+        """Return the effective engine
+        (the one that will be effectively used)"""
 
     def getPerspective():
         """ """
 
+    def getPageViewer():
+        """Return the viewer used to render the page."""
+

Modified: cpsskins/branches/jmo-perspectives/browser/negociation/views.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/negociation/views.py     
(original)
+++ cpsskins/branches/jmo-perspectives/browser/negociation/views.py     Sat Nov 
26 21:04:48 2005
@@ -21,36 +21,33 @@
 from zope.app.publisher.browser import BrowserView
 from zope.app.session.interfaces import ISession
 from zope.component import queryUtility
+from zope.interface import implements
 
 from cpsskins.elements.interfaces import ITheme, IThemePage
 from cpsskins.browser.rendering.interfaces import IViewer
+from cpsskins.browser.negociation.interfaces import INegociation
 from cpsskins.utils import getThemeManager
 
 class NegociationView(BrowserView):
     """A view for the negociation of the effective theme, perspective, ...
     """
-    def getDefaultThemeView(self):
-        tmutil = getThemeManager()
-        theme = tmutil.getDefaultTheme()
-        return zapi.getMultiAdapter((theme, self.request), IViewer)
-
-    def getDefaultPageView(self):
-        tmutil = getThemeManager()
-        page = tmutil.getDefaultPage()
-        return zapi.getMultiAdapter((page, self.request), IViewer)
+    implements(INegociation)
 
     ###################################################################
     # Themes and pages
     ###################################################################
 
-    def getEffectiveTheme(self):
+    def getTheme(self):
         """Return the effective theme
         (the one that will be effectively displayed)
         """
-        return self.getThemeInContext() or \
+        context = self.context
+        if ITheme.providedBy(context):
+            return context
+        return queryUtility(ITheme, context=context) or \
                getThemeManager().getDefaultTheme()
 
-    def getEffectivePage(self):
+    def getPage(self):
         """Return the effective page
         (the one that will be effectively displayed)
         """
@@ -58,16 +55,9 @@
         # use the contextual page (e.g. in editor mode)
         if IThemePage.providedBy(context):
             return context
-        # use the default page
-        return getThemeManager().getDefaultPage()
-
-    def getThemeInContext(self):
-        """Return the theme in a given context.
-        """
-        context = self.context
-        if ITheme.providedBy(context):
-            return context
-        return queryUtility(ITheme, context=context)
+        # use the default page of the effective theme
+        theme = self.getTheme()
+        return theme.getDefaultPage()
 
     ###################################################################
     # Perspectives
@@ -86,6 +76,13 @@
     # Engines
     ###################################################################
 
-    def getEffectiveEngine(self):
+    def getEngine(self):
         return self.request.annotations.get('cpsskins.engine', 'default')
 
+    ###################################################################
+    # Rendering
+    ###################################################################
+
+    def getPageViewer(self):
+        page = self.getPage()
+        return zapi.getMultiAdapter((page, self.request), IViewer)

Added: cpsskins/branches/jmo-perspectives/browser/rendering/context.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/browser/rendering/context.py     Sat Nov 
26 21:04:48 2005
@@ -0,0 +1,102 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.interface import implements
+
+from cpsskins.browser.rendering.interfaces import IContextInfo
+
+class ContextInfo:
+    """A transient object that holds information used by a renderer.
+
+    It can be accessed as a dictionary or as an object with attributes
+
+    >>> c = ContextInfo({
+    ...     'element': 'some element',
+    ...     'display': 'some display',
+    ...     })
+
+    >>> c.element
+    'some element'
+
+    >>> c.display
+    'some display'
+
+    >>> c.style is None
+    True
+
+    >>> c.style = 'some style'
+    >>> c.style
+    'some style'
+
+    >>> c.contexts
+    {'display': 'some display', 'element': 'some element'}
+
+    >>> c.update({'display': 'some other display'})
+    >>> c.contexts
+    {'display': 'some other display', 'element': 'some element'}
+
+    >>> c.items()
+    [('display', 'some other display'), ('element', 'some element')]
+
+    >>> a = ContextInfo()
+    >>> b = ContextInfo({'c': 'some value'})
+    >>> a.b = b
+    >>> a.b.c
+    'some value'
+
+    """
+    implements(IContextInfo)
+
+    def __init__(self, contexts={}):
+        # to avoid creating a reference, 'contexts' is not set directly.
+        self.contexts = {}
+        self.update(contexts)
+
+    def __call__(self):
+        return self
+
+    def __getitem__(self, name):
+        return getattr(self, name)
+
+    def __setitem__(self, name, value):
+        self.contexts[name] = value
+
+    def __getattr__(self, name):
+        if name in self.contexts:
+            return self.contexts[name]
+        return None
+
+    def items(self):
+        return self.contexts.items()
+
+    def update(self, map):
+        for k, v in map.items():
+            self[k] = v
+
+    def __iter__(self):
+        return iter(self.contexts)
+
+    def __repr__(self):
+        return '<Renderer context info at %s>' % hex(id(self))
+
+def getContexts(request):
+    if 'cpsskins.contexts' not in request.annotations:
+         request.annotations['cpsskins.contexts'] = {}
+    return request.annotations['cpsskins.contexts']
+

Added: cpsskins/branches/jmo-perspectives/browser/rendering/renderer.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/browser/rendering/renderer.py    Sat Nov 
26 21:04:48 2005
@@ -0,0 +1,179 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+import logging
+
+from zope.app.publisher.browser import BrowserView
+from zope.app.zapi import getMultiAdapter, queryMultiAdapter
+from zope.component import adapts, getUtility, queryUtility
+from zope.interface import implements
+from zope.publisher.interfaces import IRequest
+
+from cpsskins import configuration
+from cpsskins.browser.rendering.context import getContexts
+from cpsskins.browser.rendering.interfaces import IRendererView, IFilterView
+from cpsskins.configuration.interfaces import IRegistry
+from cpsskins.elements.interfaces import IType, INode, IElement, ILeaf
+
+INFO = logging.INFO
+logger = logging.getLogger()
+
+class RendererView(object):
+    """A renderer is a collection of filters. It provides some rendering
+    for elements.
+    """
+    adapts(IElement, IRequest)
+    implements(IRendererView)
+
+    def __init__(self, element, request):
+        self.element = element
+        self.request = request
+
+    def __call__(self):
+        """Do the actual rendering by applying all filters.
+        """
+        element = self.element
+        request = self.request
+
+        contexts = getContexts(request)
+        tree_element = contexts['tree'][element.identifier]
+
+        # set local context info variables
+        info = tree_element['info']
+        engine = info.globals.engine
+
+        markup = ''
+        if ILeaf.providedBy(element):
+            markup = element(info) or ''
+        else:
+            rendered = []
+            for node in tree_element['children']:
+                if not INode.providedBy(node):
+                    logger.log(INFO,
+                        "The object '%s' is not a valid node." % repr(node))
+                    continue
+                renderer = getMultiAdapter((node, request), IRendererView)
+                rendered.append(renderer())
+            markup = ''.join(rendered)
+
+        # apply all the filters in sequence
+        for f in self._getFilters(info):
+            markup = f(markup, info)
+
+        return markup
+
+    def _getFilters(self, info):
+        """Get the list of filters associated to the element
+        """
+        element, request = self.element, self.request
+        engine = info.globals.engine
+        display = info.display
+
+        if display is None:
+            return []
+
+        contexts = getContexts(request)
+        relations = contexts['relations']
+
+        # look for renderers associated to the element's content type
+        iface = IType(element).getContentType()
+        name = engine + '.' + iface.__name__  # XXX create a dotted name
+        renderer = queryUtility(configuration.IRenderer, name)
+        if renderer is None:
+            # fall back to the element type
+            iface = IType(element).getElementType()
+
+        name = engine + '.' + iface.__name__ # XXX create a dotted name
+        renderer = queryUtility(configuration.IRenderer, name)
+        if renderer is None:
+            logger.log(INFO,
+                "The element '%s' cannot be rendered by the '%s' engine."
+                % (repr(element), engine))
+            return []
+
+        filters = []
+
+        for filter_name in renderer.filters:
+            filter_proxy = queryUtility(configuration.IFilter, filter_name)
+            if filter_proxy is None:
+                logger.log(INFO,
+                    "Filter '%s' is not registered." % filter_proxy)
+                continue
+
+            factory = filter_proxy.factory
+            predicate = filter_proxy.predicate
+            template = filter_proxy.template
+
+            # the filter has a dyadic predicate
+            if predicate is not None:
+                if len(predicate) != 2:
+                    logger.log(INFO,
+                        "Filter '%s' will not be applied. "
+                        "Filter predicates of arity %s are not supported."
+                        % (filter_proxy, len(predicate)))
+                    continue
+                res = relations.search(predicate=predicate, first=display)
+                if not res:
+                    continue
+                adapted = relations[res[0]].second
+
+                # get the adapter
+                filter = queryMultiAdapter(
+                    objects=(adapted,),
+                    interface=IFilterView,
+                    name=filter_name,
+                    default=None)
+
+                if filter is None:
+                    logger.log(INFO,
+                        "Filter '%s' will not be applied. "
+                        "No IFilterView adapter was found for '%s'."
+                        % (filter_name, repr(adapted)))
+                    continue
+
+            # the filter proxy uses a page template to apply to the element
+            # that is being rendered.
+            elif template is not None:
+                filter = ZPTViewFilter(element, request)
+                filter.setTemplate(template)
+
+            # the filter proxy uses a factory
+            elif factory is not None:
+                filter = factory()
+
+            else:
+                logger.log(INFO, "Filter '%s' is not supported." % 
filter_proxy)
+                continue
+
+            filters.append(filter)
+
+        return filters
+
+class ZPTViewFilter(BrowserView):
+    """A filter view that renders a zope page template.
+    """
+    def __init__(self, context, request):
+        self.context = context
+        self.request = request
+
+    def setTemplate(self, template):
+        self.template = template
+
+    def __call__(self, markup, info):
+        return self.template(self, **{'markup': markup, 'info': info})

Added: cpsskins/branches/jmo-perspectives/browser/rendering/viewer.py
==============================================================================
--- (empty file)
+++ cpsskins/branches/jmo-perspectives/browser/rendering/viewer.py      Sat Nov 
26 21:04:48 2005
@@ -0,0 +1,137 @@
+##############################################################################
+#
+# Copyright (c) 2005 Nuxeo and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+import logging
+
+from zope.app import zapi
+from zope.app.publisher.browser import BrowserView
+from zope.app.traversing.api import getParent
+from zope.app.zapi import getMultiAdapter
+from zope.component import adapts, getUtility
+from zope.interface import implements
+from zope.publisher.interfaces import IRequest
+
+from cpsskins.browser.negociation.interfaces import INegociation
+from cpsskins.browser.rendering.context import getContexts, ContextInfo
+from cpsskins.browser.rendering.interfaces import (
+    IUpdateData, IViewer, IRendererView)
+from cpsskins.configuration.interfaces import IRegistry
+from cpsskins.elements.interfaces import (
+    INodeTraverser, INode, IElement, ISlot, IDisplayable)
+from cpsskins.relations.interfaces import IRelationStorage
+
+INFO = logging.INFO
+logger = logging.getLogger()
+
+accesskey_registry = getUtility(IRegistry, 'accesskeys')
+
+class Viewer(BrowserView):
+    """An element viewer provides a view of an element which is displayed
+    in two phases:
+
+    1) by creating a tree structure that starts from the element and by
+       updating all the tree nodes recusively.
+
+    2) by rendering the tree
+
+    """
+    adapts(IElement, IRequest)
+    implements(IViewer)
+
+    def __init__(self, element, request):
+        self.element = element
+        self.request = request
+
+    def __call__(self, **kw):
+        element = self.element
+        request = self.request
+        contexts = getContexts(request)
+
+        relations = getUtility(IRelationStorage, context=element)
+        negociation = getMultiAdapter((element, request),
+                                      INegociation, 'negociation')
+        perspective = negociation.getPerspective()
+
+        contexts['relations'] = relations
+
+        # update global context info variables passed as keyword parameters
+        globals = ContextInfo(kw)
+        globals.update({
+            'perspective': perspective,
+            'request': request,
+            })
+
+        if globals.engine is None:
+            globals.engine = 'default'
+        globals.accesskeys = accesskey_registry.get(globals.engine, [])
+
+        # set the current location unless specified
+        if globals.location is None:
+            site = zapi.getSiteManager(element)
+            globals.location = zapi.getParent(site)
+
+        # build the tree and store it in the request
+        contexts['tree'] = _updateTreeInfo(node=element, globals=globals)
+
+        # render the tree
+        return getMultiAdapter((element, request), IRendererView)()
+
+def _updateTreeInfo(index={}, node=None, globals=None):
+    """Build the tree info for an element.
+    """
+
+    if not INode.providedBy(node):
+        logger.log(INFO, "The object '%s' is not a valid node." % repr(node))
+        return index
+
+    node_index = index[node.identifier] = {}
+
+    # if the object is inside a slot, get the parent's display.
+    # TODO this should be moved somewhere else
+    perspective = globals.perspective
+    display = IDisplayable(node).getEffectiveDisplay(perspective)
+    if display is None:
+        parent = getParent(node)
+        if ISlot.providedBy(parent):
+            display = IDisplayable(parent).getEffectiveDisplay(perspective)
+
+    traverser = INodeTraverser(node)
+    children = traverser.getChildNodes(display=display, 
perspective=perspective)
+
+    info = ContextInfo({
+        'element': node,
+        'display': display,
+        'data': None,
+        'metadata': None,
+        })
+
+    # set global variables
+    info.globals = globals
+
+    node_index['info'] = info
+    node_index['children'] = children
+
+    if IUpdateData.providedBy(node):
+        node.update(info)
+
+    for child in children:
+        _updateTreeInfo(index=index, node=child, globals=globals)
+
+    return index
+

Modified: cpsskins/branches/jmo-perspectives/browser/skin/template.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/skin/template.pt (original)
+++ cpsskins/branches/jmo-perspectives/browser/skin/template.pt Sat Nov 26 
21:04:48 2005
@@ -4,8 +4,9 @@
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
   </metal:block>
   <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
-  tal:define="pageview context/@@getDefaultPageView;
-              engine context/@@getEffectiveEngine">
+  tal:define="negociation nocall:context/@@negociation;
+              pageviewer negociation/getPageViewer;
+              engine negociation/getEngine">
     <head>
       <title metal:define-slot="title">CPSSkins for Zope3</title>
       <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
@@ -14,7 +15,7 @@
       <style type="text/css" media="all"
       tal:content="string:@import url(./renderCSS);"></style>
     </head>
-    <tal:block content="structure python:pageview(
+    <tal:block content="structure python:pageviewer(
       location=context,
       view=view,
       template=template,

Modified: cpsskins/branches/jmo-perspectives/browser/tree/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/browser/tree/configure.zcml      
(original)
+++ cpsskins/branches/jmo-perspectives/browser/tree/configure.zcml      Sat Nov 
26 21:04:48 2005
@@ -9,7 +9,7 @@
   <adapter
       for="cpsskins.elements.interfaces.IElement
            zope.publisher.interfaces.IRequest"
-      factory="cpsskins.browser.rendering.engine.Viewer"
+      factory="cpsskins.browser.rendering.viewer.Viewer"
       provides="cpsskins.browser.rendering.interfaces.IViewer"
   />
 

Modified: 
cpsskins/branches/jmo-perspectives/configuration/renderers/metaconfigure.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/configuration/renderers/metaconfigure.py 
(original)
+++ cpsskins/branches/jmo-perspectives/configuration/renderers/metaconfigure.py 
Sat Nov 26 21:04:48 2005
@@ -24,7 +24,7 @@
 from zope.publisher.interfaces.browser import IBrowserRequest
 
 from cpsskins import configuration
-from cpsskins.browser.rendering.engine import RendererView
+from cpsskins.browser.rendering.renderer import RendererView
 from cpsskins.browser.rendering.interfaces import IRendererView
 
 _ = MessageFactory("cpsskins")

Modified: 
cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt    
(original)
+++ cpsskins/branches/jmo-perspectives/engines/authoring/authoring_macros.pt    
Sat Nov 26 21:04:48 2005
@@ -1,6 +1,6 @@
 <metal:block define-macro="navigation_pad" i18n:domain="cpsskins">
   <div class="actionPad"
-       tal:define="actions 
current_theme/@@view_get_menu/cpsskins_authoring_actions"
+       tal:define="actions context/@@view_get_menu/cpsskins_authoring_actions"
        tal:condition="actions">
      <tal:block repeat="info actions">
        <a href="#"
@@ -26,7 +26,7 @@
 
 <metal:block define-macro="add_content_panel" i18n:domain="cpsskins">
   <table class="toolbox" cellpadding="2" cellspacing="1"
-         tal:define="portlets 
current_theme/@@view_get_menu/cpsskins_add_portlet"
+         tal:define="portlets context/@@view_get_menu/cpsskins_add_portlet"
          tal:condition="portlets">
     <tr>
       <tal:block repeat="portlet portlets">
@@ -46,7 +46,7 @@
   <form class="perspective" title="Perspective selector" 
i18n:attributes="title"
         action="@@setPerspective" method="post"
         tal:define="perspectives tmutil/listPerspectives;
-                    current context/@@getPerspective">
+                    current negociation/getPerspective">
     <select onchange="submit()" name="perspective">
       <option value="" i18n:translate="">default</option>
       <option tal:repeat="perspective perspectives"
@@ -60,7 +60,7 @@
 
 <metal:block define-macro="contextual_menu" i18n:domain="cpsskins">
   <div id="choice-context-menu" class="context-menu"
-       tal:define="perspective context/@@getPerspective">
+       tal:define="perspective negociation/getPerspective">
     <a class="edit" href="#" i18n:translate=""
        visible="editable"
        action="edit">
@@ -107,7 +107,7 @@
   <table class="topTabs" cellpadding="0" cellspacing="0" border="0" summary="">
     <tr>
       <tal:block repeat="theme themes">
-        <tal:block define="selected python: theme == current_theme">
+        <tal:block define="selected python: theme == effective_theme">
           <td tal:attributes="class python: selected and 'ltabselected' or 
'ltab'">
             <img src="" alt="" width="5" height="5"
                  tal:attributes="src string:${context/++resource++ltab.png}" />
@@ -130,7 +130,7 @@
 
 <!-- Page tabs are used to switch between pages -->
 <metal:block define-macro="pagetabs"
-  tal:define="pages current_theme/getPages">
+  tal:define="pages effective_theme/getPages">
   <ul class="pageTabs">
     <tal:block repeat="page pages">
       <li tal:define="selected python: page == effective_page"
@@ -147,8 +147,9 @@
 <metal:block define-slot="doctype"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 
1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";></metal:block>
 <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en"
   tal:define="tmutil context/@@getThemeManager;
-              current_theme context/@@getEffectiveTheme;
-              effective_page context/@@getEffectivePage">
+              negociation nocall:context/@@negociation;
+              effective_theme negociation/getTheme;
+              effective_page negociation/getPage">
   <head>
     <metal:block define-slot="css" />
     <link rel="Stylesheet" type="text/css"
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to