[CMF-checkins] CVS: Products/CMFCore - ActionInformation.py:1.26.2.2 ActionProviderBase.py:1.30.2.2 CachingPolicyManager.py:1.14.2.2 DiscussionTool.py:1.17.2.2 TypesTool.py:1.74.2.8 WorkflowTool.py:1.46.2.2 __init__.py:1.28.2.1

Jens Vagelpohl jens at dataflake.org
Wed Mar 16 06:34:23 EST 2005


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

Modified Files:
      Tag: CMF-1_5-branch
	ActionInformation.py ActionProviderBase.py 
	CachingPolicyManager.py DiscussionTool.py TypesTool.py 
	WorkflowTool.py __init__.py 
Log Message:
- CMFCore.CachingPolicyManager and CMFCore.ActionInformation: The names
  available to TALES expressions throughout the CMF showed some
  inconsistencies. To prevent confusion the names "content" and
  "content_url" that were used for Cache Policy Manager policies as well
  as the special ActionInformation.oai class are now deprecated and will
  be removed in CMF 1.7. The canonical names to be used are "object" and
  "object_url", which matches all other CMF expression contexts with
  DCWorkflow being the only exception due to its non-CMF roots.
  (http://www.zope.org/Collectors/CMF/328)


=== Products/CMFCore/ActionInformation.py 1.26.2.1 => 1.26.2.2 ===
--- Products/CMFCore/ActionInformation.py:1.26.2.1	Tue Jan 25 15:10:24 2005
+++ Products/CMFCore/ActionInformation.py	Wed Mar 16 06:33:52 2005
@@ -374,11 +374,13 @@
         else:
             self.folder_url = self.portal_url
             self.folder = portal
-        self.content = object
+
+        # The name "content" is deprecated and will go away in CMF 1.7!    
+        self.object = self.content = object
         if object is not None:
-            self.content_url = object.absolute_url()
+            self.object_url = self.content_url = object.absolute_url()
         else:
-            self.content_url = None
+            self.object_url = self.content_url = None
 
     def __getitem__(self, name):
         # Mapping interface for easy string formatting.
@@ -387,3 +389,4 @@
         if hasattr(self, name):
             return getattr(self, name)
         raise KeyError, name
+


=== Products/CMFCore/ActionProviderBase.py 1.30.2.1 => 1.30.2.2 ===
--- Products/CMFCore/ActionProviderBase.py:1.30.2.1	Tue Oct  5 05:19:25 2004
+++ Products/CMFCore/ActionProviderBase.py	Wed Mar 16 06:33:52 2005
@@ -40,8 +40,9 @@
 
     _actions_form = DTMLFile( 'editToolsActions', _dtmldir )
 
-    manage_options = ( { 'label' : 'Actions'
+    manage_options = ( { 'label'  : 'Actions'
                        , 'action' : 'manage_editActionsForm'
+                       , 'help'   : ('CMFCore', 'Actions.stx')
                        }
                      ,
                      )


=== Products/CMFCore/CachingPolicyManager.py 1.14.2.1 => 1.14.2.2 ===
--- Products/CMFCore/CachingPolicyManager.py:1.14.2.1	Wed Nov 10 15:31:48 2004
+++ Products/CMFCore/CachingPolicyManager.py	Wed Mar 16 06:33:52 2005
@@ -48,7 +48,10 @@
     if time is None:
         time = DateTime()
 
+    # The name "content" is deprecated and will go away in CMF 1.7,
+    # please use "object" in your policy
     data = { 'content'  : content
+           , 'object'   : content
            , 'view'     : view_method
            , 'keywords' : keywords
            , 'request'  : getattr( content, 'REQUEST', {} )
@@ -68,7 +71,7 @@
           - class membership is defined by 'predicate', a TALES expression
             with access to the following top-level names:
 
-            'content' -- the content object itself
+            'object' -- the object itself
 
             'view' -- the name of the view method
 
@@ -82,10 +85,12 @@
 
             'nothing' -- None
 
+            'time' -- A DateTime object for the current date and time
+
           - The "Last-modified" HTTP response header will be set using
             'mtime_func', which is another TALES expression evaluated
             against the same namespace.  If not specified explicitly,
-            uses 'content/modified'.
+            uses 'object/modified'.
 
           - The "Expires" HTTP response header and the "max-age" token of
             the "Cache-control" header will be set using 'max_age_secs',
@@ -130,7 +135,7 @@
             predicate = 'python:1'
 
         if not mtime_func:
-            mtime_func = 'content/modified'
+            mtime_func = 'object/modified'
 
         if max_age_secs is not None:
             max_age_secs = int( max_age_secs )
@@ -265,8 +270,9 @@
     #
     #   ZMI
     #
-    manage_options = ( ( { 'label' : 'Policies'
+    manage_options = ( ( { 'label'  : 'Policies'
                          , 'action' : 'manage_cachingPolicies'
+                         , 'help'   : ('CMFCore', 'CPMPolicies.stx')
                          }
                        ,
                        )
@@ -292,7 +298,7 @@
     def addPolicy( self
                  , policy_id
                  , predicate        # TALES expr (def. 'python:1')
-                 , mtime_func       # TALES expr (def. 'content/modified')
+                 , mtime_func       # TALES expr (def. 'object/modified')
                  , max_age_secs     # integer, seconds (def. 0)
                  , no_cache         # boolean (def. 0)
                  , no_store         # boolean (def. 0)
@@ -325,7 +331,7 @@
     def updatePolicy( self
                     , policy_id
                     , predicate         # TALES expr (def. 'python:1')
-                    , mtime_func        # TALES expr (def. 'content/modified')
+                    , mtime_func        # TALES expr (def. 'object/modified')
                     , max_age_secs      # integer, seconds
                     , no_cache          # boolean (def. 0)
                     , no_store          # boolean (def. 0)


=== Products/CMFCore/DiscussionTool.py 1.17.2.1 => 1.17.2.2 ===
--- Products/CMFCore/DiscussionTool.py:1.17.2.1	Fri Mar 11 04:05:33 2005
+++ Products/CMFCore/DiscussionTool.py	Wed Mar 16 06:33:52 2005
@@ -161,13 +161,13 @@
         # Return actions for reply and show replies
         if object is not None or info is None:
             info = getOAI(self, object)
-        content = info.content
+        content = info.object
         if content is None or not self.isDiscussionAllowedFor(content):
             return ()
 
         discussion = self.getDiscussionFor(content)
         if discussion.aq_base == content.aq_base:
-            discussion_url = info.content_url
+            discussion_url = info.object_url
         else:
             discussion_url = discussion.absolute_url()
 


=== Products/CMFCore/TypesTool.py 1.74.2.7 => 1.74.2.8 ===
--- Products/CMFCore/TypesTool.py:1.74.2.7	Mon Nov 22 06:55:59 2004
+++ Products/CMFCore/TypesTool.py	Wed Mar 16 06:33:52 2005
@@ -930,7 +930,7 @@
         actions = list( self._actions )
 
         if object is None and info is not None:
-            object = info.content
+            object = info.object
         if object is not None:
             type_info = self.getTypeInfo(object)
             if type_info is not None:


=== Products/CMFCore/WorkflowTool.py 1.46.2.1 => 1.46.2.2 ===
--- Products/CMFCore/WorkflowTool.py:1.46.2.1	Tue Nov 16 14:11:04 2004
+++ Products/CMFCore/WorkflowTool.py	Wed Mar 16 06:33:52 2005
@@ -246,7 +246,7 @@
         """
         if object is not None or info is None:
             info = getOAI(self, object)
-        chain = self.getChainFor(info.content)
+        chain = self.getChainFor(info.object)
         did = {}
         actions = []
 


=== Products/CMFCore/__init__.py 1.28 => 1.28.2.1 ===
--- Products/CMFCore/__init__.py:1.28	Thu Aug 12 11:07:39 2004
+++ Products/CMFCore/__init__.py	Wed Mar 16 06:33:52 2005
@@ -122,9 +122,6 @@
     utils.registerIcon(TypesTool.ScriptableTypeInformation,
                        'images/typeinfo.gif', globals())
 
-    context.registerHelpTitle('CMF Core Help')
-    context.registerHelp(directory='interfaces')
-
     utils.ToolInit( 'CMF Core Tool'
                   , tools=tools
                   , product_name='CMFCore'
@@ -138,3 +135,16 @@
                            PortalFolder.manage_addPortalFolder, )
                      , fti=PortalFolder.factory_type_information
                      ).initialize( context )
+
+    # make registerHelp work with 2 directories
+    help = context.getProductHelp()
+    lastRegistered = help.lastRegistered
+    context.registerHelp(directory='help', clear=1)
+    context.registerHelp(directory='interfaces', clear=1)
+    if help.lastRegistered != lastRegistered:
+        help.lastRegistered = None
+        context.registerHelp(directory='help', clear=1)
+        help.lastRegistered = None
+        context.registerHelp(directory='interfaces', clear=0)
+    context.registerHelpTitle('CMF Core Help')
+



More information about the CMF-checkins mailing list