Documentos de Académico
Documentos de Profesional
Documentos de Cultura
@adapter(ISomeEvent)
class SomeUtility(object):
def react(some_event_object):
Subscriber implements(ISomeUtility)
""" subscriber description """
Global
...
def __init__(self, arg):
<subscriber handler=".events.react" self.arg = arg
Subscriber's zcml for=".interfaces.ISomeContentType
.interfaces.ISomeEvent"/> some1 = SomeUtility(1)
portal Plone Site, portal root getUtilityByInterfaceName(dotted_name, get tool/utility object by it's full dotted interface
portal_tabs list, top level tabs default=_marker) name
portal_title string, portal title make a Zope-friendly ID from text (remove spaces
cookString(text)
and lowercase)
portal_url string, portal url
_getAuthenticatedUser() shortcut to getSecurityManager().getUser()
site_properties site_properties sheet of PropertiesTool
shortcut to
visible_ids 1 if user can edit ids, None otherwise
_checkPermission(permission, obj) getSecurityManager().checkPermission(permission,
User obj)
checkPermission method of MembershipTool
get all permissions not defined in ourself that are
_ac_inherited_permissions(ob, all=0)
isAnon bool, is user anonymous? inherited
member authenticated member _modifyPermissionMappings(ob, map) modifies multiple role to permission mappings
membersfolder members folder object ... and others
Tools Products.CMFDefault.utils
acl_users PAS, acl_users convert the key-value pairs in headers to valid
formatRFC822Headers(headers)
atool ActionsTool, portal_actions RFC822-style headers
ztu module ZTUtils (Batch, TreeMaker, LazyFilter etc) parent(obj) shortcut to aq_parent(aq_inner(obj))
Iterator IndexIterator, deprecated createBreadCrumbs(context, request) return bredcrumbs
tabindex IndexIterator, start at 30000, deprecated createNavTree(context, request,
return navtree
sitemap=False)
Actions
actions dict, all actions createSiteMap(context, request,
return sitemap
sitemap=False)
folder_actions list, actions with category folder
isDefaultPage(obj, request) is obj default page?
global_actions list, actions with category global
getDefaultPage(obj, request) get obj default page
keyed_actions dict of dicts with keys of categories and action ids
pretty_title_or_id(context, obj) return the best possible title or id of an item
user_actions list, actions with category user
workflow_actions list, actions with category workflow getSiteEncoding(context) return site encoding
portal_utf8(context, str, errors='strict') encode str from portal encoding to utf-8...
method returning str, iteration number as lowercase copying, moving and removing objects
roman zope.lifecycleevent.interfaces.IObjectCopiedEvent
roman number (i, ii, iii, iv...)
zope.app.container.interfaces.IObjectMovedEvent
method returning bool, true if value passed as argument
first / last OFS.interfaces.IObjectClonedEvent
occures first / last time in this iteration OFS.interfaces.IObjectWillBeRemovedEvent
zope.app.container.interfaces.IObjectRemovedEvent
content replace tag content, eg. <div tal:content="structure here/title"> zope.app.container.interfaces.IContainerModifiedEvent
replace tag content and remove tag, eg. other events triggered many times by portal_factory during object creation
replace
<div tal:replace="structure here/title"> zope.lifecycleevent.interfaces.IObjectCreatedEvent
set tag attribute, eg. OFS.interfaces.IObjectWillBeAddedEvent
attributes
<div tal:attributes="href here/absolute_url"> zope.app.container.interfaces.IObjectAddedEvent
zope.app.container.interfaces.IContainerModifiedEvent
remove tag but keep content, eg.
zope.lifecycleevent.interfaces.IObjectModifiedEvent
omit-tag <div tal:omit-tag="optional_condition">; if optional condition
OFS.interfaces.IObjectWillBeMovedEvent
evaluates to false tag won't be removed
zope.app.container.interfaces.IObjectMovedEvent
hendle error caused by any other tag, eg.
Workflow
on-error <div tal:on-error="optional_expression">; if optional expression is
provided it will be evaluated in case of errors Products.CMFCore.interfaces.IActionWillBeInvokedEvent
Products.DCWorkflow.interfaces.IBeforeTransitionEvent
METAL (xmlns:metal="http://xml.zope.org/namespaces/metal")
Products.DCWorkflow.interfaces.IAfterTransitionEvent
mark part of template to be referencable later, eg. Products.CMFCore.interfaces.IActionRaisedExceptionEvent
define:macro
<div metal:define-macro="box">...</div> Products.CMFCore.interfaces.IActionSucceededEvent