[CMF-checkins] CVS: Products/CMFCore - ActionInformation.py:1.28
ActionProviderBase.py:1.32 CachingPolicyManager.py:1.16
DiscussionTool.py:1.19 TypesTool.py:1.84 WorkflowTool.py:1.49
__init__.py:1.32
Jens Vagelpohl
jens at dataflake.org
Wed Mar 16 06:10:17 EST 2005
Update of /cvs-repository/Products/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv25098/CMFCore
Modified Files:
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.27 => 1.28 ===
--- Products/CMFCore/ActionInformation.py:1.27 Tue Jan 25 14:49:41 2005
+++ Products/CMFCore/ActionInformation.py Wed Mar 16 06:09:46 2005
@@ -511,11 +511,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.content_url = self.object_url = object.absolute_url()
else:
- self.content_url = None
+ self.content_url = self.object_url = None
def __getitem__(self, name):
# Mapping interface for easy string formatting.
@@ -524,3 +526,4 @@
if hasattr(self, name):
return getattr(self, name)
raise KeyError, name
+
=== Products/CMFCore/ActionProviderBase.py 1.31 => 1.32 ===
--- Products/CMFCore/ActionProviderBase.py:1.31 Tue Oct 5 05:20:21 2004
+++ Products/CMFCore/ActionProviderBase.py Wed Mar 16 06:09:46 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.15 => 1.16 ===
--- Products/CMFCore/CachingPolicyManager.py:1.15 Wed Nov 10 15:31:14 2004
+++ Products/CMFCore/CachingPolicyManager.py Wed Mar 16 06:09:46 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,8 +71,8 @@
- 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
'keywords' -- keywords passed to the request
@@ -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.18 => 1.19 ===
--- Products/CMFCore/DiscussionTool.py:1.18 Fri Mar 11 04:04:34 2005
+++ Products/CMFCore/DiscussionTool.py Wed Mar 16 06:09:46 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.83 => 1.84 ===
--- Products/CMFCore/TypesTool.py:1.83 Sun Nov 28 16:40:27 2004
+++ Products/CMFCore/TypesTool.py Wed Mar 16 06:09:46 2005
@@ -874,7 +874,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.48 => 1.49 ===
--- Products/CMFCore/WorkflowTool.py:1.48 Tue Nov 16 14:11:44 2004
+++ Products/CMFCore/WorkflowTool.py Wed Mar 16 06:09:46 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.31 => 1.32 ===
--- Products/CMFCore/__init__.py:1.31 Tue Jan 25 14:49:41 2005
+++ Products/CMFCore/__init__.py Wed Mar 16 06:09:47 2005
@@ -146,9 +146,6 @@
utils.registerIcon(FSZSQLMethod.FSZSQLMethod,
'images/fssqlmethod.gif', globals())
- context.registerHelpTitle('CMF Core Help')
- context.registerHelp(directory='interfaces')
-
utils.ToolInit( 'CMF Core Tool'
, tools=tools
, product_name='CMFCore'
@@ -162,3 +159,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