Author: jmorliaguet
Date: Fri Oct 21 23:03:44 2005
New Revision: 28521

Added:
   
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/presentation_editor.pt
      - copied, changed from r28461, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/view_editor.pt
   z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/__init__.py
   (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/meta.zcml  
 (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/metaconfigure.py
   (contents, props changed)
   
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/metadirectives.py
   (contents, props changed)
   z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py
      - copied, changed from r28510, 
z3lab/cpsskins/branches/jmo-perspectives/elements/views.py
Removed:
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/view_editor.pt
   z3lab/cpsskins/branches/jmo-perspectives/elements/views.py
Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/edit_menu.pt
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/editing.css
   z3lab/cpsskins/branches/jmo-perspectives/configuration/meta.zcml
   z3lab/cpsskins/branches/jmo-perspectives/controllers/cell.py
   z3lab/cpsskins/branches/jmo-perspectives/controllers/pageblock.py
   z3lab/cpsskins/branches/jmo-perspectives/controllers/portlet.py
   z3lab/cpsskins/branches/jmo-perspectives/controllers/slot.py
   z3lab/cpsskins/branches/jmo-perspectives/controllers/themepage.py
   z3lab/cpsskins/branches/jmo-perspectives/elements/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py
   z3lab/cpsskins/branches/jmo-perspectives/portlets/actions/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/portlets/breadcrumbs/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/portlets/custom/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/portlets/dummy/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/portlets/image/configure.zcml
   z3lab/cpsskins/branches/jmo-perspectives/portlets/macroslot/configure.zcml
Log:

- using the notion of 'presentation' for display + formats instead of the
  notion of 'view' which is too generic

- renamed methods / class (View -> Presentation)

- added a <presentation> directive to indicate the type of display 
  and the formats to add when an element is created.



Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py      
Fri Oct 21 23:03:44 2005
@@ -35,7 +35,7 @@
 
 from interfaces import IAuthoring, IEditing
 from cpsskins.elements.interfaces import IElement
-from cpsskins.elements.interfaces import IViewable, IDisplayable, IFormattable
+from cpsskins.elements.interfaces import IPresentable, IDisplayable, 
IFormattable
 from cpsskins.browser.elements.interfaces import INodeAdding, INodeRemoving
 from cpsskins.browser.elements.interfaces import INodeMoving, INodeOrdering
 from cpsskins.browser.elements.interfaces import INodeDuplicating
@@ -98,7 +98,7 @@
         session['perspective'] = perspective
         self._redirect()
 
-    def cloneView(self, perspective=None):
+    def clonePresentation(self, perspective=None):
         """Clone a view in a given perspective by:
 
         - assigning a new display to it
@@ -111,35 +111,35 @@
         perspective = theme.getPerspectiveById(perspective)
         display = IDisplayable(self.context).getDisplay(perspective)
         if display is None:
-            IViewable(self.context).cloneView(perspective)
+            IPresentable(self.context).clonePresentation(perspective)
         self._redirect()
 
-    def addView(self, perspective=None):
+    def addPresentation(self, perspective=None):
         tmutil = getThemeManager()
         theme = tmutil.getEffectiveTheme(self.context)
         perspective = theme.getPerspectiveById(perspective)
-        IViewable(self.context).addView(perspective)
+        IPresentable(self.context).addPresentation(perspective)
         self._redirect()
 
-    def removeView(self, perspective=None):
+    def removePresentation(self, perspective=None):
         tmutil = getThemeManager()
         theme = tmutil.getEffectiveTheme(self.context)
         perspective = theme.getPerspectiveById(perspective)
-        IViewable(self.context).removeView(perspective)
+        IPresentable(self.context).removePresentation(perspective)
         self._redirect()
 
     def customizeFormat(self, name='', perspective=None):
         tmutil = getThemeManager()
         theme = tmutil.getEffectiveTheme(self.context)
         perspective = theme.getPerspectiveById(perspective)
-        IViewable(self.context).customizeFormat(name, perspective)
+        IPresentable(self.context).customizeFormat(name, perspective)
         self._redirect()
 
     def uncustomizeFormat(self, name='', perspective=None):
         tmutil = getThemeManager()
         theme = tmutil.getEffectiveTheme(self.context)
         perspective = theme.getPerspectiveById(perspective)
-        IViewable(self.context).uncustomizeFormat(name, perspective)
+        IPresentable(self.context).uncustomizeFormat(name, perspective)
         self._redirect()
 
 class Editing(BrowserView):

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/configure.zcml   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/configure.zcml   
Fri Oct 21 23:03:44 2005
@@ -141,18 +141,18 @@
       />
 
       <page
-          name="cloneView"
-          attribute="cloneView"
+          name="clonePresentation"
+          attribute="clonePresentation"
       />
 
       <page
-          name="addView"
-          attribute="addView"
+          name="addPresentation"
+          attribute="addPresentation"
       />
 
       <page
-          name="removeView"
-          attribute="removeView"
+          name="removePresentation"
+          attribute="removePresentation"
       />
 
       <page
@@ -227,14 +227,14 @@
   </pages>
 
 
-  <!-- View editor -->
+  <!-- Presentation editor -->
 
   <page
       layer="cpsskins"
       for="cpsskins.elements.IElement"
-      name="view-editor.html"
+      name="presentation-editor.html"
       permission="zope.ManageContent"
-      template="view_editor.pt"
+      template="presentation_editor.pt"
   />
 
 

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/edit_menu.pt
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/edit_menu.pt     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/edit_menu.pt     
Fri Oct 21 23:03:44 2005
@@ -47,10 +47,10 @@
 
     <div style="clear:both"></div>
 
-    <div class="views">
-      <a href="@@edit-menu.html?main_url=@@view-editor.html"
-         title="View editor">
-         Manage views
+    <div class="presentations">
+      <a href="@@edit-menu.html?main_url=@@presentation-editor.html"
+         title="Presentation editor">
+         Manage presentations
       </a>
     </div>
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/editing.css
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/editing.css      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/editing.css      
Fri Oct 21 23:03:44 2005
@@ -204,30 +204,30 @@
   color: #000;
 }
 
-.views {
+.presentations {
   font: 11px Verdana, Arial, Sans-Serif;
   position: absolute;
   top: 55px;
   right: 26px;
 }
 
-.views a, .views a:visited {
+.presentations a, .presentations a:visited {
   text-decoration: none;
   text-transform: lowercase;
   color: #006;
 }
 
-.views img {
+.presentations img {
   border: none;
   vertical-align: middle;
   padding-right: 4px;
 }
 
-.views input {
+.presentations input {
   display: none;
 }
 
-.views label {
+.presentations label {
   font: 12px "Trebuchet MS", Verdana, Arial, Sans-Serif;
   padding: 0.1em 0.4em 0.1em 0.4em;
   background: #fff;
@@ -237,12 +237,12 @@
   -moz-border-radius: 2px;
 }
 
-.views label.selected {
+.presentations label.selected {
   background: #ff9;
   color: #333;
 }
 
-.views label:hover {
+.presentations label:hover {
   background: #ffc;
 }
 
@@ -442,7 +442,7 @@
 }
 
 
-/* View editor */
+/* Presentation editor */
 
 .effective {
   background-color: #efc;

Copied: 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/presentation_editor.pt
 (from r28461, 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/view_editor.pt)
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/view_editor.pt   
(original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/presentation_editor.pt
   Fri Oct 21 23:03:44 2005
@@ -1,13 +1,13 @@
 <html metal:use-macro="context/@@popup_macros/page">
   <body metal:fill-slot="body" i18n:domain="cpsskins">
     <div class="editArea"
-         tal:define="info context/viewable:getViewInfo;
+         tal:define="info context/presentable:getPresentationInfo;
                      views info/views;
                      current_perspective context/@@getPerspective;
                      default_view views/default|nothing;
                      format_names info/format_names">
 
-      <h1>View editor</h1>
+      <h1>Presentation editor</h1>
 
       <p tal:condition="not:default_view">No view is directly associated with 
this element.</p>
 
@@ -15,10 +15,10 @@
             action="." tal:attributes="action request/URL" method="post"
             enctype="multipart/form-data">
 
-        <p>The views associated to this element are listed in the table 
below:</p>
+        <p>The presentations associated to this element are listed in the 
table below:</p>
         <table class="inline" cellpadding="0" cellspacing="1">
           <tr>
-            <th>View</th>
+            <th>Presentation</th>
             <th>Display</th>
             <th style="text-align: center"
                 tal:repeat="format_name format_names">
@@ -44,12 +44,12 @@
                 <tal:block condition="perspective">
                   <a title="Add view"
                      tal:condition="not:display"
-                     tal:attributes="href 
string:@@cloneView?perspective=$perspective">
+                     tal:attributes="href 
string:@@clonePresentation?perspective=$perspective">
                     <img src="/++skin++cpsskins/@@/add-16.png" />
                   </a>
                   <a tal:condition="display"
                      title="Remove view" onclick="return window.confirm('Are 
you sure?')"
-                     tal:attributes="href 
string:@@removeView?perspective=$perspective">
+                     tal:attributes="href 
string:@@removePresentation?perspective=$perspective">
                     <img src="/++skin++cpsskins/@@/remove-16.png" />
                   </a>
                 </tal:block>

Modified: z3lab/cpsskins/branches/jmo-perspectives/configuration/meta.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/configuration/meta.zcml    
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/configuration/meta.zcml    Fri Oct 
21 23:03:44 2005
@@ -8,6 +8,8 @@
 
   <include package=".renderers" file="meta.zcml" />
 
+  <include package=".presentations" file="meta.zcml" />
+
   <include package=".storages" file="meta.zcml" />
 
   <include package=".formats" file="meta.zcml" />

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/__init__.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/__init__.py
    Fri Oct 21 23:03:44 2005
@@ -0,0 +1,31 @@
+##############################################################################
+#
+# 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.component import provideUtility
+from zope.interface import implements
+
+from cpsskins.configuration import ConfigurationRegistry
+from cpsskins.configuration.interfaces import IRegistry
+
+class PresentationRegistry(ConfigurationRegistry):
+    """A Renderer registry stores information about presentations.
+    """
+    implements(IRegistry)
+
+provideUtility(PresentationRegistry(), IRegistry, 'presentations')

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/meta.zcml
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/meta.zcml  
    Fri Oct 21 23:03:44 2005
@@ -0,0 +1,25 @@
+
+<configure xmlns="http://namespaces.zope.org/meta";>
+
+  <directives namespace="http://namespaces.zope.org/cpsskins";>
+
+    <complexDirective
+        name="presentation"
+        schema=".metadirectives.IPresentationDirective"
+        handler=".metaconfigure.Presentation">
+
+      <subdirective
+          name="display"
+          schema=".metadirectives.IDisplayDirective" 
+      />
+
+      <subdirective
+          name="format"
+          schema=".metadirectives.IFormatDirective" 
+      />
+
+    </complexDirective>
+
+  </directives>
+
+</configure>

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/metaconfigure.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/metaconfigure.py
       Fri Oct 21 23:03:44 2005
@@ -0,0 +1,51 @@
+##############################################################################
+#
+# 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.app.component.metaconfigure import adapter
+from zope.component import getUtility
+from zope.configuration.exceptions import ConfigurationError
+from zope.i18nmessageid import MessageFactory
+from zope.publisher.interfaces.browser import IBrowserRequest
+
+from cpsskins.configuration.interfaces import IRegistry
+from cpsskins.browser.rendering.engine import Renderer as RenderingEngine
+from cpsskins.browser.rendering.interfaces import IRenderer
+
+_ = MessageFactory("cpsskins")
+
+presentation_registry = getUtility(IRegistry, 'presentations')
+
+class Presentation(object):
+
+    def __init__(self, _context, for_):
+        self._context = _context
+        self.for_ = for_
+        self._display = None
+        self._formats = {}
+
+    def display(self, _context, type):
+        self._display = type
+
+    def format(self, _context, name, id=''):
+        self._formats[name] = id
+
+    def __call__(self, iface):
+        presentation_registry.register((iface,),
+            {'display': self._display, 'formats': self._formats})
+

Added: 
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/metadirectives.py
==============================================================================
--- (empty file)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/configuration/presentations/metadirectives.py
      Fri Oct 21 23:03:44 2005
@@ -0,0 +1,57 @@
+##############################################################################
+#
+# 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.configuration.fields import GlobalObject, Tokens
+from zope.interface import Interface
+from zope.i18nmessageid import MessageFactory
+from zope.schema import TextLine
+
+_ = MessageFactory("cpsskins")
+
+class IPresentationDirective(Interface):
+
+    for_ = GlobalObject(
+        title=_("The presented element"),
+        description=_("The interface of the element to present."),
+        required=False,
+        )
+
+class IDisplayDirective(Interface):
+
+    type = TextLine(
+        title=_("Type"),
+        description=_("The display type"),
+        required=False,
+       )
+
+
+class IFormatDirective(Interface):
+
+    name = TextLine(
+        title=_("Name"),
+        description=_("The format's name"),
+        required=False,
+       )
+
+    id = TextLine(
+        title=_("Id"),
+        description=_("The format's id"),
+        required=False,
+       )
+

Modified: z3lab/cpsskins/branches/jmo-perspectives/controllers/cell.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/controllers/cell.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/controllers/cell.py        Fri Oct 
21 23:03:44 2005
@@ -20,7 +20,7 @@
 from zope.interface import implements
 
 from cpsskins.controllers import Controller
-from cpsskins.elements.interfaces import IViewable
+from cpsskins.elements.interfaces import IPresentable
 from cpsskins.thememanager import getThemeManager
 from interfaces import IController
 
@@ -32,7 +32,7 @@
     def added(self):
         """What to do when the element has been added.
         """
-        IViewable(self.element).addView()
+        IPresentable(self.element).addPresentation()
 
     def removed(self):
         """What to do when the element has been removed.

Modified: z3lab/cpsskins/branches/jmo-perspectives/controllers/pageblock.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/controllers/pageblock.py   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/controllers/pageblock.py   Fri Oct 
21 23:03:44 2005
@@ -21,7 +21,7 @@
 
 from cpsskins.controllers import Controller
 from cpsskins.thememanager import getThemeManager
-from cpsskins.elements.interfaces import IViewable
+from cpsskins.elements.interfaces import IPresentable
 from interfaces import IController
 
 class PageBlockController(Controller):
@@ -32,7 +32,7 @@
     def added(self):
         """What to do when the element has been added.
         """
-        IViewable(self.element).addView()
+        IPresentable(self.element).addPresentation()
 
     def removed(self):
         """What to do when the element has been removed.

Modified: z3lab/cpsskins/branches/jmo-perspectives/controllers/portlet.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/controllers/portlet.py     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/controllers/portlet.py     Fri Oct 
21 23:03:44 2005
@@ -22,7 +22,7 @@
 
 from cpsskins.controllers import Controller
 from cpsskins.elements.interfaces import ICell
-from cpsskins.elements.interfaces import IViewable
+from cpsskins.elements.interfaces import IPresentable
 from cpsskins.thememanager import getThemeManager
 from interfaces import IController
 
@@ -43,7 +43,7 @@
 
         # only portlets located in cells have their own display
         if ICell.providedBy(parent):
-            IViewable(self.element).addView()
+            IPresentable(self.element).addPresentation()
 
     def removed(self):
         """What to do when the element has been removed.

Modified: z3lab/cpsskins/branches/jmo-perspectives/controllers/slot.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/controllers/slot.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/controllers/slot.py        Fri Oct 
21 23:03:44 2005
@@ -20,7 +20,7 @@
 from zope.interface import implements
 
 from cpsskins.controllers import Controller
-from cpsskins.elements.interfaces import IViewable, IDisplayable
+from cpsskins.elements.interfaces import IPresentable, IDisplayable
 from cpsskins.thememanager import getThemeManager
 from interfaces import IController
 
@@ -32,7 +32,7 @@
     def added(self):
         """What to do when the element has been added.
         """
-        IViewable(self.element).addView()
+        IPresentable(self.element).addPresentation()
 
     def removed(self):
         """What to do when the element has been removed.
@@ -44,4 +44,4 @@
         """What to do when the element has been modified.
         """
         if IDisplayable(self.element).getDisplay() is None:
-            IViewable(self.element).addView()
+            IPresentable(self.element).addPresentation()

Modified: z3lab/cpsskins/branches/jmo-perspectives/controllers/themepage.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/controllers/themepage.py   
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/controllers/themepage.py   Fri Oct 
21 23:03:44 2005
@@ -20,7 +20,7 @@
 from zope.interface import implements
 
 from cpsskins.controllers import Controller
-from cpsskins.elements.interfaces import IViewable
+from cpsskins.elements.interfaces import IPresentable
 from cpsskins.thememanager import getThemeManager
 from interfaces import IController
 
@@ -37,7 +37,7 @@
         if tmutil.getDefaultPage() is None:
             tmutil.setAsDefault(element)
 
-        IViewable(self.element).addView()
+        IPresentable(self.element).addPresentation()
 
     def removed(self):
         """What to do when the element has been removed.

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/configure.zcml    
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/configure.zcml    Fri Oct 
21 23:03:44 2005
@@ -12,19 +12,19 @@
       provides="zope.app.container.interfaces.INameChooser"
   />
 
-  <!-- this adapter makes elements viewable -->
+  <!-- this adapter makes elements presentable -->
 
   <adapter
-      provides=".interfaces.IViewable"
+      provides=".interfaces.IPresentable"
       for=".interfaces.IElement"
-      factory=".views.Viewable"
+      factory=".presentation.Presentable"
   />
 
   <adapter
-      name="viewable"
+      name="presentable"
       provides="zope.app.traversing.interfaces.IPathAdapter"
       for=".interfaces.IElement"
-      factory=".views.Viewable"
+      factory=".presentation.Presentable"
   />
 
 

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/interfaces.py     Fri Oct 
21 23:03:44 2005
@@ -137,20 +137,20 @@
     def storeFormat(format):
         """Add a format to the format storage."""
 
-class IViewable(Interface):
-    """Viewable elements can be displayed and formatted."""
+class IPresentable(Interface):
+    """Presentable elements can be displayed and formatted."""
 
-    def getViewInfo():
+    def getPresentationInfo():
         """Return a dictionary with information about display and formats 
         associated to the element in various views / perspectives."""
 
-    def addView(perspective):
+    def addPresentation(perspective):
         """ """
 
-    def cloneView(perspective):
+    def clonePresentation(perspective):
         """ """
 
-    def removeView(perspective):
+    def removePresentation(perspective):
         """ """
 
     def customizeFormat(name, perspective):

Copied: z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py (from 
r28510, z3lab/cpsskins/branches/jmo-perspectives/elements/views.py)
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/views.py  (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/presentation.py   Fri Oct 
21 23:03:44 2005
@@ -27,16 +27,16 @@
 from cpsskins.ontology import hasFormat, hasDisplay, hasDisplayFromPerspective
 from cpsskins.relations.tool import RelationTool
 from cpsskins.thememanager import getThemeManager
-from interfaces import IViewable
+from interfaces import IPresentable
 
 format_registry = getUtility(IRegistry, 'formats')
 
-class Viewable(object):
-    """This adapter makes elements viewable, i.e. displayable and formattable
+class Presentable(object):
+    """This adapter makes elements presentable, i.e. displayable and 
formattable
     according to the factory settings.
 
     """
-    implements(IViewable, IPathAdapter)
+    implements(IPresentable, IPathAdapter)
 
     def __init__(self, context):
         self.context = context
@@ -46,12 +46,12 @@
         """
         return self
 
-    def addView(self, perspective=None):
-        """Add a view to an element, i.e.:
+    def addPresentation(self, perspective=None):
+        """Add a presentation to an element, i.e.:
 
-        - a factory display
+        - a display
 
-        - the factory formats associated to the display
+        - the formats associated to the display
 
         """
         context = self.context
@@ -65,11 +65,11 @@
         for type, id in factory_info['formats'].items():
             formattable.addFormat(type, id)
 
-    def cloneView(self, perspective=None):
-        """Clone the default view of an element.
+    def clonePresentation(self, perspective=None):
+        """Clone the default presentation of an element.
 
-        This is similar to addView() except that the formats of the cloned
-        view are used in the new view.
+        This is similar to addPresentation() except that the formats of the
+        cloned presentation are used in the new presentation.
 
         """
         if perspective is None:
@@ -89,8 +89,8 @@
             format = rel.second
             formattable.setFormat(format)
 
-    def removeView(self, perspective=None):
-        """Remove a view associated to an element.
+    def removePresentation(self, perspective=None):
+        """Remove a presentation associated to an element.
         """
         context = self.context
         displayable = IDisplayable(context)
@@ -134,7 +134,7 @@
         default_format = IFormattable(default_display).getFormat(name)
         IFormattable(display).setFormat(default_format)
 
-    def getViewInfo(self):
+    def getPresentationInfo(self):
         """Return a dictionary with information about display and formats 
         associated to the element in various views / perspectives.
         """

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/portlets/actions/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/actions/configure.zcml    
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/actions/configure.zcml    
Fri Oct 21 23:03:44 2005
@@ -1,13 +1,13 @@
 <configure
-    xmlns="http://namespaces.zope.org/zope";
+    xmlns="http://namespaces.zope.org/cpsskins";
+    xmlns:zope="http://namespaces.zope.org/zope";
     xmlns:i18n="http://namespaces.zope.org/i18n";
-    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
     i18n_domain="cpsskins"
     >
 
   <!-- Actions portlet -->
 
-  <cpsskins:portlet
+  <portlet
       name="actions"
       title="Actions portlet"
       description="A portlet that displays actions"
@@ -16,8 +16,26 @@
       icon="actions-icon.png"
   />
 
-  <adapter
+  <zope:adapter
       factory=".ActionsPortletData"
   />
 
+  <presentation
+      for=".IActionsPortlet">
+
+    <display
+        type="box"
+    />
+
+    <format
+        name="widget"
+        id="vertical_menu"
+    />
+
+    <format
+        name="style"
+    />
+
+  </presentation>
+
 </configure>

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/portlets/breadcrumbs/configure.zcml
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/portlets/breadcrumbs/configure.zcml    
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/portlets/breadcrumbs/configure.zcml    
    Fri Oct 21 23:03:44 2005
@@ -1,13 +1,13 @@
 <configure
-    xmlns="http://namespaces.zope.org/zope";
-    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
+    xmlns="http://namespaces.zope.org/cpsskins";
+    xmlns:zope="http://namespaces.zope.org/zope";
     xmlns:i18n="http://namespaces.zope.org/i18n";
     i18n_domain="cpsskins"
     >
 
   <!-- Breadcumbs portlet -->
 
-  <cpsskins:portlet
+  <portlet
       name="breadcrumbs"
       title="Breadcrumbs portlet"
       description="A portlet that displays a navigation trail"
@@ -16,8 +16,30 @@
       icon="breadcrumbs-icon.png"
   />
 
-  <adapter
+
+  <zope:adapter
       factory=".BreadcrumbsPortletData"
   />
 
+
+  <!-- The portlet's presentation -->
+
+  <presentation
+       for=".IBreadcrumbsPortlet">
+
+    <display
+        type="box"
+    />
+
+    <format
+        name="widget"
+        id="vertical_menu"
+    />
+
+    <format
+        name="style"
+    />
+
+  </presentation>
+
 </configure>

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/portlets/custom/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/custom/configure.zcml     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/custom/configure.zcml     
Fri Oct 21 23:03:44 2005
@@ -1,13 +1,13 @@
 <configure
-    xmlns="http://namespaces.zope.org/zope";
+    xmlns="http://namespaces.zope.org/cpsskins";
+    xmlns:zope="http://namespaces.zope.org/zope";
     xmlns:i18n="http://namespaces.zope.org/i18n";
-    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
     i18n_domain="cpsskins"
     >
 
   <!-- Custom portlet -->
 
-  <cpsskins:portlet
+  <portlet
       name="custom"
       title="Custom portlet"
       description="A portlet that displays a python, ZPT, DTML page"
@@ -16,8 +16,30 @@
       icon="custom-icon.png"
   />
 
-  <adapter
+
+  <zope:adapter
       factory=".CustomPortletData"
   />
 
+
+  <!-- The portlet's presentation -->
+
+  <presentation
+       for=".ICustomPortlet">
+
+    <display
+        type="box"
+    />
+
+    <format
+        name="widget"
+        id="vertical_menu"
+    />
+
+    <format
+        name="style"
+    />
+
+  </presentation>
+
 </configure>

Modified: z3lab/cpsskins/branches/jmo-perspectives/portlets/dummy/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/dummy/configure.zcml      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/dummy/configure.zcml      
Fri Oct 21 23:03:44 2005
@@ -1,23 +1,46 @@
 <configure
-    xmlns="http://namespaces.zope.org/zope";
+    xmlns="http://namespaces.zope.org/cpsskins";
+    xmlns:zope="http://namespaces.zope.org/zope";
     xmlns:i18n="http://namespaces.zope.org/i18n";
-    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
     i18n_domain="cpsskins"
     >
 
   <!-- Dummy portlet -->
 
-  <cpsskins:portlet
+  <portlet
       name="dummy"
       title="Dummy portlet"
       description="A portlet for testing"
       factory=".DummyPortlet"
       schema=".IDummyPortlet"
-      icon="dummy-icon.png"
-  />
+      icon="dummy-icon.png">
+
+  </portlet>
+
 
-  <adapter
+  <zope:adapter
       factory=".DummyPortletData"
   />
 
+
+  <!-- The portlet's presentation -->
+
+  <presentation
+       for=".IDummyPortlet">
+
+    <display
+        type="box"
+    />
+
+    <format
+        name="widget"
+        id="plain_html"
+    />
+
+    <format
+        name="style"
+    />
+
+  </presentation>
+
 </configure>

Modified: z3lab/cpsskins/branches/jmo-perspectives/portlets/image/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/image/configure.zcml      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/image/configure.zcml      
Fri Oct 21 23:03:44 2005
@@ -1,13 +1,13 @@
 <configure
-    xmlns="http://namespaces.zope.org/zope";
+    xmlns="http://namespaces.zope.org/cpsskins";
     xmlns:i18n="http://namespaces.zope.org/i18n";
-    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
+    xmlns:zope="http://namespaces.zope.org/zope";
     i18n_domain="cpsskins"
     >
 
   <!-- Image portlet -->
 
-  <cpsskins:portlet
+  <portlet
       name="image"
       title="Image portlet"
       description="A portlet that displays an image"
@@ -16,8 +16,34 @@
       icon="image-icon.png"
   />
 
-  <adapter
+  <zope:adapter
       factory=".ImagePortletData"
   />
 
+
+  <!-- The portlet's presentation -->
+
+  <presentation
+       for=".IImagePortlet">
+
+    <display
+        type="box"
+    />
+
+    <format
+        name="widget"
+        id="image"
+    />
+
+    <format
+        name="style"
+    />
+
+    <format
+        name="effect"
+        id="scale"
+    />
+
+  </presentation>
+
 </configure>

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/portlets/macroslot/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/portlets/macroslot/configure.zcml  
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/portlets/macroslot/configure.zcml  
Fri Oct 21 23:03:44 2005
@@ -1,14 +1,14 @@
 <configure
-    xmlns="http://namespaces.zope.org/zope";
+    xmlns="http://namespaces.zope.org/cpsskins";
     xmlns:browser="http://namespaces.zope.org/browser";
     xmlns:i18n="http://namespaces.zope.org/i18n";
-    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
+    xmlns:zope="http://namespaces.zope.org/zope";
     i18n_domain="cpsskins"
     >
 
   <!-- Macro slot portlet -->
 
-  <cpsskins:portlet
+  <portlet
       name="macroslot"
       title="Macro slot portlet"
       description="A portlet that displays the main content area of a page"
@@ -17,10 +17,31 @@
       icon="macroslot-icon.png"
   />
 
-  <adapter
+  <zope:adapter
       factory=".MacroSlotPortletData"
   />
 
+
+  <!-- The portlet's presentation -->
+
+  <presentation
+       for=".IMacroSlotPortlet">
+
+    <display
+        type="box"
+    />
+
+    <format
+        name="widget"
+        id="plain_html"
+    />
+
+    <format
+        name="style"
+    />
+
+  </presentation>
+
   <browser:page
       for=".IMacroSlotPortlet"
       name="macroSlotEditor"
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to