Author: jmorliaguet
Date: Fri Jun 16 11:48:51 2006
New Revision: 3425

Modified:
   cpsskins/branches/paris-sprint-2006/configuration/presentations/meta.zcml
   
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
   
cpsskins/branches/paris-sprint-2006/configuration/presentations/metadirectives.py
   
cpsskins/branches/paris-sprint-2006/configuration/presentations/presentation.py
   cpsskins/branches/paris-sprint-2006/elements/display.py
   cpsskins/branches/paris-sprint-2006/standard/portlets/actions/configure.zcml
   
cpsskins/branches/paris-sprint-2006/standard/portlets/breadcrumbs/configure.zcml
   cpsskins/branches/paris-sprint-2006/standard/portlets/custom/configure.zcml
   cpsskins/branches/paris-sprint-2006/standard/portlets/dummy/configure.zcml
   cpsskins/branches/paris-sprint-2006/standard/portlets/image/configure.zcml
   
cpsskins/branches/paris-sprint-2006/standard/portlets/macroslot/configure.zcml
   cpsskins/branches/paris-sprint-2006/standard/presentations.zcml

Log:

- simplifications: no need to specify the display



Modified: 
cpsskins/branches/paris-sprint-2006/configuration/presentations/meta.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/configuration/presentations/meta.zcml   
(original)
+++ cpsskins/branches/paris-sprint-2006/configuration/presentations/meta.zcml   
Fri Jun 16 11:48:51 2006
@@ -9,11 +9,6 @@
         handler=".metaconfigure.PresentationDirective">
 
       <subdirective
-          name="display"
-          schema=".metadirectives.IDisplayDirective" 
-      />
-
-      <subdirective
           name="format"
           schema=".metadirectives.IFormatDirective" 
       />

Modified: 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metaconfigure.py
    Fri Jun 16 11:48:51 2006
@@ -32,12 +32,8 @@
     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, types=None):
         self._formats[name] = types or []
 
@@ -50,12 +46,8 @@
                 "A presentation has already been registered for the"
                 "interface %s" % iface)
 
-        if not self._display:
-            raise ConfigurationError("Must specify a display type.")
-
         utility(_context=self._context, provides=iface,
-                component=configuration.Presentation(display=self._display,
-                          formats=self._formats),
+                component=configuration.Presentation(formats=self._formats),
                 name=u'presentation')
 
         registered_utilities.append(iface)

Modified: 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metadirectives.py
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metadirectives.py
   (original)
+++ 
cpsskins/branches/paris-sprint-2006/configuration/presentations/metadirectives.py
   Fri Jun 16 11:48:51 2006
@@ -32,15 +32,6 @@
         required=False,
         )
 
-class IDisplayDirective(Interface):
-
-    type = TextLine(
-        title=_(u"Type"),
-        description=_(u"The display type"),
-        required=False,
-       )
-
-
 class IFormatDirective(Interface):
 
     name = TextLine(

Modified: 
cpsskins/branches/paris-sprint-2006/configuration/presentations/presentation.py
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/configuration/presentations/presentation.py 
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/configuration/presentations/presentation.py 
    Fri Jun 16 11:48:51 2006
@@ -26,7 +26,6 @@
 
     implements(IPresentation)
 
-    def __init__(self, display, formats):
-        self.display = display
+    def __init__(self, formats):
         self.formats = formats or []
 

Modified: cpsskins/branches/paris-sprint-2006/elements/display.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/display.py     (original)
+++ cpsskins/branches/paris-sprint-2006/elements/display.py     Fri Jun 16 
11:48:51 2006
@@ -131,7 +131,7 @@
     def addDisplay(self, perspective=None):
         """Add a display to the element.
         """
-        display = self.factory()
+        display = Display()
         display = self.storeDisplay(display)
         return self.setDisplay(display=display, perspective=perspective)
 
@@ -178,17 +178,3 @@
         # remove the display
         displays.remove(display)
 
-    def factory(self):
-        """Display factory. Return a display element.
-        """
-        context = self.context
-
-        presentation = queryUtility(IType(context).getContentType(),
-                                    name=u'presentation')
-        if presentation is None:
-            presentation = queryUtility(IType(context).getElementType(),
-                                        name=u'presentation')
-
-        display = getUtility(configuration.IDisplay, presentation.display)
-        return apply(display.factory, ())
-

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/actions/configure.zcml
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/standard/portlets/actions/configure.zcml    
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/standard/portlets/actions/configure.zcml    
    Fri Jun 16 11:48:51 2006
@@ -19,10 +19,6 @@
   <presentation
       for=".portlet.IActions">
 
-    <display
-        type="box"
-    />
-
     <format
         name="widget"
         types="standard.vertical_menu"

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/breadcrumbs/configure.zcml
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/standard/portlets/breadcrumbs/configure.zcml
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/standard/portlets/breadcrumbs/configure.zcml
    Fri Jun 16 11:48:51 2006
@@ -21,10 +21,6 @@
   <presentation
        for=".portlet.IBreadcrumbs">
 
-    <display
-        type="box"
-    />
-
     <format
         name="widget"
         types="standard.horizontal_trail"

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/custom/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/portlets/custom/configure.zcml 
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/portlets/custom/configure.zcml 
Fri Jun 16 11:48:51 2006
@@ -22,10 +22,6 @@
   <presentation
        for=".portlet.ICustom">
 
-    <display
-        type="box"
-    />
-
     <format
         name="widget"
         types="standard.plain_html"

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/dummy/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/portlets/dummy/configure.zcml  
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/portlets/dummy/configure.zcml  
Fri Jun 16 11:48:51 2006
@@ -21,10 +21,6 @@
   <presentation
        for=".portlet.IDummy">
 
-    <display
-        type="box"
-    />
-
     <format
         name="widget"
         types="standard.plain_html"

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/image/configure.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/portlets/image/configure.zcml  
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/portlets/image/configure.zcml  
Fri Jun 16 11:48:51 2006
@@ -21,10 +21,6 @@
   <presentation
        for=".portlet.IImage">
 
-    <display
-        type="box"
-    />
-
     <format
         name="widget"
         types="standard.image"

Modified: 
cpsskins/branches/paris-sprint-2006/standard/portlets/macroslot/configure.zcml
==============================================================================
--- 
cpsskins/branches/paris-sprint-2006/standard/portlets/macroslot/configure.zcml  
    (original)
+++ 
cpsskins/branches/paris-sprint-2006/standard/portlets/macroslot/configure.zcml  
    Fri Jun 16 11:48:51 2006
@@ -22,10 +22,6 @@
   <presentation
        for=".portlet.IMacroSlot">
 
-    <display
-        type="box"
-    />
-
     <format
         name="widget"
         types="standard.plain_html"

Modified: cpsskins/branches/paris-sprint-2006/standard/presentations.zcml
==============================================================================
--- cpsskins/branches/paris-sprint-2006/standard/presentations.zcml     
(original)
+++ cpsskins/branches/paris-sprint-2006/standard/presentations.zcml     Fri Jun 
16 11:48:51 2006
@@ -9,10 +9,6 @@
   <cpsskins:presentation
       for="cpsskins.elements.interfaces.IThemePage">
 
-    <cpsskins:display
-        type="display"
-    />
-
     <cpsskins:format
         name="layout"
         types="page"
@@ -35,10 +31,6 @@
   <cpsskins:presentation
       for="cpsskins.elements.interfaces.IPageBlock">
 
-    <cpsskins:display
-        type="display"
-    />
-
     <cpsskins:format
         name="layout"
         types="container"
@@ -61,10 +53,6 @@
   <cpsskins:presentation
       for="cpsskins.elements.interfaces.ICell">
 
-    <cpsskins:display
-        type="display"
-    />
-
     <cpsskins:format
         name="layout"
         types="container"
@@ -87,10 +75,6 @@
   <cpsskins:presentation
       for="cpsskins.elements.interfaces.ISlot">
 
-    <cpsskins:display
-        type="display"
-    />
-
     <cpsskins:format
         name="order"
     />
@@ -118,10 +102,6 @@
   <cpsskins:presentation
       for="cpsskins.elements.interfaces.IPortlet">
 
-    <cpsskins:display
-        type="display"
-    />
-
     <cpsskins:format
         name="widget"
         types="standard.plain_html"
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to