[CMF-checkins] CVS: CMF/CMFCore/interfaces - ContentTypeRegistry.py:1.3 Contentish.py:1.3 DublinCore.py:1.2 portal_actions.py:1.2 portal_catalog.py:1.2 portal_discussion.py:1.2 portal_memberdata.py:1.2 portal_membership.py:1.2 portal_metadata.py:1.2 portal_registration.py:1.2 portal_skins.py:1.2 portal_types.py:1.6 portal_undo.py:1.2 portal_workflow.py:1.4
Jeffrey P Shell
jeffrey@zope.com
Mon, 13 Aug 2001 11:18:25 -0400
Update of /cvs-repository/CMF/CMFCore/interfaces
In directory cvs.zope.org:/tmp/cvs-serv2280
Modified Files:
ContentTypeRegistry.py Contentish.py DublinCore.py
portal_actions.py portal_catalog.py portal_discussion.py
portal_memberdata.py portal_membership.py portal_metadata.py
portal_registration.py portal_skins.py portal_types.py
portal_undo.py portal_workflow.py
Log Message:
Updated to actually use the Zope Interface package
=== CMF/CMFCore/interfaces/ContentTypeRegistry.py 1.2 => 1.3 ===
##############################################################################
"""
- Declare interfaces for MIMEtype <-> Type object registry objects.
+Declare interfaces for MIMEtype <-> Type object registry objects.
"""
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-
-class ContentTypeRegistryPredicate( Base ):
- """
- Express a rule for matching a given name/typ/body.
+class ContentTypeRegistryPredicate(Base):
+ """\
+ Express a rule for matching a given name/typ/body.
"""
- def __call__( self, name, typ, body ):
- """
- Return true if the rule matches, else false.
- """
-
- def getTypeLabel( self ):
- """
- Return a human-readable label for the predicate type.
- """
-
- def edit( self, **kw ):
- """
- Update the predicate.
- """
- def predicateWidget( self ):
- """
- 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.
+ def __call__(name, typ, body):
+ """ Return true if the rule matches, else false. """
- The registry will call the predictate's 'edit' method,
- passing the fields of the record.
- """
+ def getTypeLabel():
+ """ Return a human-readable label for the predicate type. """
+
+ def edit(**kw):
+ """ Update the predicate. """
-class ContentTypeRegistry( Base ):
- """
- Registry for rules which map PUT args to a CMF Type Object.
- """
- def findTypeName( self, 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.
+ def 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.
+ """
+
+class ContentTypeRegistry(Base):
+ """ 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.
"""
=== CMF/CMFCore/interfaces/Contentish.py 1.2 => 1.3 ===
#
##############################################################################
-class Contentish:
+import Interface
+
+class Contentish(Interface.Base):
"""
General interface for "contentish" items.
@@ -92,7 +94,7 @@
PortalContent implements this interface.
"""
- def getIcon(self, relative_to_portal=0):
+ def getIcon(relative_to_portal=0):
"""
This method returns the path to an object's icon. It is used
in the folder_contents view to generate an appropriate icon
@@ -107,7 +109,7 @@
return it as an absolute URL.
"""
- def listActions(self):
+ def listActions():
"""
listAction returns a tuple containing dictionaries that describe
a specific "action". An "action" shows up as a link in the PTK
@@ -119,7 +121,7 @@
content object.
"""
- def SearchableText(self):
+ def SearchableText():
"""
SearchableText is called to provide the Catalog with textual
information about your object. It is a string usually generated
@@ -128,7 +130,7 @@
make it findable through the catalog.
"""
- def allowedRolesAndUsers(self, permission='View'):
+ def allowedRolesAndUsers(permission='View'):
"""
Return a list of roles and users with View permission.
Used by PortalCatalog to filter out items you're not allowed to see.
=== CMF/CMFCore/interfaces/DublinCore.py 1.1 => 1.2 ===
#
##############################################################################
-class DublinCore:
+import Interface
+
+class DublinCore(Interface.Base):
"""
Define which Dublin Core metadata elements are supported by the PTK,
and the semantics therof.
"""
- def Title( self ):
+ def Title():
"""
Dublin Core element - resource name
@@ -96,7 +98,7 @@
Permissions: View
"""
- def Creator( self ):
+ def Creator():
"""
Dublin Core element - resource creator
@@ -106,7 +108,7 @@
Permission: View
"""
- def Subject( self ):
+ def Subject():
"""
Dublin Core element - resource keywords
@@ -116,7 +118,7 @@
Permission: View
"""
- def Description( self ):
+ def Description():
"""
Dublin Core element - resource summary
@@ -126,7 +128,7 @@
Permissions: View
"""
- def Publisher( self ):
+ def Publisher():
"""
Dublin Core element - resource publisher
@@ -137,7 +139,7 @@
Permission: View
"""
- def Contributors( self ):
+ def Contributors():
"""
Dublin Core element - resource collaborators
@@ -147,7 +149,7 @@
Permission: View
"""
- def Date( self ):
+ def Date():
"""
Dublin Core element - default date
@@ -155,7 +157,7 @@
Permissions: View
"""
- def CreationDate( self ):
+ def CreationDate():
"""
Dublin Core element - date resource created.
@@ -163,7 +165,7 @@
Permissions: View
"""
- def EffectiveDate( self ):
+ def EffectiveDate():
"""
Dublin Core element - date resource becomes effective.
@@ -171,7 +173,7 @@
Permissions: View
"""
- def ExpirationDate( self ):
+ def ExpirationDate():
"""
Dublin Core element - date resource expires.
@@ -179,7 +181,7 @@
Permissions: View
"""
- def ModificationDate( self ):
+ def ModificationDate():
"""
Dublin Core element - date resource last modified.
@@ -187,7 +189,7 @@
Permissions: View
"""
- def Type( self ):
+ def Type():
"""
Dublin Core element - resource type
@@ -198,7 +200,7 @@
Permissions: View
"""
- def Format( self ):
+ def Format():
"""
Dublin Core element - resource format
@@ -209,7 +211,7 @@
Permissions: View
"""
- def Identifier( self ):
+ def Identifier():
"""
Dublin Core element - resource ID
@@ -219,7 +221,7 @@
Permissions: View
"""
- def Language( self ):
+ def Language():
"""
Dublin Core element - resource language
@@ -230,7 +232,7 @@
Permissions: View
"""
- def Rights( self ):
+ def Rights():
"""
Dublin Core element - resource copyright
@@ -242,11 +244,11 @@
Permissions: View
"""
-class CatalogableDublinCore:
+class CatalogableDublinCore(Interface.Base):
"""
Provide Zope-internal date objects for cataloging purposes.
"""
- def created( self ):
+ def created():
"""
Dublin Core element - date resource created,
@@ -254,7 +256,7 @@
Permissions: View
"""
- def effective( self ):
+ def effective():
"""
Dublin Core element - date resource becomes effective,
@@ -262,7 +264,7 @@
Permissions: View
"""
- def expires( self ):
+ def expires():
"""
Dublin Core element - date resource expires,
@@ -270,7 +272,7 @@
Permissions: View
"""
- def modified( self ):
+ def modified():
"""
Dublin Core element - date resource last modified,
@@ -278,34 +280,34 @@
Permissions: View
"""
-class MutableDublinCore:
+class MutableDublinCore(Interface.Base):
"""
Update interface for mutable metadata.
"""
- def setTitle( self, title ):
+ def setTitle(title):
"Dublin Core element - update resource name"
- def setSubject( self, subject ):
+ def setSubject(subject):
"Dublin Core element - update resource keywords"
- def setDescription( self, description ):
+ def setDescription(description):
"Dublin Core element - update resource summary"
- def setContributors( self, contributors ):
+ def setContributors(contributors):
"Dublin Core element - update additional contributors to resource"
- def setEffectiveDate( self, effective_date ):
+ def setEffectiveDate(effective_date):
""" Dublin Core element - update date resource becomes effective. """
- def setExpirationDate( self, expiration_date ):
+ def setExpirationDate(expiration_date):
""" Dublin Core element - update date resource expires. """
- def setFormat( self, format ):
+ def setFormat(format):
""" Dublin Core element - update resource format """
- def setLanguage( self, language ):
+ def setLanguage(language):
""" Dublin Core element - update resource language """
- def setRights( self, rights ):
+ def setRights(rights):
""" Dublin Core element - update resource copyright """
=== CMF/CMFCore/interfaces/portal_actions.py 1.1 => 1.2 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Base, Attribute
-class portal_actions (Base):
+class portal_actions(Base):
'''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"')
# listFilteredActionsFor__roles__ = None
- def listFilteredActionsFor(self, object):
+ def listFilteredActionsFor(object):
'''Gets all actions available to the user and returns a mapping
containing a list of user actions, folder actions, object actions,
and global actions. Each action has the following keys:
@@ -116,17 +112,17 @@
'''
# listFilteredActions__roles__ = None
- def listFilteredActions(self):
+ def listFilteredActions():
'''Gets all actions available to the user in no particular context.
'''
-class ActionProvider (Base):
+class ActionProvider():
'''The interface expected of an object that can provide actions.
'''
# listActions__roles__ = () # No permission.
- def listActions(self, info):
+ def listActions(info):
'''Returns a list of mappings describing actions. Each action
should contain the keys "name", "url", "permissions", and
"category", conforming to the specs outlined in
=== CMF/CMFCore/interfaces/portal_catalog.py 1.1 => 1.2 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class portal_catalog (Base):
+class portal_catalog():
'''This tool interacts with a customized ZCatalog.
'''
id = Attribute('id', 'Must be set to "portal_catalog"')
# searchResults inherits security assertions from ZCatalog.
- def searchResults(self, REQUEST=None, **kw):
+ def searchResults(REQUEST=None, **kw):
'''Calls SiteIndex.searchResults() with extra arguments that
limit the results to what the user is allowed to see.
'''
# __call__ inherits security assertions from ZCatalog.
- def __call__(self, REQUEST=None, **kw):
+ def __call__(REQUEST=None, **kw):
'''Same as searchResults().'''
# indexObject__roles__ = () # Called only by Python code.
- def indexObject(self, object):
+ def indexObject(object):
'''Add to catalog.
'''
# unindexObject__roles__ = ()
- def unindexObject(self, object):
+ def unindexObject(object):
'''Remove from catalog.
'''
# reindexObject__roles__ = ()
- def reindexObject(self, object):
+ def reindexObject(object):
'''Update entry in catalog.
'''
# getpath inherits security assertions from ZCatalog.
- def getpath(self, data_record_id_):
+ def getpath(data_record_id_):
'''Calls ZCatalog.getpath().
'''
=== CMF/CMFCore/interfaces/portal_discussion.py 1.1 => 1.2 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class portal_discussion (Base):
+class portal_discussion(Base):
'''Links content to discussions.
'''
id = Attribute('id', 'Must be set to "portal_discussion"')
#getDiscussionFor__roles__ = None
- def getDiscussionFor(self, content):
+ def getDiscussionFor(content):
'''Gets the PortalDiscussion object that applies to content.
'''
#isDiscussionAllowedFor__roles__ = None
- def isDiscussionAllowedFor(self, content):
+ def isDiscussionAllowedFor(content):
'''Returns a boolean indicating whether a discussion is
allowed for the specified content.
'''
=== CMF/CMFCore/interfaces/portal_memberdata.py 1.1 => 1.2 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class portal_memberdata (Base):
+class portal_memberdata(Base):
'''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(self, u):
+ def wrapUser(u):
'''
If possible, returns the Member object that corresponds
to the given User object.
'''
## getMemberDataContents__roles__ = () # Private.
- def getMemberDataContents(self):
+ def getMemberDataContents():
'''
Returns a list containing a dictionary with information
about the _members BTree contents: member_count is the
@@ -120,9 +116,9 @@
'''
## pruneMemberDataContents__roles__ = () # Private.
- def pruneMemberDataContents(self):
- '''
- 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
- '''
+ def pruneMemberDataContents():
+ '''
+ 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
+ '''
=== CMF/CMFCore/interfaces/portal_membership.py 1.1 => 1.2 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class portal_membership (Base):
+class portal_membership(Base):
'''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"')
#getAuthenticatedMember__roles__ = None # Allow all.
- def getAuthenticatedMember(self):
+ def getAuthenticatedMember():
'''
Returns the currently authenticated member object
or the Anonymous User.
'''
#isAnonymousUser__roles__ = None # Allow all.
- def isAnonymousUser(self):
+ def isAnonymousUser():
'''
Returns 1 if the user is not logged in.
'''
#checkPermission__roles__ = None # Allow all.
- def checkPermission(self, permissionName, object, subobjectName=None):
+ def checkPermission(permissionName, object, subobjectName=None):
'''
Checks whether the current user has the given permission on
the given object or subobject.
'''
#credentialsChanged__roles__ = None # Allow all.
- def credentialsChanged(self, password):
+ def credentialsChanged(password):
'''
Notifies the authentication mechanism that this user has changed
passwords. This can be used to update the authentication cookie.
@@ -131,45 +127,45 @@
'''
# getHomeFolder__roles__ = None # Anonymous permission
- def getHomeFolder(self, id=None, verifyPermission=0):
+ 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.
"""
# getHomeUrl__roles__ = None # Anonymous permission
- def getHomeUrl(self, id=None, verifyPermission=0):
+ 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: 'Manage portal'
- def getMemberById(self, id):
+ def getMemberById(id):
'''
Returns the given member.
'''
# permission: 'Manage portal'
- def listMemberIds(self):
+ 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 portal'
- def listMembers(self):
+ def listMembers():
'''Gets the list of all members.
'''
#addMember__roles__ = () # No permission.
- def addMember(self, id, password, roles, domains):
+ 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.
'''
# getPortalRoles__roles__ = () # Private
- def getPortalRoles(self):
+ def getPortalRoles():
"""
Return all local roles defined by the portal itself,
which means roles that are useful and understood
@@ -177,21 +173,21 @@
"""
# setRoleMapping__roles__ = () # Private
- def setRoleMapping(self, portal_role, userfolder_role):
+ def setRoleMapping(portal_role, userfolder_role):
"""
set the mapping of roles between roles understood by
the portal and roles coming from outside user sources
"""
# getMappedRole__roles__ = () # Private
- def getMappedRole(self, portal_role):
+ 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
"""
# getMemberareaCreationFlag__roles__ = () # Private
- def getMemberareaCreationFlag(self):
+ def getMemberareaCreationFlag():
"""
Returns the flag indicating whether the membership tool
will create a member area if an authenticated user from
@@ -200,7 +196,7 @@
"""
# setMemberareaCreationFlag__roles__ = () # Private
- def setMemberareaCreationFlag(self):
+ def setMemberareaCreationFlag():
"""
sets the flag indicating whether the membership tool
will create a member area if an authenticated user from
@@ -209,7 +205,7 @@
"""
# createMemberarea__roles__ = () # Private
- def createMemberarea(self, member_id):
+ def createMemberarea(member_id):
"""
create a member area, only used if members are sourced
from an independent underlying user folder and not just
=== CMF/CMFCore/interfaces/portal_metadata.py 1.1 => 1.2 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class portal_metadata( Base ):
+class portal_metadata(Base):
"""
CMF metadata policies interface.
"""
@@ -102,7 +98,7 @@
#
# Site-wide queries.
#
- def getFullName( self, userid ):
+ def getFullName(userid):
"""
Convert an internal userid to a "formal" name, if
possible, perhaps using the 'portal_membership' tool.
@@ -111,7 +107,7 @@
queries.
"""
- def getPublisher( self ):
+ def getPublisher():
"""
Return the "formal" name of the publisher of the
portal.
@@ -120,7 +116,7 @@
#
# Content-specific queries.
#
- def listAllowedSubjects( self, content=None ):
+ def listAllowedSubjects(content=None):
"""
List the allowed values of the 'Subject' DCMI element
'Subject' elements should be keywords categorizing
@@ -130,7 +126,7 @@
all values if None.
"""
- def listAllowedFormats( self, content=None ):
+ def listAllowedFormats(content=None):
"""
List the allowed values of the 'Format' DCMI element.
These items should be usable as HTTP 'Content-type'
@@ -140,7 +136,7 @@
all values if None.
"""
- def listAllowedLanguages( self, content=None ):
+ def listAllowedLanguages(content=None):
"""
List the allowed values of the 'Language' DCMI element.
'Language' element values should be suitable for generating
@@ -150,7 +146,7 @@
all values if None.
"""
- def listAllowedRights( self, content=None ):
+ def listAllowedRights(content=None):
"""
List the allowed values of the 'Rights' DCMI element.
The 'Rights' element describes copyright or other IP
@@ -163,13 +159,13 @@
#
# Validation policy hooks.
#
- def setInitialMetadata( self, content ):
+ def setInitialMetadata(content):
"""
Set initial values for content metatdata, supplying
any site-specific defaults.
"""
- def validateMetadata( self, content ):
+ def validateMetadata(content):
"""
Enforce portal-wide policies about DCI, e.g.,
requiring non-empty title/description, etc. Called
=== CMF/CMFCore/interfaces/portal_registration.py 1.1 => 1.2 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class portal_registration (Base):
+class portal_registration(Base):
'''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(self, REQUEST):
+ 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(self, password, confirm=None):
+ 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(self, new_properties, member=None):
+ 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(self):
+ def generatePassword():
'''Generates a password which is guaranteed to comply
with the password policy.
'''
# permission: 'Add portal member'
- def addMember(self, id, password, roles=('Member',), domains='',
+ 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
@@ -138,27 +134,27 @@
'''
# permission: 'Add portal member'
- def isMemberIdAllowed(self, id):
+ def isMemberIdAllowed(id):
'''Returns 1 if the ID is not in use and is not reserved.
'''
#afterAdd__roles__ = () # No permission.
- def afterAdd(self, member, id, password, properties):
+ def afterAdd(member, id, password, properties):
'''Called by portal_registration.addMember()
after a member has been added successfully.'''
# permission: 'Mail forgotten password'
- def mailPassword(self, forgotten_userid, REQUEST):
+ def mailPassword(forgotten_userid, REQUEST):
'''Email a forgotten password to a member. Raises an exception
if user ID is not found.
'''
# permission: 'Set own password'
- def setPassword(self, password, domains=None):
+ def setPassword(password, domains=None):
'''Allows the authenticated member to set his/her own password.
'''
# permission: 'Set own properties'
- def setProperties(self, properties=None, **kw):
+ def setProperties(properties=None, **kw):
'''Allows the authenticated member to set his/her own properties.
'''
=== CMF/CMFCore/interfaces/portal_skins.py 1.1 => 1.2 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class portal_skins (Base):
+class portal_skins(Base):
'''An object that provides skins to a portal object.
'''
id = Attribute('id', 'Must be set to "portal_skins"')
# getSkin__roles__ = () # Private
- def getSkin(self, request):
+ def getSkin(request):
'''
Returns the requested skin object as a tuple:
(skinob, skinpath). Note that self will not normally
@@ -110,7 +106,7 @@
'''
# getSkinSelections__roles__ = None # Public
- def getSkinSelections(self):
+ def getSkinSelections():
'''
Returns the sorted list of available skin names.
'''
=== CMF/CMFCore/interfaces/portal_types.py 1.5 => 1.6 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class ContentTypeInformation( Base ):
+class ContentTypeInformation(Base):
"""
Registry entry interface.
"""
- def Metatype( self ):
+ def Metatype():
"""
Return the Zope 'meta_type' for this content object.
"""
- def Type( self ):
+ def Type():
"""
Return the "human readable" type name (note that it
may not map exactly to the 'meta_type', e.g., for
@@ -113,54 +109,54 @@
used twice, under different names.
"""
- def Description( self ):
+ def Description():
"""
Textual description of the class of objects (intended
for display in a "constructor list").
"""
- def isConstructionAllowed( self, container ):
+ def isConstructionAllowed(container):
"""
Does the current user have the permission required in
order to construct an instance?
"""
- def allowType( self, contentType ):
+ def allowType(contentType):
"""
Can objects of 'contentType' be added to containers whose
type object we are?
"""
- def constructInstance( self, container, id ):
+ def constructInstance(container, id):
"""
Build a "bare" instance of the appropriate type in
'container', using 'id' as its id. Return the URL
of its "immediate" view (typically the metadata form).
"""
- def allowDiscussion( self ):
+ def allowDiscussion():
"""
Can this type of object support discussion?
"""
- def getActionById( self, id ):
+ def getActionById(id):
"""
Return the URL of the action whose ID is id.
"""
- def getIcon(self):
+ def getIcon():
"""
Returns the portal-relative icon for this type.
"""
-class portal_types( Base ):
+class portal_types(Base):
"""
Provides a configurable registry of portal content types.
"""
id = Attribute('id', 'Must be set to "portal_types"')
# getType__roles__ = None # Public
- def getTypeInfo( self, contentType ):
+ def getTypeInfo(contentType):
"""
Return an instance which implements the
ContentTypeInformation interface, corresponding to
@@ -170,7 +166,7 @@
"""
# listTypeInfo__roles__ = None # Public
- def listTypeInfo( self, container=None ):
+ def listTypeInfo(container=None):
"""
Return a sequence of instances which implement the
ContentTypeInformation interface, one for each content
@@ -179,7 +175,7 @@
the user's permissions.
"""
- def listContentTypes( self, container=None, by_metatype=0 ):
+ def listContentTypes(container=None, by_metatype=0):
"""
Return list of content types, or the equivalent
metatypes; if 'container' is passed, then filter
@@ -187,7 +183,7 @@
'container'.
"""
- def constructContent( self, contentType, container, id ):
+ def constructContent(contentType, container, id):
"""
Build an instance of the appropriate content class in
'container', using 'id'.
=== CMF/CMFCore/interfaces/portal_undo.py 1.1 => 1.2 ===
__version__='$Revision$'[11:-2]
+from Interface import Attribute, Base
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
-
-class portal_undo (Base):
+class portal_undo(Base):
'''Provides access to Zope undo functions.
'''
id = Attribute('id', 'Must be set to "portal_undo"')
# permission: 'Undo changes'
- def listUndoableTransactionsFor(self, object,
+ def listUndoableTransactionsFor(object,
first_transaction=None,
last_transaction=None,
PrincipiaUndoBatchSize=None):
@@ -109,6 +104,6 @@
'''
# permission: 'Undo changes'
- def undo(self, object, transaction_info):
+ def undo(object, transaction_info):
'''Performs an undo operation.
'''
=== CMF/CMFCore/interfaces/portal_workflow.py 1.3 => 1.4 ===
-try:
- from Interface import *
-except:
- def Attribute( name, value ): pass
- class Base: ' '
+from Interface import Attribute, Base
-class portal_workflow (Base):
+class portal_workflow(Base):
'''This tool accesses and changes the workflow state of content.
'''
id = Attribute('id', 'Must be set to "portal_workflow"')
# security.declarePrivate('getCatalogVariablesFor')
- def getCatalogVariablesFor(self, ob):
+ def getCatalogVariablesFor(ob):
'''
Invoked by portal_catalog. Allows workflows
to add variables to the catalog based on workflow status,
@@ -111,7 +107,7 @@
'''
# security.declarePrivate('listActions')
- def listActions(self, info):
+ def listActions(info):
'''
Invoked by the portal_actions tool. Allows workflows to
include actions to be displayed in the actions box.
@@ -122,7 +118,7 @@
'''
# security.declarePublic('doActionFor')
- def doActionFor(self, ob, action, wf_id=None, *args, **kw):
+ 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
@@ -130,7 +126,7 @@
'''
# security.declarePublic('getInfoFor')
- def getInfoFor(self, ob, name, default, wf_id=None, *args, **kw):
+ def getInfoFor(ob, name, default, wf_id=None, *args, **kw):
'''
Invoked by user interface code. Allows the user to request
information provided by the workflow. The workflow object
@@ -138,14 +134,14 @@
'''
# security.declarePrivate('notifyCreated')
- def notifyCreated(self, ob):
+ def notifyCreated(ob):
'''
Notifies all applicable workflows after an object has been created
and put in its new place.
'''
# security.declarePrivate('notifyBefore')
- def notifyBefore(self, ob, action):
+ def notifyBefore(ob, action):
'''
Notifies all applicable workflows of an action before it happens,
allowing veto by exception. Unless an exception is thrown, either
@@ -154,45 +150,45 @@
'''
# security.declarePrivate('notifySuccess')
- def notifySuccess(self, ob, action, result=None):
+ def notifySuccess(ob, action, result=None):
'''
Notifies all applicable workflows that an action has taken place.
'''
# security.declarePrivate('notifyException')
- def notifyException(self, ob, action, exc):
+ def notifyException(ob, action, exc):
'''
Notifies all applicable workflows that an action failed.
'''
# security.declarePrivate('getHistoryOf')
- def getHistoryOf(self, wf_id, ob):
+ def getHistoryOf(wf_id, ob):
'''
Invoked by workflow definitions. Returns the history
of an object.
'''
# security.declarePrivate('getStatusOf')
- def getStatusOf(self, wf_id, ob):
+ def getStatusOf(wf_id, ob):
'''
Invoked by workflow definitions. Returns the last element of a
history.
'''
# security.declarePrivate('setStatusOf')
- def setStatusOf(self, wf_id, ob, status):
+ def setStatusOf(wf_id, ob, status):
'''
Invoked by workflow definitions. Appends to the workflow history.
'''
-class WorkflowDefinition (Base):
+class WorkflowDefinition(Base):
'''The interface expected of workflow definitions objects.
Accesses and changes the workflow state of objects.
'''
# security.declarePrivate('getCatalogVariablesFor')
- def getCatalogVariablesFor(self, ob):
+ def getCatalogVariablesFor(ob):
'''
Invoked by the portal_workflow tool.
Allows this workflow to make workflow-specific variables
@@ -203,7 +199,7 @@
'''
# security.declarePrivate('listObjectActions')
- def listObjectActions(self, info):
+ def listObjectActions(info):
'''
Invoked by the portal_workflow tool.
Allows this workflow to
@@ -214,7 +210,7 @@
'''
# security.declarePrivate('listGlobalActions')
- def listGlobalActions(self, info):
+ def listGlobalActions(info):
'''
Invoked by the portal_workflow tool.
Allows this workflow to
@@ -224,14 +220,14 @@
'''
# security.declarePrivate('isActionSupported')
- def isActionSupported(self, ob, action):
+ 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(self, ob, action, *args, **kw):
+ def doActionFor(ob, action, *args, **kw):
'''
Invoked by the portal_workflow tool.
Allows the user to request a workflow action. This method
@@ -239,14 +235,14 @@
'''
# security.declarePrivate('isInfoSupported')
- def isInfoSupported(self, ob, name):
+ 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(self, ob, name, default, *args, **kw):
+ def getInfoFor(ob, name, default, *args, **kw):
'''
Invoked by the portal_workflow tool.
Allows the user to request information provided by the
@@ -254,7 +250,7 @@
'''
# security.declarePrivate('notifyCreated')
- def notifyCreated(self, ob):
+ def notifyCreated(ob):
'''
Invoked by the portal_workflow tool.
Notifies this workflow after an object has been created
@@ -262,7 +258,7 @@
'''
# security.declarePrivate('notifyBefore')
- def notifyBefore(self, ob, action):
+ def notifyBefore(ob, action):
'''
Invoked by the portal_workflow tool.
Notifies this workflow of an action before it happens,
@@ -272,21 +268,21 @@
'''
# security.declarePrivate('notifySuccess')
- def notifySuccess(self, ob, action, result):
+ 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(self, ob, action, exc):
+ def notifyException(ob, action, exc):
'''
Invoked by the portal_workflow tool.
Notifies this workflow that an action failed.
'''
#security.declarePrivate('updateRoleMappingsFor')
- def updateRoleMappingsFor(self, ob):
+ def updateRoleMappingsFor(ob):
'''
Updates the object permissions according to the current
workflow state.