Author: jmorliaguet
Date: Sun Dec 11 18:33:53 2005
New Revision: 2014

Modified:
   cpsskins/branches/jmo-perspectives/configuration/displays/metaconfigure.py
   cpsskins/branches/jmo-perspectives/configuration/widgets/metaconfigure.py
   cpsskins/branches/jmo-perspectives/configuration/widgets/metadirectives.py
   cpsskins/branches/jmo-perspectives/configuration/widgets/widget.py
   cpsskins/branches/jmo-perspectives/elements/display.py
   cpsskins/branches/jmo-perspectives/engines/default/displays/interfaces.py
   
cpsskins/branches/jmo-perspectives/engines/default/filters/widget/widgets.zcml
Log:

- 'id' is now called 'type'

- removed IDisplayType (which only duplicates already available
  information)



Modified: 
cpsskins/branches/jmo-perspectives/configuration/displays/metaconfigure.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/configuration/displays/metaconfigure.py  
(original)
+++ cpsskins/branches/jmo-perspectives/configuration/displays/metaconfigure.py  
Sun Dec 11 18:33:53 2005
@@ -26,7 +26,7 @@
 from zope.interface import alsoProvides
 
 from cpsskins import configuration
-from cpsskins.elements.interfaces import IElementType, IDisplayType
+from cpsskins.elements.interfaces import IElementType
 from cpsskins.elements.interfaces import IDisplay
 
 def display(_context, name=u'', schema=None, factory=None):
@@ -74,7 +74,6 @@
     # set up interface types
     alsoProvides(IDisplay, IElementType)
     alsoProvides(schema, IContentType)
-    alsoProvides(schema, IDisplayType)
 
     schema.setTaggedValue('name', name)
 

Modified: 
cpsskins/branches/jmo-perspectives/configuration/widgets/metaconfigure.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/configuration/widgets/metaconfigure.py   
(original)
+++ cpsskins/branches/jmo-perspectives/configuration/widgets/metaconfigure.py   
Sun Dec 11 18:33:53 2005
@@ -29,24 +29,22 @@
 
 _ = MessageFactory("cpsskins")
 
-registered_adapters = []
+def widget(_context=None, type=None, title=None, view=None):
 
-def widget(_context=None, id=None, title=None, factory=None):
-
-    if not id:
-        raise ConfigurationError("Must specify the widget id.")
+    if not type:
+        raise ConfigurationError("Must specify the widget type.")
 
     if not title:
         raise ConfigurationError("Must specify a widget title.")
 
-    if not factory:
-        raise ConfigurationError("Must specify a widget factory.")
+    if not view:
+        raise ConfigurationError("Must specify a widget view.")
 
     # register widgets
-    provideUtility(configuration.Widget(id=id, title=title, factory=factory),
-                   configuration.IWidget, id)
+    provideUtility(configuration.Widget(type=type, title=title, view=view),
+                   configuration.IWidget, type)
 
     # zope:adapter
-    adapter(_context=_context, factory=(factory,), provides=IWidgetView,
-            for_=(IWidget, IBrowserRequest), name=id)
+    adapter(_context=_context, factory=(view,), provides=IWidgetView,
+            for_=(IWidget, IBrowserRequest), name=type)
 

Modified: 
cpsskins/branches/jmo-perspectives/configuration/widgets/metadirectives.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/configuration/widgets/metadirectives.py  
(original)
+++ cpsskins/branches/jmo-perspectives/configuration/widgets/metadirectives.py  
Sun Dec 11 18:33:53 2005
@@ -26,23 +26,23 @@
 
 class IWidgetDirective(Interface):
 
-    id = TextLine(
-        title=_(u"Id"),
-        description=_(u"The widget's id"),
+    type = TextLine(
+        title=_(u"Type"),
+        description=_(u"The widget type."),
         required=False,
         default=u'',
-       )
+        )
 
     title = TextLine(
         title=_(u"Title"),
         description=_(u"The widget's title"),
         required=False,
         default=u'',
-       )
+        )
 
-    factory = GlobalObject(
-        title=_(u"Factory"),
-        description=_(u"Widget factory"),
+    view = GlobalObject(
+        title=_(u"View"),
+        description=_(u"Widget view"),
         required=False,
         )
 

Modified: cpsskins/branches/jmo-perspectives/configuration/widgets/widget.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/configuration/widgets/widget.py  
(original)
+++ cpsskins/branches/jmo-perspectives/configuration/widgets/widget.py  Sun Dec 
11 18:33:53 2005
@@ -26,9 +26,8 @@
     """
     implements(IWidget)
 
-    def __init__(self, id=u'', title=u'', type=None, factory=None):
-        self.id = id
-        self.title = title
+    def __init__(self, type=u'', title=u'', view=None):
         self.type = type
-        self.factory = factory
+        self.title = title
+        self.view = view
 

Modified: cpsskins/branches/jmo-perspectives/elements/display.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/elements/display.py      (original)
+++ cpsskins/branches/jmo-perspectives/elements/display.py      Sun Dec 11 
18:33:53 2005
@@ -27,7 +27,7 @@
 from cpsskins import configuration
 from cpsskins.elements import Element
 from cpsskins.elements.interfaces import IType
-from cpsskins.elements.interfaces import IDisplayable, IDisplay, IDisplayType
+from cpsskins.elements.interfaces import IDisplayable, IDisplay
 from cpsskins.perspectives.interfaces import IPerspective
 from cpsskins.relations import DyadicRelation, TriadicRelation
 from cpsskins.relations.interfaces import IRelationTool
@@ -41,9 +41,6 @@
     def __iter__(self):
         return iter([])
 
-    def getDisplayType(self):
-        return queryType(self, IDisplayType)
-
 class Displayable(object):
     """This adapter makes elements displayable.
 

Modified: 
cpsskins/branches/jmo-perspectives/engines/default/displays/interfaces.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/engines/default/displays/interfaces.py   
(original)
+++ cpsskins/branches/jmo-perspectives/engines/default/displays/interfaces.py   
Sun Dec 11 18:33:53 2005
@@ -26,6 +26,4 @@
 class IDisplayStorage(IStorage):
     contains(IDisplay)
 
-class IDisplayType(IInterface):
-    """The display type categorizes displays elements."""
 

Modified: 
cpsskins/branches/jmo-perspectives/engines/default/filters/widget/widgets.zcml
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/engines/default/filters/widget/widgets.zcml  
    (original)
+++ 
cpsskins/branches/jmo-perspectives/engines/default/filters/widget/widgets.zcml  
    Sun Dec 11 18:33:53 2005
@@ -5,26 +5,26 @@
   <!-- Plain widget views -->
 
   <widget
-      id="plain_html"
-      factory=".widgets.BasicHTMLView"
+      type="plain_html"
+      view=".widgets.BasicHTMLView"
       title="Basic HTML view"
   />
 
   <widget
-      id="plain_image"
-      factory=".widgets.BasicImageView"
+      type="plain_image"
+      view=".widgets.BasicImageView"
       title="Basic image view"
   />
 
   <widget
-      id="plain_item"
-      factory=".widgets.BasicItemView"
+      type="plain_item"
+      view=".widgets.BasicItemView"
       title="Basic item view"
   />
 
   <widget
-      id="plain_items"
-      factory=".widgets.BasicItemsView"
+      type="plain_items"
+      view=".widgets.BasicItemsView"
       title="Basic items view"
   />
 
@@ -32,105 +32,105 @@
   <!-- Page widget views -->
 
   <widget
-      id="page_body"
+      type="page_body"
       title="Page body"
-      factory=".widgets.PageBody"
+      view=".widgets.PageBody"
   />
 
 
   <!-- Frame widget views -->
 
   <widget
-      id="table_frame"
+      type="table_frame"
       title="Table frame"
-      factory=".widgets.TableFrame"
+      view=".widgets.TableFrame"
   />
 
   <widget
-      id="div_frame"
+      type="div_frame"
       title="Div frame"
-      factory=".widgets.DivFrame"
+      view=".widgets.DivFrame"
   />
 
 
   <!-- Cell widget views -->
 
   <widget
-      id="table_cell"
+      type="table_cell"
       title="Table cell"
-      factory=".widgets.TableCell"
+      view=".widgets.TableCell"
   />
 
   <widget
-      id="div_cell"
+      type="div_cell"
       title="Div cell"
-      factory=".widgets.DivCell"
+      view=".widgets.DivCell"
   />
 
   <widget
-      id="horizontal_scrollbar"
+      type="horizontal_scrollbar"
       title="Horizontal scroll bar"
-      factory=".widgets.HorizontalScrollBar"
+      view=".widgets.HorizontalScrollBar"
   />
 
 
   <!-- Menu widget views -->
 
   <widget
-      id="vertical_menu"
+      type="vertical_menu"
       title="Vertical menu"
-      factory=".widgets.VerticalMenu"
+      view=".widgets.VerticalMenu"
   />
 
   <widget
-      id="horizontal_tabs"
+      type="horizontal_tabs"
       title="Horizontal tabs"
-      factory=".widgets.HorizontalTabs"
+      view=".widgets.HorizontalTabs"
   />
 
   <widget
-      id="menu_bar"
+      type="menu_bar"
       title="Menu bar"
-      factory=".widgets.MenuBar"
+      view=".widgets.MenuBar"
   />
 
   <widget
-      id="horizontal_trail"
+      type="horizontal_trail"
       title="Horizontal trail"
-      factory=".widgets.HorizontalTrail"
+      view=".widgets.HorizontalTrail"
   />
 
   <widget
-      id="dropdown_list"
+      type="dropdown_list"
       title="Drop-down list"
-      factory=".widgets.DropDownList"
+      view=".widgets.DropDownList"
   />
 
 
   <!-- Plain views -->
 
   <widget
-      id="frame_box"
+      type="frame_box"
       title="Frame box"
-      factory=".widgets.FrameBox"
+      view=".widgets.FrameBox"
   />
 
 
   <!-- Calendar widget views -->
 
   <widget
-      id="monthly_calendar"
+      type="monthly_calendar"
       title="Monthly calendar"
-      factory=".widgets.MonthlyCalendar"
+      view=".widgets.MonthlyCalendar"
   />
 
 
   <!-- Image widget views -->
 
   <widget
-      id="image"
+      type="image"
       title="Image"
-      factory=".widgets.Image"
+      view=".widgets.Image"
   />
 
 </configure>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to