Author: jmorliaguet
Date: Fri Oct 21 18:40:46 2005
New Revision: 28511

Added:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/__init__.py   (contents, props changed)
   z3lab/z3ecm/trunk/src/ecm/cpsskins/configure.zcml   (contents, props changed)
Modified:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/configure.zcml
   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:

- functional tutorial examples



Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/__init__.py
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/__init__.py      Fri Oct 21 18:40:46 2005
@@ -0,0 +1,13 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################

Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/configure.zcml
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/configure.zcml   Fri Oct 21 18:40:46 2005
@@ -0,0 +1,13 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope";
+    >
+
+  <include package=".example1" />
+
+  <include package=".example2" />
+
+  <include package=".example3" />
+
+  <include package=".example4" />
+
+</configure>

Modified: z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/configure.zcml
==============================================================================
--- z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/configure.zcml  (original)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example1/configure.zcml  Fri Oct 21 
18:40:46 2005
@@ -2,14 +2,14 @@
     xmlns="http://namespaces.zope.org/zope";
     xmlns:i18n="http://namespaces.zope.org/i18n";
     xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
-    i18n_domain="cpsskins"
+    i18n_domain="ecm"
     >
 
   <!-- The 'Hello portlet' says 'Hello world' -->
 
   <cpsskins:portlet
-      name="hello"
-      title="Hello portlet"
+      name="example1"
+      title="Example1: Hello portlet"
       description="A hello world"
       factory=".hello.HelloPortlet"
       schema=".hello.IHelloPortlet"
@@ -17,7 +17,7 @@
   />
 
   <adapter
-      factory=".HelloPortletData"
+      factory=".hello.HelloPortletData"
   />
 
 </configure>

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        Fri Oct 21 
18:40:46 2005
@@ -21,8 +21,7 @@
 from zope.interface import implements
 
 from cpsskins import Portlet
-from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
-from cpsskins.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 
 class IHelloPortlet(IPortlet):
     """Interface for the 'hello world' portlet"""
@@ -43,6 +42,9 @@
     adapts(IHelloPortlet, IContextInfo)
     implements(IDisplayData)
 
+    def __init__(self, portlet, info):
+        pass
+
     def __call__(self, **kw):
         return 'Hello world'
 

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  Fri Oct 21 
18:40:46 2005
@@ -2,14 +2,14 @@
     xmlns="http://namespaces.zope.org/zope";
     xmlns:i18n="http://namespaces.zope.org/i18n";
     xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
-    i18n_domain="cpsskins"
+    i18n_domain="ecm"
     >
 
   <!-- The 'Text portlet' displays some text entered by the user -->
 
   <cpsskins:portlet
-      name="text"
-      title="Text portlet"
+      name="example2"
+      title="Example2: Text portlet"
       description="A simple text portlet"
       factory=".text.TextPortlet"
       schema=".text.ITextPortlet"
@@ -17,7 +17,7 @@
   />
 
   <adapter
-      factory=".TextPortletData"
+      factory=".text.TextPortletData"
   />
 
 </configure>

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 Fri Oct 21 18:40:46 2005
@@ -22,14 +22,12 @@
 from zope.schema import Text
 
 from cpsskins import Portlet
-from cpsskins.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 
 class ITextPortlet(IPortlet):
     """Interface for the Text portlet.
     """
-    text = Text(
-        title=_("Some text"),
-        )
+    text = Text(title=u"Some text")
 
 class TextPortlet(Portlet):
     """The Text portlet displays some text entered by the user.
@@ -51,4 +49,4 @@
         self.info = info
 
     def __call__(self, **kw):
-        return self.portlet.text
+        return self.portlet.text or 'Please enter some text.'

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  Fri Oct 21 
18:40:46 2005
@@ -2,14 +2,14 @@
     xmlns="http://namespaces.zope.org/zope";
     xmlns:i18n="http://namespaces.zope.org/i18n";
     xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
-    i18n_domain="cpsskins"
+    i18n_domain="ecm"
     >
 
   <!-- The 'Items portlet' produces a list of items  -->
 
   <cpsskins:portlet
-      name="items"
-      title="Items portlet"
+      name="example3"
+      title="example3: Items portlet"
       description="A portlet that returns a list of items"
       factory=".items.ItemsPortlet"
       schema=".items.IItemsPortlet"
@@ -17,7 +17,7 @@
   />
 
   <adapter
-      factory=".ItemsPortletData"
+      factory=".items.ItemsPortletData"
   />
 
 </configure>

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        Fri Oct 21 
18:40:46 2005
@@ -21,7 +21,7 @@
 from zope.interface import implements
 
 from cpsskins import Portlet
-from cpsskins.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 from cpsskins.model import Items, Item
 
 class IItemsPortlet(IPortlet):

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      Fri Oct 21 
18:40:46 2005
@@ -23,7 +23,7 @@
 from zope.schema import TextLine
 
 from cpsskins import Portlet
-from cpsskins.interfaces import IPortlet
+from cpsskins.interfaces import IPortlet, IContextInfo, IDisplayData
 from cpsskins.model import Items, Item
 
 class IActionsPortlet(IPortlet):

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  Fri Oct 21 
18:40:46 2005
@@ -2,14 +2,14 @@
     xmlns="http://namespaces.zope.org/zope";
     xmlns:i18n="http://namespaces.zope.org/i18n";
     xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
-    i18n_domain="cpsskins"
+    i18n_domain="ecm"
     >
 
   <!-- The 'Actions portlet' produces a list of actions items -->
 
   <cpsskins:portlet
-      name="actions"
-      title="Actions portlet"
+      name="example4"
+      title="Example4: Actions portlet"
       description="A portlet that returns a list of actions items"
       factory=".actions.ActionsPortlet"
       schema=".actions.IActionsPortlet"
@@ -17,7 +17,7 @@
   />
 
   <adapter
-      factory=".ActionsPortletData"
+      factory=".actions.ActionsPortletData"
   />
 
 </configure>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to