Author: jmorliaguet
Date: Wed Oct 19 20:35:08 2005
New Revision: 28443

Added:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example5/
Modified:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/hello.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/configure.zcml
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/configure.zcml
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/configure.zcml
Log:

- interfaces / adapters are declared in the code.



Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/hello.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/hello.py        (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/hello.py        Wed Oct 19 
20:35:08 2005
@@ -17,7 +17,6 @@
 """
 __docformat__ = "reStructuredText"
 
-
 from zope.component import adapts
 from zope.interface import implements
 

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/configure.zcml
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/configure.zcml  (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/configure.zcml  Wed Oct 19 
20:35:08 2005
@@ -12,7 +12,6 @@
       description="A simple text portlet"
       factory=".text.TextPortlet"
       schema=".text.ITextPortlet"
-      data=".text.TextPortletData"
       icon="text-icon.png"
   />
 

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py Wed Oct 19 20:35:08 2005
@@ -17,6 +17,8 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.component import adapts
+from zope.interface import implements
 from zope.schema import Text
 
 from cpsskins.elements.interfaces import IPortlet
@@ -32,12 +34,17 @@
 class TextPortlet(Portlet):
     """The Text portlet displays some text entered by the user.
     """
+    implements(ITextPortlet)
+
     def __init__(self, text=''):
         self.text = text
 
 class TextPortletData(object):
     """The portlet returns the text entered by the user.
     """
+    adapts(ITextPortlet, IContextInfo)
+    implements(IDisplayData)
+
     def __init__(self, portlet, info):
         self.portlet = portlet
         self.info = info

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/configure.zcml
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/configure.zcml  (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/configure.zcml  Wed Oct 19 
20:35:08 2005
@@ -12,7 +12,6 @@
       description="A portlet that returns a list of items"
       factory=".items.ItemsPortlet"
       schema=".items.IItemsPortlet"
-      data=".items.ItemsPortletData"
       icon="items-icon.png"
   />
 

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py        (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py        Wed Oct 19 
20:35:08 2005
@@ -17,6 +17,9 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.component import adapts
+from zope.interface import implements
+
 from cpsskins.elements.interfaces import IPortlet
 from cpsskins.elements.portlet import Portlet
 from cpsskins.model import Items, Item
@@ -28,12 +31,15 @@
 class ItemsPortlet(Portlet):
     """The Items portlet returns a list of items.
     """
+    implements(IItemsPortlet)
 
 class ItemsPortletData(object):
     """The portlet creates a list of predefined items.
 
     The list of items can be used by some widget to produce HTML.
     """
+    adapts(IItemsPortlet, IContextInfo)
+    implements(IDisplayData)
 
     def __init__(self, portlet, info):
         self.portlet = portlet

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py      (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/actions.py      Wed Oct 19 
20:35:08 2005
@@ -18,6 +18,8 @@
 __docformat__ = "reStructuredText"
 
 from zope.app.publisher.browser.menu import getMenu
+from zope.component import adapts
+from zope.interface import implements
 from zope.schema import TextLine
 
 from cpsskins.elements.interfaces import IPortlet
@@ -27,6 +29,7 @@
 class IActionsPortlet(IPortlet):
     """Interface for the actions portlet.
     """
+
     category = TextLine(
         title=u"Category",
         )
@@ -34,6 +37,8 @@
 class ActionsPortlet(Portlet):
     """The actions portlet returns a list of items.
     """
+    implements(IActionsPortlet)
+
     def __init__(self, category='zmi_actions'):
         self.category = category
 
@@ -42,6 +47,8 @@
 
     The list of items can be used by some widget to produce HTML.
     """
+    adapts(IActionsPortlet, IContextInfo)
+    implements(IDisplayData)
 
     def __init__(self, portlet, info):
 

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/configure.zcml
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/configure.zcml  (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example4/configure.zcml  Wed Oct 19 
20:35:08 2005
@@ -12,7 +12,6 @@
       description="A portlet that returns a list of actions items"
       factory=".actions.ActionsPortlet"
       schema=".actions.IActionsPortlet"
-      data=".actions.ActionsPortletData"
       icon="actions-icon.png"
   />
 
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to