[Zope3-checkins] SVN: Zope3/branches/roger-contentprovider/src/zope/portlet/ Added preferences

Roger Ineichen roger at projekt01.ch
Sat Oct 8 16:41:19 EDT 2005


Log message for revision 38976:
  Added preferences

Changed:
  U   Zope3/branches/roger-contentprovider/src/zope/portlet/configure.zcml
  A   Zope3/branches/roger-contentprovider/src/zope/portlet/preferences.py
  A   Zope3/branches/roger-contentprovider/src/zope/portlet/statehandler.py

-=-
Modified: Zope3/branches/roger-contentprovider/src/zope/portlet/configure.zcml
===================================================================
--- Zope3/branches/roger-contentprovider/src/zope/portlet/configure.zcml	2005-10-08 19:18:33 UTC (rev 38975)
+++ Zope3/branches/roger-contentprovider/src/zope/portlet/configure.zcml	2005-10-08 20:41:19 UTC (rev 38976)
@@ -11,6 +11,22 @@
       factory=".namespace.portlet"
       />
 
+  <preferenceGroup
+      id="portlet"
+      title="Portlet Settings"
+      description="
+        In this category you will find all preferences related to a
+        specific portlet.
+        "
+      category="true"
+      />
+
+  <preferenceGroup
+      id="portlet.portlet"
+      title="Portlet preference"
+      schema=".interfaces.IPortletPreference"
+      />
+
   <include package=".browser" />
 
 </configure>
\ No newline at end of file

Added: Zope3/branches/roger-contentprovider/src/zope/portlet/preferences.py
===================================================================
--- Zope3/branches/roger-contentprovider/src/zope/portlet/preferences.py	2005-10-08 19:18:33 UTC (rev 38975)
+++ Zope3/branches/roger-contentprovider/src/zope/portlet/preferences.py	2005-10-08 20:41:19 UTC (rev 38976)
@@ -0,0 +1,38 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation 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.
+#
+##############################################################################
+"""Portlet preferences implementation
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+from zope.interface import Interface
+from zope.schema import Bool
+
+from zope.app.i18n import ZopeMessageIDFactory as _
+
+
+
+class IPortletPreference(Interface):
+    """User Preference for a single portlet."""
+
+    expanded = Bool(
+        title=_(u"Show portlet expanded"),
+        description=_(u"Shows portlet in its inital state expanded.")
+        )
+
+    state = Choice(
+        title=_(u"Portlet state"),
+        description=_(u"Render portlt in the given mode.")
+        )
\ No newline at end of file


Property changes on: Zope3/branches/roger-contentprovider/src/zope/portlet/preferences.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Added: Zope3/branches/roger-contentprovider/src/zope/portlet/statehandler.py
===================================================================
--- Zope3/branches/roger-contentprovider/src/zope/portlet/statehandler.py	2005-10-08 19:18:33 UTC (rev 38975)
+++ Zope3/branches/roger-contentprovider/src/zope/portlet/statehandler.py	2005-10-08 20:41:19 UTC (rev 38976)
@@ -0,0 +1,38 @@
+##############################################################################
+#
+# Copyright (c) 2004 Zope Corporation 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.
+#
+##############################################################################
+"""Portlet state handler implementation
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+import zope.interface
+
+from zope.portlet import interfaces
+
+
+
+class PreferenceStateHandler(object):
+    """State handler based on preferences."""
+
+    implements(interfaces.IStateHandler)
+
+    def __init__(self, context):
+        self.context = context
+        self.preferences = None
+
+    def setState(self, name, value):
+        """xxx"""
+        # self.preferences.portletmanager.%s.state = %s % (portletname, name)
+


Property changes on: Zope3/branches/roger-contentprovider/src/zope/portlet/statehandler.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list