from zope.interface import Interface class IReadInterfaceTool(Interface): def objectImplements(obj, dotted_name): """ Asserts if an object implements a given interface """ def classImplements(obj, dotted_name): """ Asserts if an object's class implements a given interface """ def namesAndDescriptions(dotted_name, all=0): """ Returns a list of pairs (name, description) for a given interface""" def getDirectlyProvided(context): """See IIntrospector""" def getDirectlyProvidedNames(context): """See IIntrospector""" def getMarkerInterfaces(context): """See IIntrospector""" def getMarkerInterfaceNames(context): """See IIntrospector""" def getProvided(context): """Interfaces provided by context""" def getDirectlyProvidedNames(context): """Names of interfaces provided by context""" def getSkins(): """Registered skins""" class IWriteInterfaceTool(Interface): def update(context, add=None, remove=None): """Update directly provided interfaces for an instance.""" class IInterfaceTool(IReadInterfaceTool, IWriteInterfaceTool): """This tool exposes the Zope2 interface package for TTW applications, by accepting a dotted name of an interface and exporting the IInterface API. It also exposes part of the IIntrospector interface from Zope3. """ class ICMFCatalogAware(Interface): """Mix-in for notifying portal_catalog and portal_workflow """ def indexObject(self): """Index the object in the portal catalog. """ def unindexObject(self): """Unindex the object from the portal catalog. """ def reindexObject(self, idxs=[]): """Reindex the object in the portal catalog. If idxs is present, only those indexes are reindexed. The metadata is always updated. Also update the modification date of the object, unless specific indexes were requested. """ def reindexObjectSecurity(self): """Reindex security-related indexes on the object (and its descendants). """ def notifyWorkflowCreated(self): """Notify the workflow that self was just created. """ class IDynamicType(Interface): """ General interface for dynamic items. """ 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 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. """ def getTypeInfo(): """ Returns an object that supports the ContentTypeInformation interface. """ def getPortalTypeName(): """ Returns the portal type name that can be passed to portal_types. If the object is uninitialized, returns None. """ def _setPortalTypeName(pt): """ Called by portal_types during construction, records an ID that will be used later to locate the correct ContentTypeInformation. """