[CMF-checkins] CVS: Products/CMFCore/z2interfaces -
CachingPolicyManager.py:1.1.2.1
ContentTypeRegistry.py:1.1.2.1 Contentish.py:1.1.2.1
Discussions.py:1.1.2.1 DublinCore.py:1.1.2.1
Dynamic.py:1.1.2.1 Folderish.py:1.1.2.1
IOpaqueItems.py:1.1.2.1 Syndicatable.py:1.1.2.1
__init__.py:1.1.2.1 portal_actions.py:1.1.2.1
portal_catalog.py:1.1.2.1 portal_discussion.py:1.1.2.1
portal_memberdata.py:1.1.2.1 portal_membership.py:1.1.2.1
portal_metadata.py:1.1.2.1 portal_properties.py:1.1.2.1
portal_registration.py:1.1.2.1 portal_skins.py:1.1.2.1
portal_types.py:1.1.2.1 portal_undo.py:1.1.2.1
portal_url.py:1.1.2.1 portal_workflow.py:1.1.2.1
Tres Seaver
tseaver at palladion.com
Fri Jul 15 18:41:20 EDT 2005
Update of /cvs-repository/Products/CMFCore/z2interfaces
In directory cvs.zope.org:/tmp/cvs-serv16776/CMFCore/z2interfaces
Added Files:
Tag: tseaver-z3_interfaces-branch
CachingPolicyManager.py ContentTypeRegistry.py Contentish.py
Discussions.py DublinCore.py Dynamic.py Folderish.py
IOpaqueItems.py Syndicatable.py __init__.py portal_actions.py
portal_catalog.py portal_discussion.py portal_memberdata.py
portal_membership.py portal_metadata.py portal_properties.py
portal_registration.py portal_skins.py portal_types.py
portal_undo.py portal_url.py portal_workflow.py
Log Message:
Branch for Z3-ification of CMF interfaces
- All interfaces declared in the CMF are now Zope3-style interfaces
(the one remaining exception is to leave Zope2's
'webdav.WriteLockInterface' declared by CMFCore.PortalContent and
derivatives.).
TOOD
- Clean up XXX'es noted during this pass.
=== Added File Products/CMFCore/z2interfaces/CachingPolicyManager.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Caching policies tool interface.
$Id: CachingPolicyManager.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class CachingPolicyManager(Interface):
"""
Manage HTTP cache policies for skin methods.
"""
id = Attribute( 'id', 'Must be set to "caching_policy_manager"' )
def getHTTPCachingHeaders( content, view_method, keywords, time=None ):
"""
Update HTTP caching headers in REQUEST based on 'content',
'view_method', and 'keywords'.
If 'time' is supplied, use it instead of the current time
(for reliable testing).
"""
=== Added File Products/CMFCore/z2interfaces/ContentTypeRegistry.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Putfactory registration tool interface.
$Id: ContentTypeRegistry.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Interface
class ContentTypeRegistryPredicate(Interface):
""" Express a rule for matching a given name/typ/body.
predicateWidget -- Return a snipped of HTML suitable for editing the
predicate; the snippet should arrange for values to be marshalled by
ZPublisher as a ':record', with the ID of the predicate as the name of
the record.
The registry will call the predictate's 'edit' method, passing the fields
of the record.
"""
def __call__(name, typ, body):
""" Return true if the rule matches, else false. """
def getTypeLabel():
""" Return a human-readable label for the predicate type. """
class ContentTypeRegistry(Interface):
""" Registry for rules which map PUT args to a CMF Type Object. """
def findTypeName(name, typ, body):
"""\
Perform a lookup over a collection of rules, returning the
the Type object corresponding to name/typ/body. Return None
if no match found.
"""
=== Added File Products/CMFCore/z2interfaces/Contentish.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Contentish type interface.
$Id: Contentish.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Interface
class Contentish(Interface):
"""
General interface for "contentish" items.
These methods need to be implemented by any class that wants to be a
first-class citizen in the Portal Content world.
PortalContent implements this interface.
"""
def SearchableText():
"""
SearchableText is called to provide the Catalog with textual
information about your object. It is a string usually generated
by concatenating the string attributes of your content class. This
string can then be used by the catalog to index your document and
make it findable through the catalog.
"""
=== Added File Products/CMFCore/z2interfaces/Discussions.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Discussable interface.
$Id: Discussions.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Interface
class Discussable(Interface):
""" Discussable is the interface for things which can have responses.
"""
def createReply(title, text, Creator=None):
"""
Create a reply in the proper place.
Permission: Reply to item
Returns: HTML (directly or via redirect)
"""
def getReplies():
"""
Return a sequence of the DiscussionResponse objects which are
associated with this Discussable
Permissions: View
Returns: sequence of DiscussionResponses
"""
def quotedContents():
"""
Return this object's contents in a form suitable for inclusion
as a quote in a response. The default implementation returns
an empty string. It might be overridden to return a '>' quoted
version of the item.
"""
def _getReplyResults():
"""
Return the ZCatalog results that represent this object's replies.
Often, the actual objects are not needed. This is less expensive
than fetching the objects.
Permissions: View
Returns: sequence of ZCatalog results representing DiscussionResponses
"""
class OldDiscussable(Interface):
""" Oldstyle discussable interface.
"""
def createReply(title, text, REQUEST, RESPONSE):
"""
Create a reply in the proper place.
Permission: Reply to item
Returns: HTML (directly or via redirect)
"""
def getReplyLocationAndID(REQUEST):
"""
This method determines where a user's reply should be stored, and
what it's ID should be.
You don't really want to force users to have to select a
unique ID each time they want to reply to something. The
present implementation selects a folder in the Member's home
folder called 'Correspondence' (creating it if it is missing)
and finds a free ID in that folder.
createReply should use this method to determine what the reply
it creates should be called, and where it should be placed.
This method (and createReply, I expect) do not really belong in
this interface. There should be a DiscussionManager singleton
(probably the portal object itself) which handles this.
Permissions: None assigned
Returns: 2-tuple, containing the container object, and a string ID.
"""
def getReplyResults():
"""
Return the ZCatalog results that represent this object's replies.
Often, the actual objects are not needed. This is less expensive
than fetching the objects.
Permissions: View
Returns: sequence of ZCatalog results representing DiscussionResponses
"""
def getReplies():
"""
Return a sequence of the DiscussionResponse objects which are
associated with this Discussable
Permissions: View
Returns: sequence of DiscussionResponses
"""
def quotedContents():
"""
Return this object's contents in a form suitable for inclusion
as a quote in a response. The default implementation returns
an empty string. It might be overridden to return a '>' quoted
version of the item.
"""
class DiscussionResponse(Interface):
""" This interface describes the behaviour of a Discussion Response.
"""
def inReplyTo(REQUEST=None):
"""
Return the Discussable object which this item is associated with
Permissions: None assigned
Returns: a Discussable object
"""
def setReplyTo(reply_to):
"""
Make this object a response to the passed object. (Will also
accept a path in the form of a string.) If reply_to does not
support or accept replies, a ValueError will be raised. (This
does not seem like the right exception.)
Permissions: None assigned
Returns: None
"""
def parentsInThread(size=0):
"""
Return the list of object which are this object's parents, from the
point of view of the threaded discussion. Parents are ordered
oldest to newest.
If 'size' is not zero, only the closest 'size' parents will be
returned.
"""
=== Added File Products/CMFCore/z2interfaces/DublinCore.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Dublin Core interface.
$Id: DublinCore.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Interface
class DublinCore(Interface):
""" Dublin Core metadata elements supported by CMF and their semantics.
"""
def Title():
""" Dublin Core Title element - resource name.
Permission -- View
Returns -- String
"""
def listCreators():
""" List Dublin Core Creator elements - resource authors.
Depending on the implementation, this returns the full name(s) of the
author(s) of the content object or their ids.
Permission -- View
Returns -- Sequence of strings
"""
def Creator():
""" Dublin Core Creator element - resource author.
The first Dublin Core Creator element or an empty string.
Permission -- View
Returns -- String
"""
def Subject():
""" Dublin Core Subject element - resource keywords.
Return zero or more keywords associated with the content object.
Permission -- View
Returns -- Sequence of strings
"""
def Description():
""" Dublin Core Description element - resource summary.
Return a natural language description of this object.
Permission -- View
Returns -- String
"""
def Publisher():
""" Dublin Core Publisher element - resource publisher.
Return full formal name of the entity or person responsible for
publishing the resource.
Permission -- View
Returns -- String
"""
def listContributors():
""" Dublin Core Contributor elements - resource collaborators.
Return zero or additional collaborators.
Permission -- View
Returns -- Sequence of strings
"""
def Contributors():
""" Deprecated alias of listContributors.
'initial caps' names are reserved for strings.
"""
def Date():
""" Dublin Core Date element - default date.
Permission -- View
Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
"""
def CreationDate():
""" Dublin Core Date element - date resource created.
Permission -- View
Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
"""
def EffectiveDate():
""" Dublin Core Date element - date resource becomes effective.
Permission -- View
Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
"""
def ExpirationDate():
""" Dublin Core Date element - date resource expires.
Permission -- View
Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
"""
def ModificationDate():
""" Dublin Core Date element - date resource last modified.
Permission -- View
Returns -- String, formatted 'YYYY-MM-DD H24:MN:SS TZ'
"""
def Type():
""" Dublin Core Type element - resource type.
Return a human-readable type name for the resource (perhaps mapped
from its Zope meta_type).
Permission -- View
Returns -- String
"""
def Format():
""" Dublin Core Format element - resource format.
Return the resource's MIME type (e.g. 'text/html', 'image/png', etc.).
Permission -- View
Returns -- String
"""
def Identifier():
""" Dublin Core Identifier element - resource ID.
Returns unique ID (a URL) for the resource.
Permission -- View
Returns -- String
"""
def Language():
""" Dublin Core Language element - resource language.
Return the RFC language code (e.g. 'en-US', 'pt-BR') for the resource.
Permission -- View
Returns -- String
"""
def Rights():
""" Dublin Core Rights element - resource copyright.
Return a string describing the intellectual property status, if any,
of the resource.
Permission -- View
Returns -- String
"""
class CatalogableDublinCore(Interface):
""" Provide Zope-internal date objects for cataloging purposes.
"""
def created():
""" Dublin Core Date element - date resource created.
Permission -- View
Returns -- DateTime
"""
def effective():
""" Dublin Core Date element - date resource becomes effective.
Permission -- View
Returns -- DateTime
"""
def expires():
""" Dublin Core Date element - date resource expires.
Permission -- View
Returns -- DateTime
"""
def modified():
""" Dublin Core Date element - date resource last modified.
Permission -- View
Returns -- DateTime
"""
class MutableDublinCore(Interface):
""" Update interface for mutable metadata.
"""
def setTitle(title):
""" Set Dublin Core Title element - resource name.
Permission -- Modify portal content
"""
def setCreators(creators):
""" Set Dublin Core Creator elements - resource authors.
Permission -- Modify portal content
"""
def setSubject(subject):
""" Set Dublin Core Subject element - resource keywords.
Permission -- Modify portal content
"""
def setDescription(description):
""" Set Dublin Core Description element - resource summary.
Permission -- Modify portal content
"""
def setContributors(contributors):
""" Set Dublin Core Contributor elements - resource collaborators.
Permission -- Modify portal content
"""
def setEffectiveDate(effective_date):
""" Set Dublin Core Date element - date resource becomes effective.
Permission -- Modify portal content
"""
def setExpirationDate(expiration_date):
""" Set Dublin Core Date element - date resource expires.
Permission -- Modify portal content
"""
def setFormat(format):
""" Set Dublin Core Format element - resource format.
Permission -- Modify portal content
"""
def setLanguage(language):
""" Set Dublin Core Language element - resource language.
Permission -- Modify portal content
"""
def setRights(rights):
""" Set Dublin Core Rights element - resource copyright.
Permission -- Modify portal content
"""
=== Added File Products/CMFCore/z2interfaces/Dynamic.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Dynamic type interface.
$Id: Dynamic.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Interface
class DynamicType(Interface):
""" General interface for dynamic items.
"""
def getPortalTypeName():
""" Get the portal type name that can be passed to portal_types.
If the object is uninitialized, returns None.
Permission -- Always available
"""
def getTypeInfo():
""" Get the TypeInformation object specified by the portal type.
A shortcut to 'getTypeInfo' of portal_types.
Permission -- Always available
"""
def getActionInfo(action_chain, check_visibility=0, check_condition=0):
""" Get an Action info mapping specified by a chain of actions.
A shortcut to 'getActionInfo' of the related TypeInformation object.
Permission -- Always available
"""
def getIcon(relative_to_portal=0):
""" Get the path to an object's icon.
This method is used in the folder_contents view to generate an
appropriate icon for the items found in the folder.
If the content item does not define an attribute named "icon"
this method will return the path "/misc_/dtmldoc.gif", which is
the icon used for DTML Documents.
If 'relative_to_portal' is true, return only the portion of
the icon's URL which finds it "within" the portal; otherwise,
return it as an absolute URL.
Permission -- Always available
"""
=== Added File Products/CMFCore/z2interfaces/Folderish.py ===
##############################################################################
#
# 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.
#
##############################################################################
""" Folderish type interface.
$Id: Folderish.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Interface
class Folderish(Interface):
""" General interface for "folderish" items.
"""
def contentItems(filter=None):
""" List contentish and folderish sub-objects and their IDs.
Provide a filtered view onto 'objectItems', allowing only
PortalFolders and PortalContent-derivatives to show through.
Permission -- Always available (not publishable)
Returns -- List of (object ID, object) tuples
"""
def contentIds(filter=None):
""" List IDs of contentish and folderish sub-objects.
Provide a filtered view onto 'objectIds', allowing only PortalFolders
and PortalContent-derivatives to show through.
Permission -- Always available (not publishable)
Returns -- List of object IDs
"""
def contentValues(filter=None):
""" List contentish and folderish sub-objects.
Provide a filtered view onto 'objectValues', allowing only
PortalFolders and PortalContent-derivatives to show through.
Permission -- Always available (not publishable)
Returns -- List of objects
"""
def listFolderContents(contentFilter=None):
""" List viewable contentish and folderish sub-objects.
Hook around 'contentValues' to let 'folder_contents' be protected.
Duplicating skip_unauthorized behavior of dtml-in.
Permission -- List folder contents
Returns -- List of objects
"""
=== Added File Products/CMFCore/z2interfaces/IOpaqueItems.py ===
##############################################################################
#
# Copyright (c) 2003 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.
#
##############################################################################
""" Marker interface for callable opaque items with manage_* hooks.
$Id: IOpaqueItems.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class ICallableOpaqueItem(Interface):
"""Interface for callable opaque items.
Opaque items are subelements that are contained using something that
is not an ObjectManager.
On add, copy, move and delete operations a marked opaque items
'manage_afterAdd', 'manage_afterClone' and 'manage_beforeDelete' hooks
get called if available. Unavailable hooks do not throw exceptions.
"""
def __init__(obj, id):
"""Return the opaque item and assign it to 'obj' as attr with 'id'.
"""
def __call__():
"""Return the opaque items value.
"""
def getId():
"""Return the id of the opaque item.
"""
class ICallableOpaqueItemEvents(Interface):
"""CMF specific events upon copying, renaming and deletion.
"""
def manage_afterClone(item):
"""After clone event hook.
"""
def manage_beforeDelete(item, container):
"""Before delete event hook.
"""
def manage_afterAdd(item, container):
"""After add event hook.
"""
=== Added File Products/CMFCore/z2interfaces/Syndicatable.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Syndicatable interface.
$Id: Syndicatable.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Interface
class Syndicatable(Interface):
"""\
Returns back a list of objects which implements the DublinCore.
"""
def synContentValues(self):
"""
Returns a list of results which is to be Syndicated. For example, the normal call
contentValues (on PortalFolders) returns a list of subObjects of the current object
(i.e. objectValues with filtering applied). For the case of a Topic, one would
return a sequence of objects from a catalog query, not the subObjects of the Topic.
What is returned must implement the DublinCore.
"""
=== Added File Products/CMFCore/z2interfaces/__init__.py ===
""" CMFCore.interfaces package """
=== Added File Products/CMFCore/z2interfaces/portal_actions.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Actions tool interface.
$Id: portal_actions.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_actions(Interface):
""" Gathers a list of links which the user is allowed to view according to
the current context.
"""
id = Attribute('id', 'Must be set to "portal_actions"')
def listActionProviders():
""" List the ids of all Action Providers queried by this tool.
Permission -- Manage portal
Returns -- Tuple of Action Provider ids
"""
def addActionProvider(provider_name):
""" Add an Action Provider id to the providers queried by this tool.
A provider must implement the ActionProvider Interface.
OldstyleActionProviders are currently also supported.
The provider is only added if the actions tool can find the object
corresponding to the provider_name.
Permission -- Manage portal
"""
def deleteActionProvider(provider_name):
""" Delete an Action Provider id from providers queried by this tool.
The deletion only takes place if provider_name is actually found among
the known action providers.
Permission -- Manage portal
"""
def listFilteredActionsFor(object=None):
""" List all actions available to the user.
See the ActionInfo interface for provided keys. 'visible', 'available'
and 'allowed' are always True in actions returned by this method.
Permission -- Always available
Returns -- Dictionary of category / ActionInfo list pairs
"""
class ActionProvider(Interface):
""" The interface expected of an object that can provide actions.
"""
def listActions(info=None, object=None):
""" List all the actions defined by a provider.
If 'object' is specified, object specific actions are included.
The 'info' argument is deprecated and may be removed in a future
version. If 'object' isn't specified, the method uses for backwards
compatibility 'info.content' as object.
Returns -- Tuple of ActionInformation objects (or Action mappings)
"""
def getActionObject(action):
"""Return the actions object or None if action doesn't exist.
'action' is an action 'path' (e.g. 'object/view').
Raises an ValueError exception if the action is of the wrong format.
Permission -- Private
Returns -- The actions object reference.
"""
def listActionInfos(action_chain=None, object=None, check_visibility=1,
check_permissions=1, check_condition=1, max=-1):
""" List ActionInfo objects.
'action_chain' is a sequence of action 'paths' (e.g. 'object/view').
If specified, only these actions will be returned in the given order.
If 'object' is specified, object specific Actions are included.
If 'max' is specified, only the first max Actions are returned.
Permission -- Always available (not publishable)
Returns -- Tuple of ActionInfo objects
"""
def getActionInfo(action_chain, object=None, check_visibility=0,
check_condition=0):
""" Get an ActionInfo object specified by a chain of actions.
Permission -- Always available
Returns -- ActionInfo object
"""
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.
Each ActionInfo object has the following keys:
- id (string): not unique identifier
- title (string)
- url (string): URL to access the action
- category (string): one of "user", "folder", "object", "global",
"workflow" or a custom category
- visible (boolean)
- available (boolean): the result of checking the condition
- 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.
"""
=== Added File Products/CMFCore/z2interfaces/portal_catalog.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Catalog tool interface.
$Id: portal_catalog.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_catalog(Interface):
'''This tool interacts with a customized ZCatalog.
'''
id = Attribute('id', 'Must be set to "portal_catalog"')
# searchResults inherits security assertions from ZCatalog.
def searchResults(REQUEST=None, **kw):
'''Calls ZCatalog.searchResults() with extra arguments that
limit the results to what the user is allowed to see.
'''
# __call__ inherits security assertions from ZCatalog.
def __call__(REQUEST=None, **kw):
'''Same as searchResults().'''
def unrestrictedSearchResults(REQUEST=None, **kw):
'''Calls ZCatalog.searchResults() without any CMF specific
processing.
Permission -- Python only
'''
def indexObject(object):
""" Add to catalog.
Permission -- Python only
"""
def unindexObject(object):
""" Remove from catalog.
Permission -- Python only
"""
def reindexObject(object, idxs=[], update_metadata=1):
""" Update entry in catalog.
The optional idxs argument is a list of specific indexes
to update (all of them by default).
Permission -- Python only
"""
class IndexableObjectWrapper(Interface):
""" Indexable object wrapper interface.
"""
def allowedRolesAndUsers():
"""
Return a list of roles and users with View permission.
Used by PortalCatalog to filter out items you're not allowed to see.
"""
=== Added File Products/CMFCore/z2interfaces/portal_discussion.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Discussion tool interface.
$Id: portal_discussion.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class oldstyle_portal_discussion(Interface):
""" Links content to discussions.
"""
id = Attribute('id', 'Must be set to "portal_discussion"')
def getDiscussionFor(content):
""" Get DiscussionItemContainer for content, create it if necessary.
Permission -- Always available
Returns -- DiscussionItemContainer object
"""
def isDiscussionAllowedFor(content):
""" Get boolean indicating whether discussion is allowed for content.
This may be looked up via an object-specific value, or by place, or
from a site-wide policy.
Permission -- Always available
Returns -- Boolean value
"""
class portal_discussion(oldstyle_portal_discussion):
""" Links content to discussions.
"""
def overrideDiscussionFor(content, allowDiscussion):
""" Override discussability for the given object or clear the setting.
If 'allowDiscussion' is None, then clear any overridden setting for
discussability, letting the site's default policy apply. Otherwise,
set the override to match the boolean equivalent of 'allowDiscussion'.
Permission -- Always available
"""
=== Added File Products/CMFCore/z2interfaces/portal_memberdata.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Memberdata storage tool interface.
$Id: portal_memberdata.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_memberdata(Interface):
'''A helper for portal_membership that transparently adds
member data to user objects.
'''
id = Attribute('id', 'Must be set to "portal_memberdata"')
## wrapUser__roles__ = () # Private.
def wrapUser(u):
'''
If possible, returns the Member object that corresponds
to the given User object.
'''
## getMemberDataContents__roles__ = () # Private.
def getMemberDataContents():
'''
Returns a list containing a dictionary with information
about the _members BTree contents: member_count is the
total number of member instances stored in the memberdata-
tool while orphan_count is the number of member instances
that for one reason or another are no longer in the
underlying acl_users user folder.
The result is designed to be iterated over in a dtml-in
'''
def pruneMemberDataContents():
""" Delete member data of all members not listet in acl_users.
Compare the user IDs stored in the member data tool with the list in
the actual underlying acl_users and delete anything not in acl_users.
Permission -- Python only
"""
def searchMemberData(search_param, search_term, attributes=()):
""" Search members.
Returns a sequence of dictionaries containing data for members
that match the query as expressed by search_param and search_term.
The contents of each member data mapping can be influenced by
passing in a sequence of desired attributes, by default the only
data returned is the username and the email address.
Permission -- Python only
Returns -- Sequence of dictionaries
"""
def registerMemberData(m, id):
""" Add the given member data to the _members btree.
This is done as late as possible to avoid side effect transactions and
to reduce the necessary number of entries.
Permission -- Python only
"""
def deleteMemberData(member_id):
""" Delete member data of specified member.
Permission -- Python only
Returns -- Boolean value
"""
class MemberData(Interface):
""" MemberData interface.
"""
def setProperties(properties=None, **kw):
""" Allows the authenticated member to set his/her own properties.
Permission -- Set own properties
"""
=== Added File Products/CMFCore/z2interfaces/portal_membership.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Membership tool interface.
$Id: portal_membership.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_membership(Interface):
""" Deals with the details of how and where to store and retrieve
members and their member folders.
"""
id = Attribute('id', 'Must be set to "portal_membership"')
def setPassword(password, domains=None):
""" Allows the authenticated member to set his/her own password.
Permission -- Set own password
"""
def getAuthenticatedMember():
"""
Returns the currently authenticated member object
or the Anonymous User.
Permission -- Always available
"""
def isAnonymousUser():
"""
Returns 1 if the user is not logged in.
Permission -- Always available
"""
def checkPermission(permissionName, object, subobjectName=None):
"""
Checks whether the current user has the given permission on
the given object or subobject.
Permission -- Always available
"""
def credentialsChanged(password):
"""
Notifies the authentication mechanism that this user has changed
passwords. This can be used to update the authentication cookie.
Note that this call should *not* cause any change at all to user
databases.
Permission -- Always available
"""
def getMembersFolder():
""" Get the members folder object.
If no members folder is set or the set folder id doesn't exist, None
is returned.
Permission -- Always available
Returns -- Members folder object or None
"""
def getHomeFolder(id=None, verifyPermission=0):
"""Returns a member's home folder object or None.
Set verifyPermission to 1 to return None when the user
doesn't have the View permission on the folder.
Permission -- Always available
"""
def getHomeUrl(id=None, verifyPermission=0):
"""Returns the URL to a member's home folder or None.
Set verifyPermission to 1 to return None when the user
doesn't have the View permission on the folder.
Permission -- Always available
"""
def getMemberById(id):
"""
Returns the given member.
Permission -- Manage users
"""
def listMemberIds():
""" Lists the ids of all members.
This may eventually be replaced with a set of methods for querying
pieces of the list rather than the entire list at once.
Permission -- Manage users
"""
def listMembers():
""" Gets the list of all members.
Permission -- Manage users
"""
def getCandidateLocalRoles(obj):
""" What local roles can I assign?
Permission -- Always available
Returns -- Tuple of roles
"""
def setLocalRoles(obj, member_ids, member_role, reindex=1):
""" Add local roles on an item.
Permission -- Always available
"""
def deleteLocalRoles(obj, member_ids, reindex=1, recursive=0):
""" Delete local roles of specified members.
Permission -- Always available
"""
def addMember(id, password, roles, domains):
""" Adds a new member to the user folder.
Security checks will have already been performed. Called by
portal_registration.
Permission -- Python only
"""
def deleteMembers(member_ids, delete_memberareas=1, delete_localroles=1):
""" Delete members specified by member_ids.
Delete members in acl_users and member data in portal_memberdata.
If delete_memberareas is true, delete members' home folders including
all content items. If delete_localroles is true, recursively delete
members' local roles, starting from the portal root.
Permission -- Manage users
Returns -- Tuple listing member_ids of deleted members
"""
def getPortalRoles():
"""
Return all local roles defined by the portal itself,
which means roles that are useful and understood
by the portal object
Permission -- Manage portal
"""
def setRoleMapping(portal_role, userfolder_role):
"""
set the mapping of roles between roles understood by
the portal and roles coming from outside user sources
Permission -- Manage portal
"""
def getMappedRole(portal_role):
"""
returns a role name if the portal role is mapped to
something else or an empty string if it is not
Permission -- Manage portal
"""
def getMemberareaCreationFlag():
"""
Returns the flag indicating whether the membership tool
will create a member area if an authenticated user from
an underlying user folder logs in first without going
through the join process
Permission -- Manage portal
"""
def setMemberareaCreationFlag():
"""
sets the flag indicating whether the membership tool
will create a member area if an authenticated user from
an underlying user folder logs in first without going
through the join process
Permission -- Manage portal
"""
def createMemberArea(member_id=''):
""" Create a member area for 'member_id' or authenticated user.
Permission -- Always available
Returns -- created member folder object or None
"""
def createMemberarea(member_id=''):
""" Deprecated alias of createMemberArea.
"""
def deleteMemberArea(member_id):
""" Delete member area of member specified by member_id.
Permission -- Manage users
Returns -- Boolean value
"""
=== Added File Products/CMFCore/z2interfaces/portal_metadata.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Metadata registration tool interface.
$Id: portal_metadata.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_metadata(Interface):
"""
CMF metadata policies interface.
"""
id = Attribute('id', 'Must be set to "portal_metadata"')
#
# Site-wide queries.
#
def getFullName(userid):
"""
Convert an internal userid to a "formal" name, if
possible, perhaps using the 'portal_membership' tool.
Used to map userid's for Creator, Contributor DCMI
queries.
"""
def getPublisher():
"""
Return the "formal" name of the publisher of the
portal.
"""
#
# Content-specific queries.
#
def listAllowedSubjects(content=None):
"""
List the allowed values of the 'Subject' DCMI element
'Subject' elements should be keywords categorizing
their resource.
Return only values appropriate for content's type, or
all values if None.
"""
def listAllowedFormats(content=None):
"""
List the allowed values of the 'Format' DCMI element.
These items should be usable as HTTP 'Content-type'
values.
Return only values appropriate for content's type, or
all values if None.
"""
def listAllowedLanguages(content=None):
"""
List the allowed values of the 'Language' DCMI element.
'Language' element values should be suitable for generating
HTTP headers.
Return only values appropriate for content's type, or
all values if None.
"""
def listAllowedRights(content=None):
"""
List the allowed values of the 'Rights' DCMI element.
The 'Rights' element describes copyright or other IP
declarations pertaining to a resource.
Return only values appropriate for content's type, or
all values if None.
"""
#
# Validation policy hooks.
#
def setInitialMetadata(content):
"""
Set initial values for content metatdata, supplying
any site-specific defaults.
"""
def validateMetadata(content):
"""
Enforce portal-wide policies about DCI, e.g.,
requiring non-empty title/description, etc. Called
by the CMF immediately before saving changes to the
metadata of an object.
"""
=== Added File Products/CMFCore/z2interfaces/portal_properties.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Properties tool interface.
$Id: portal_properties.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_properties(Interface):
""" CMF Properties Tool interface.
This interface provides access to "portal-wide" properties.
"""
id = Attribute('id', 'Must be set to "portal_properties"')
def editProperties(props):
""" Change portal settings.
Permission -- Manage portal
"""
def title():
""" Get portal title.
Returns -- String
"""
def smtp_server():
""" Get local SMTP server.
Returns -- String
"""
=== Added File Products/CMFCore/z2interfaces/portal_registration.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Registration tool interface.
$Id: portal_registration.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_registration(Interface):
'''Establishes policies for member registration. Depends on
portal_membership. Is not aware of membership storage details.
'''
id = Attribute('id', 'Must be set to "portal_registration"')
#isRegistrationAllowed__roles__ = None # Anonymous permission
def isRegistrationAllowed(REQUEST):
'''Returns a boolean value indicating whether the user
is allowed to add a member to the portal.
'''
#testPasswordValidity__roles__ = None # Anonymous permission
def testPasswordValidity(password, confirm=None):
'''If the password is valid, returns None. If not, returns
a string explaining why.
'''
#testPropertiesValidity__roles__ = None # Anonymous permission
def testPropertiesValidity(new_properties, member=None):
'''If the properties are valid, returns None. If not, returns
a string explaining why.
'''
#generatePassword__roles__ = None # Anonymous permission
def generatePassword():
'''Generates a password which is guaranteed to comply
with the password policy.
'''
# permission: 'Add portal member'
def addMember(id, password, roles=('Member',), domains='',
properties=None):
'''Creates a PortalMember and returns it. The properties argument
can be a mapping with additional member properties. Raises an
exception if the given id already exists, the password does not
comply with the policy in effect, or the authenticated user is not
allowed to grant one of the roles listed (where Member is a special
role that can always be granted); these conditions should be
detected before the fact so that a cleaner message can be printed.
'''
# permission: 'Add portal member'
def isMemberIdAllowed(id):
'''Returns 1 if the ID is not in use and is not reserved.
'''
#afterAdd__roles__ = () # No permission.
def afterAdd(member, id, password, properties):
'''Called by portal_registration.addMember()
after a member has been added successfully.'''
# permission: 'Mail forgotten password'
def mailPassword(forgotten_userid, REQUEST):
'''Email a forgotten password to a member. Raises an exception
if user ID is not found.
'''
=== Added File Products/CMFCore/z2interfaces/portal_skins.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Skins tool interface.
$Id: portal_skins.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class SkinsContainer(Interface):
""" An object that provides skins.
"""
def getSkinPath(name):
""" Convert a skin name to a skin path.
Permission -- Access contents information
"""
def getDefaultSkin():
""" Get the default skin name.
Permission -- Access contents information
"""
def getRequestVarname():
""" Get the variable name to look for in the REQUEST.
Permission -- Access contents information
"""
def getSkinByPath(path, raise_exc=0):
""" Get a skin at the given path.
A skin path is of the format:
'some/path, some/other/path, ...' The first part has precedence.
A skin is a specially wrapped object that looks through the layers
in the correct order.
Permission -- Python only
"""
def getSkinByName(name):
""" Get the named skin.
Permission -- Python only
"""
class portal_skins(SkinsContainer):
""" An object that provides skins to a portal object.
"""
id = Attribute('id', 'Must be set to "portal_skins"')
def getSkinSelections():
""" Get the sorted list of available skin names.
Permission -- Always available
"""
=== Added File Products/CMFCore/z2interfaces/portal_types.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Type registration tool interface.
$Id: portal_types.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class ContentTypeInformation(Interface):
"""
Registry entry interface.
"""
def Metatype():
"""
Return the Zope 'meta_type' for this content object.
o Deprecated (not all objects of a given type may even share
the same meta_type).
"""
def Title():
"""
Return the "human readable" type name (note that it
may not map exactly to the 'meta_type', e.g., for
l10n/i18n or where a single content class is being
used twice, under different names.
"""
def Description():
"""
Textual description of the class of objects (intended
for display in a "constructor list").
"""
def isConstructionAllowed(container):
"""
Does the current user have the permission required in
order to construct an instance?
"""
def allowType(contentType):
"""
Can objects of 'contentType' be added to containers whose
type object we are?
"""
def constructInstance(container, id):
"""
Build a "bare" instance of the appropriate type in
'container', using 'id' as its id. Return the instance,
seated in the container.
"""
def allowDiscussion():
"""
Can this type of object support discussion?
"""
def getIcon():
"""
Returns the portal-relative icon for this type.
"""
def getMethodAliases():
""" Get method aliases dict.
Permission -- Manage portal
Returns -- Dictionary
"""
def setMethodAliases(aliases):
""" Set method aliases dict.
Permission -- Manage portal
Returns -- Boolean value
"""
def queryMethodID(alias, default=None, context=None):
""" Query method ID by alias.
context points to the object that calls queryMethodID. It may be used to
return dynamic values based on the caller.
Permission -- Always available
Returns -- Method ID or default value
"""
class portal_types(Interface):
"""
Provides a configurable registry of portal content types.
"""
id = Attribute('id', 'Must be set to "portal_types"')
# getType__roles__ = None # Public
def getTypeInfo(contentType):
"""
Return an instance which implements the
ContentTypeInformation interface, corresponding to
the specified 'contentType'. If contentType is actually
an object, rather than a string, attempt to look up
the appropriate type info using its portal_type.
"""
# listTypeInfo__roles__ = None # Public
def listTypeInfo(container=None):
"""
Return a sequence of instances which implement the
ContentTypeInformation interface, one for each content
type regisetered in the portal. If the container
is specified, the list will be filtered according to
the user's permissions.
"""
def listContentTypes(container=None, by_metatype=0):
"""
Return list of content types, or the equivalent
metatypes; if 'container' is passed, then filter
the list to include only types which are addable in
'container'.
"""
def constructContent(contentType, container, id, RESPONSE=None
, *args, **kw):
"""
Build an instance of the appropriate content class in
'container', using 'id'. If RESPONSE is provided, redirect
to the new object's "initial view", otherwise return the
new object's Id string.
"""
=== Added File Products/CMFCore/z2interfaces/portal_undo.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Undo tool interface.
$Id: portal_undo.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_undo(Interface):
'''Provides access to Zope undo functions.
'''
id = Attribute('id', 'Must be set to "portal_undo"')
# permission: 'Undo changes'
def listUndoableTransactionsFor(object,
first_transaction=None,
last_transaction=None,
PrincipiaUndoBatchSize=None):
'''Lists all transaction IDs the user is allowed to undo.
'''
# permission: 'Undo changes'
def undo(object, transaction_info):
'''Performs an undo operation.
'''
=== Added File Products/CMFCore/z2interfaces/portal_url.py ===
##############################################################################
#
# Copyright (c) 2002 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.
#
##############################################################################
""" URL tool interface.
$Id: portal_url.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
class portal_url(Interface):
""" CMF URL Tool interface.
This interface provides a common mechanism for finding the 'root'
object of a CMFSite, and for computing paths to objects relative to
that root.
"""
id = Attribute('id', 'Must be set to "portal_url"')
def __call__(relative=0, *args, **kw):
""" Get by default the absolute URL of the portal.
Permission -- Always available
Returns -- Slash-separated string
"""
def getPortalObject():
""" Get the portal object itself.
Permission -- Always available
Returns -- CMFSite object
"""
def getRelativeContentPath(content):
""" Get the path for an object, relative to the portal root.
Permission -- Always available
Returns -- Tuple of IDs
"""
def getRelativeContentURL(content):
""" Get the URL for an object, relative to the portal root.
This is helpful for virtual hosting situations.
Same method as 'getRelativeURL()'
Permission -- Always available
Returns -- Slash-separated string
"""
def getRelativeUrl(content):
""" Get the URL for an object, relative to the portal root.
This is helpful for virtual hosting situations.
Same method as 'getRelativeContentURL()'
Permission -- Always available
Returns -- Slash-separated string
"""
def getPortalPath():
""" Get the portal object's URL without the server URL component.
Permission -- Always available
Returns -- Slash-separated string
"""
=== Added File Products/CMFCore/z2interfaces/portal_workflow.py ===
##############################################################################
#
# Copyright (c) 2001 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.
#
##############################################################################
""" Workflow tool interface.
$Id: portal_workflow.py,v 1.1.2.1 2005/07/15 22:41:19 tseaver Exp $
"""
from Interface import Attribute
from Interface import Interface
_marker = []
class portal_workflow(Interface):
'''This tool accesses and changes the workflow state of content.
'''
id = Attribute('id', 'Must be set to "portal_workflow"')
# security.declarePrivate('getCatalogVariablesFor')
def getCatalogVariablesFor(ob):
'''
Invoked by portal_catalog. Allows workflows
to add variables to the catalog based on workflow status,
making it possible to implement queues.
Returns a mapping containing the catalog variables
that apply to ob.
'''
# security.declarePublic('getActionsFor')
def getActionsFor(ob):
'''
This method is deprecated and will be removed in CMF 1.7.
Return a list of action dictionaries for 'ob', just as though
queried via 'ActionsTool.listFilteredActionsFor'.
'''
# security.declarePublic('doActionFor')
def doActionFor(ob, action, wf_id=None, *args, **kw):
'''
Invoked by user interface code.
Allows the user to request a workflow action. The workflow object
must perform its own security checks.
'''
# security.declarePublic('getInfoFor')
def getInfoFor(ob, name, default=_marker, wf_id=None, *args, **kw):
'''
Invoked by user interface code. Allows the user to request
information provided by the workflow. The workflow object
must perform its own security checks.
'''
# security.declarePrivate('notifyCreated')
def notifyCreated(ob):
'''
Notifies all applicable workflows after an object has been created
and put in its new place.
'''
# security.declarePrivate('notifyBefore')
def notifyBefore(ob, action):
'''
Notifies all applicable workflows of an action before it happens,
allowing veto by exception. Unless an exception is thrown, either
a notifySuccess() or notifyException() can be expected later on.
The action usually corresponds to a method name.
'''
# security.declarePrivate('notifySuccess')
def notifySuccess(ob, action, result=None):
'''
Notifies all applicable workflows that an action has taken place.
'''
# security.declarePrivate('notifyException')
def notifyException(ob, action, exc):
'''
Notifies all applicable workflows that an action failed.
'''
# security.declarePrivate('getHistoryOf')
def getHistoryOf(wf_id, ob):
'''
Invoked by workflow definitions. Returns the history
of an object.
'''
# security.declarePrivate('getStatusOf')
def getStatusOf(wf_id, ob):
'''
Invoked by workflow definitions. Returns the last element of a
history.
'''
# security.declarePrivate('setStatusOf')
def setStatusOf(wf_id, ob, status):
'''
Invoked by workflow definitions. Appends to the workflow history.
'''
class WorkflowDefinition(Interface):
'''The interface expected of workflow definitions objects.
Accesses and changes the workflow state of objects.
'''
# security.declarePrivate('getCatalogVariablesFor')
def getCatalogVariablesFor(ob):
'''
Invoked by the portal_workflow tool.
Allows this workflow to make workflow-specific variables
available to the catalog, making it possible to implement
queues in a simple way.
Returns a mapping containing the catalog variables
that apply to ob.
'''
#security.declarePrivate('updateRoleMappingsFor')
def updateRoleMappingsFor(ob):
'''
Updates the object permissions according to the current
workflow state.
'''
# security.declarePrivate('listObjectActions')
def listObjectActions(info):
'''
Invoked by the portal_workflow tool.
Allows this workflow to
include actions to be displayed in the actions box.
Called only when this workflow is applicable to
info.content.
Returns the actions to be displayed to the user.
'''
# security.declarePrivate('listGlobalActions')
def listGlobalActions(info):
'''
Invoked by the portal_workflow tool.
Allows this workflow to
include actions to be displayed in the actions box.
Generally called on every request!
Returns the actions to be displayed to the user.
'''
# security.declarePrivate('isActionSupported')
def isActionSupported(ob, action):
'''
Invoked by the portal_workflow tool.
Returns a true value if the given action name is supported.
'''
# security.declarePrivate('doActionFor')
def doActionFor(ob, action, comment=''):
'''
Invoked by the portal_workflow tool.
Allows the user to request a workflow action. This method
must perform its own security checks.
'''
# security.declarePrivate('isInfoSupported')
def isInfoSupported(ob, name):
'''
Invoked by the portal_workflow tool.
Returns a true value if the given info name is supported.
'''
# security.declarePrivate('getInfoFor')
def getInfoFor(ob, name, default):
'''
Invoked by the portal_workflow tool.
Allows the user to request information provided by the
workflow. This method must perform its own security checks.
'''
# security.declarePrivate('notifyCreated')
def notifyCreated(ob):
'''
Invoked by the portal_workflow tool.
Notifies this workflow after an object has been created
and put in its new place.
'''
# security.declarePrivate('notifyBefore')
def notifyBefore(ob, action):
'''
Invoked by the portal_workflow tool.
Notifies this workflow of an action before it happens,
allowing veto by exception. Unless an exception is thrown, either
a notifySuccess() or notifyException() can be expected later on.
The action usually corresponds to a method name.
'''
# security.declarePrivate('notifySuccess')
def notifySuccess(ob, action, result):
'''
Invoked by the portal_workflow tool.
Notifies this workflow that an action has taken place.
'''
# security.declarePrivate('notifyException')
def notifyException(ob, action, exc):
'''
Invoked by the portal_workflow tool.
Notifies this workflow that an action failed.
'''
More information about the CMF-checkins
mailing list