[CMF-checkins] CVS: Products/CMFCore/interfaces - portal_actions.py:1.20

Yvo Schubbe y.2005- at wcm-solutions.de
Tue Jan 25 14:50:12 EST 2005


Update of /cvs-repository/Products/CMFCore/interfaces
In directory cvs.zope.org:/tmp/cvs-serv24836/CMFCore/interfaces

Modified Files:
	portal_actions.py 
Log Message:
merged yuppie-new_actions-branch:
- added ActionCategory and Action interfaces
- added ActionCategory and Action classes
- modified ActionsTool to make use of these new classes
- removed deprecated 'name' and 'permissions' keys from ActionInfo
- allowed 'description' key in ActionInfo
- implemented IAction in the oldstyle ActionInformation class and used this interface to simplify ActionInfo
- updated setup handlers, tests, default profile and skins
- fixed ActionInfo issue regarding permissions in oldstyle action dicts


=== Products/CMFCore/interfaces/portal_actions.py 1.19 => 1.20 ===
--- Products/CMFCore/interfaces/portal_actions.py:1.19	Tue Sep 14 15:02:21 2004
+++ Products/CMFCore/interfaces/portal_actions.py	Tue Jan 25 14:49:41 2005
@@ -90,7 +90,7 @@
         Raises an ValueError exception if the action is of the wrong format.
         
         Permission -- Private
-        
+
         Returns -- The actions object reference.
         """
 
@@ -120,6 +120,40 @@
         """
 
 
+class ActionCategory(Interface):
+    """ Group of Action objects.
+    """
+
+    def listActions():
+        """ List the actions defined in this category and its subcategories.
+
+        Permission -- Python only
+
+        Returns -- Tuple of Action objects.
+        """
+
+
+class Action(Interface):
+    """ Reference to an action.
+    """
+
+    def getInfoData():
+        """ Get the data needed to create an ActionInfo.
+
+        Default keys are: 'id', 'category', 'title', 'description', 'url',
+        'icon', 'available', 'permissions' and 'visible'.
+
+        Instead of computed values callable expression objects or methods are
+        returned. For performance reasons, these objects are called later and
+        only if the values are actually needed. The keys for all these lazy
+        values are registered in a separate list.
+
+        Permission -- Python only
+
+        Returns -- Lazy info mapping and list of lazy keys.
+        """
+
+
 class ActionInfo(Interface):
     """ A lazy dictionary for Action infos.
 
@@ -138,13 +172,7 @@
 
       - available (boolean): the result of checking the condition
 
-      - allowed (boolean): the result of checking permissions
-
-    Deprecated keys:
-        
-      - name (string): use 'id' or 'title' instead
-
-      - permissions (tuple): use 'allowed' instead; The user must have at
-        least one of the listed permissions to access the action. If the list
-        is empty, the user is allowed.
+      - allowed (boolean): the result of checking permissions;
+        The user must have at least one of the listed permissions to access
+        the action. If the list is empty, the user is allowed.
     """



More information about the CMF-checkins mailing list