Author: jmorliaguet
Date: Mon Oct 17 19:17:15 2005
New Revision: 28366

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

- added example2 portlet



Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/README.txt
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/README.txt      Mon Oct 17 
19:17:15 2005
@@ -0,0 +1,2 @@
+
+This portlet displays some text specified by the user.

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

Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/configure.zcml
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/configure.zcml  Mon Oct 17 
19:17:15 2005
@@ -0,0 +1,18 @@
+<configure
+    xmlns:i18n="http://namespaces.zope.org/i18n";
+    xmlns:cpsskins="http://namespaces.zope.org/cpsskins";
+    i18n_domain="cpsskins"
+    >
+
+  <!-- The 'Text portlet' displays some text entered by the user -->
+
+  <cpsskins:portlet
+      name="text"
+      title="Text portlet"
+      description="A simple text portlet"
+      factory=".text.TextPortlet"
+      schema=".text.ITextPortlet"
+      icon="text-icon.png"
+  />
+
+</configure>

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

Added: z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py
==============================================================================
--- (empty file)
+++ z3lab/z3ecm/trunk/src/ecm/cpsskins/example2/text.py Mon Oct 17 19:17:15 2005
@@ -0,0 +1,53 @@
+##############################################################################
+#
+# 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 zope.schema import Text
+
+from cpsskins.browser.rendering.interfaces import IContextInfo, IDisplayData
+from cpsskins.elements.interfaces import IPortlet
+from cpsskins.elements.portlet import Portlet
+
+class ITextPortlet(IPortlet):
+    """Interface for the Text portlet"""
+
+class TextPortlet(Portlet):
+    """The Text portlet displays some text entered by the user.
+
+    """
+    implements(ITextPortlet)
+
+    text = Text(
+        title=_("Some text"),
+        )
+
+class TextDisplayData(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
+
+    def __call__(self, **kw):
+        return self.portlet.text
+
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to