############################################################################## # # Copyright (c) 2005 CMFonFive Contributors. All rights reserved. # # This software is distributed under the terms of the Zope Public # License (ZPL) v2.1. See COPYING.txt for more information. # ########################################################################### """ Zope3 interface shims for CMF. $Id$ """ from zope.interface import Interface #------------------------------------------------------------------------------ # CMFCore.PortalFolder.PortalFolder # # N.B: there is no specific interfaces for the content type! #------------------------------------------------------------------------------ class IPortalFolder(Interface): """ CMF-aware folders. """ def allowedContentTypes(): """ List names of content types addable to this folder. """ def contentIds(spec=None, filter=None): """ List IDs of content objects in this folder. """ def contentValues(spec=None, filter=None): """ List content objects in the folder. """ def listFolderContents(spec=None, contentFilter=None): """ List IDs of content objects in this folder. """ def contentItems(spec=None, filter=None): """ List (id, value) tuples for content objects in this folder. """ #------------------------------------------------------------------------------ # CMFDefault.Document # # N.B: there is no specific interfaces for the content type! #------------------------------------------------------------------------------ class IDocument(Interface): """ Textual content, in one of several formats. o Allowed formats include: structured text, HTML, plain text. """ def CookedBody(): """ Return the "cooked" (ready for presentation) form of the text. """ def EditableBody(): """ Return the "raw" (as edited) form of the text. """ class IMutableDocument(IDocument): """ Updatable form of IDocument. """ def edit(text_format, text, file='', safety_belt=''): """ Update the document. o 'safety_belt', if passed, must match the value issued when the edit began. """ from zope.app.publisher.interfaces.browser import IBrowserMenu from zope.schema import TextLine class IActionMenu(IBrowserMenu): category = TextLine( title=u"Category", description=u"The action category of this action menu", required=True)