Author: jmorliaguet
Date: Mon Oct 17 20:33:39 2005
New Revision: 28368

Added:
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/README.txt   (contents, props 
changed)
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/__init__.py   (contents, props 
changed)
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/configure.zcml   (contents, 
props changed)
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items-icon.png   (contents, 
props changed)
   z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py   (contents, props 
changed)
Log:

- added third example



Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/README.txt
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/README.txt      Mon Oct 17 
20:33:39 2005
@@ -0,0 +1,2 @@
+
+This portlet returns a list of items that can be displayed using a widget.

Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/__init__.py
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/__init__.py     Mon Oct 17 
20:33:39 2005
@@ -0,0 +1 @@
+# This is a package

Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/configure.zcml
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/configure.zcml  Mon Oct 17 
20:33:39 2005
@@ -0,0 +1,18 @@
+<configure
+    xmlns:i18n="http://namespaces.zope.org/i18n";
+    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
+    i18n_domain="cpsskins"
+    >
+
+  <!-- The 'Items portlet' produces a list of items  -->
+
+  <cpsskins:portlet
+      name="items"
+      title="Items portlet"
+      description="A portlet that returns a list of items"
+      factory=".items.ItemsPortlet"
+      schema=".items.IItemsPortlet"
+      icon="items-icon.png"
+  />
+
+</configure>

Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items-icon.png
==============================================================================
Binary file. No diff available.

Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example3/items.py        Mon Oct 17 
20:33:39 2005
@@ -0,0 +1,52 @@
+##############################################################################
+#
+# 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 adapts
+from zope.interface import implements
+
+from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
+from cpsskins.elements.interfaces import IPortlet
+from cpsskins.elements.portlet import Portlet
+from cpsskins.model import Items, Item
+
+class IItemsPortlet(IPortlet):
+    """Interface for the Items portlet"""
+
+class ItemsPortlet(Portlet):
+    """The Items portlet returns a list of items.
+
+    """
+    implements(IItemsPortlet)
+
+class ItemsDisplayData(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
+        self.info = info
+
+        info.data = Items([
+            Item(title='first', url='http://www.somesite.com'),
+            Item(title='second', url='http://www.someothersite.com'),
+            ])
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to