Content API Reference

Core Content

This interface defines the contract for any content object within the CMF.

interface Products.CMFCore.interfaces.IDynamicType

General interface for dynamic items.

getPortalTypeName()

Return the name of the type information for this object.

o If the object is uninitialized, return None.

o Permission: Public

getTypeInfo()

Return the ITypeInformation object for this object.

o A shortcut to ‘getTypeInfo’ of portal_types.

o Permission: Public

getActionInfo(action_chain, check_visibility=0, check_condition=0)

Get an Action info mapping specified by a chain of actions.

o A shortcut to ‘getActionInfo’ of the related ITypeInformation
object.

o Permission: Public

getIconURL()

Get the absolute URL of the icon for the object.

o This method is used in the ‘folder_contents’ view to generate an
appropriate icon for the items found in the folder.
o If the content item does not define an attribute named “icon”
return a “default” icon path (e.g., /misc_/dtmldoc.gif, which is the icon used for DTML Documents).

o Permission: Public

Searchable Content

These interfaces define the contract for content objects which can be searched using the Catalog Tool.

interface Products.CMFCore.interfaces.IContentish

General interface for “contentish” items.

o These methods need to be implemented by any class that wants to be a
first-class citizen in the CMF world.

o CMFCore.PortalContent implements this interface.

SearchableText()

Return a string containing textual information about the content.

o This string may be the content of a file, or may be synthesized
by concatenating the string attributes of the instance.

o Permissions: View

interface Products.CMFCore.interfaces.ICatalogAware

Interface for notifying the catalog tool.

indexObject()

Index the object in the portal catalog.

unindexObject()

Unindex the object from the portal catalog.

reindexObject(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.

reindexObjectSecurity(skip_self=False)

Reindex security-related indexes on the object.

Recurses in the children to reindex them too.

If skip_self is True, only the children will be reindexed. This is a useful optimization if the object itself has just been fully reindexed, as there’s no need to reindex its security twice.

Dublin Core Metadata

These interfaces define the contracts for content objects which provide standard Dublin Core metadata. See also Metadata Tool.

interface Products.CMFCore.interfaces.IMinimalDublinCore

Minimal set of Dublin Core metadata elements.

Title()

Return a single string, the DCMI Title element (resource name).

o Permission: View

Description()

Return the DCMI Description element (resource summary).

o Result is a natural language description of this object.

o Permission: View

Type()

Return the DCMI Type element (resource type).

o Result a human-readable type name for the resource (typically
the Title of its type info object).

o Permission: View

interface Products.CMFCore.interfaces.IDublinCore

Extends: Products.CMFCore.interfaces.IMinimalDublinCore

Dublin Core metadata elements supported by CMF and their semantics.

listCreators()

Return a sequence of DCMI Creator elements (resource authors).

o Depending on the implementation, this returns the full name(s) of the
author(s) of the content object or their ids.

o Permission: View

Creator()

Return the first DCMI Creator element, or an empty string.

o Permission: View

Subject()

Return a sequence of DCMI Subject elements (resource keywords).

o Result is zero or more keywords associated with the content object.

o Permission: View

Publisher()

Return the DCMI Publisher element (resource publisher).

o Result is the full formal name of the entity or person responsible
for publishing the resource.

o Permission: View

listContributors()
Return a sequence of DCMI Contributor elements (resource
collaborators).
o Return zero or more collaborators (beyond thos returned by
‘listCreators’).

o Permission: View

Contributors()

Deprecated alias for ‘listContributors’.

o ‘initial caps’ names are reserved for strings.

Date(zone=None)

Return the DCMI Date element (default resource date).

o Result is a string, formatted ‘YYYY-MM-DD H24:MN:SS TZ’.

o If ‘zone’ is ‘None’, return the time in the system default
timezone.

o Permission: View

CreationDate(zone=None)

Return the DCMI Date element (date resource created).

o Result is a string, formatted ‘YYYY-MM-DD H24:MN:SS TZ’.

o If ‘zone’ is ‘None’, return the time in the system default
timezone.

o Permission: View

EffectiveDate(zone=None)

Return the DCMI Date element (date resource becomes effective).

o Result is a string, formatted ‘YYYY-MM-DD H24:MN:SS TZ’, or
None.
o If ‘zone’ is ‘None’, return the time in the system default
timezone.

o Permission: View

ExpirationDate(zone=None)

Return the DCMI Date element (date resource expires).

o Result is a string, formatted ‘YYYY-MM-DD H24:MN:SS TZ’, or
None.
o If ‘zone’ is ‘None’, return the time in the system default
timezone.

o Permission: View

ModificationDate(zone=None)

DCMI Date element - date resource last modified.

o Result is a string, formatted ‘YYYY-MM-DD H24:MN:SS TZ’.

o If ‘zone’ is ‘None’, return the time in the system default
timezone.

o Permission: View

Format()

Return the DCMI Format element (resource format).

o Result is the resource’s MIME type (e.g. ‘text/html’,
‘image/png’, etc.).

o Permission: View

Identifier()

Return the DCMI Identifier element (resource ID).

o Result is a unique ID (a URL) for the resource.

o Permission: View

Language()

DCMI Language element (resource language).

o Result it the RFC language code (e.g. ‘en-US’, ‘pt-BR’) for the
resource.

o Permission: View

Rights()

Return the DCMI Rights element (resource copyright).

o Return a string describing the intellectual property status, if
any, of the resource.

o Permission: View

interface Products.CMFCore.interfaces.ICatalogableDublinCore

Provide Zope-internal date attributes for cataloging purposes.

created()

Return the DateTime form of CreationDate.

o Permission: View

effective()

Return the DateTime form of EffectiveDate.

o Permission: View

expires()

Return the DateTime form of ExpirationDate.

o Permission: View

modified()

Return the DateTime form of ModificationDate

o Permission: View

interface Products.CMFCore.interfaces.IMutableMinimalDublinCore

Extends: Products.CMFCore.interfaces.IMinimalDublinCore

Update interface for minimal set of mutable metadata.

setTitle(title)

Set DCMI Title element - resource name.

o Permission: Modify portal content

setDescription(description)

Set DCMI Description element - resource summary.

o Permission: Modify portal content

interface Products.CMFCore.interfaces.IMutableDublinCore

Extends: Products.CMFCore.interfaces.IMutableMinimalDublinCore, Products.CMFCore.interfaces.IDublinCore

Update interface for mutable metadata.

setCreators(creators)

Set DCMI Creator elements - resource authors.

o Permission: Modify portal content

setSubject(subject)

Set DCMI Subject element - resource keywords.

o Permission: Modify portal content

setContributors(contributors)

Set DCMI Contributor elements - resource collaborators.

o Permission: Modify portal content

setEffectiveDate(effective_date)

Set DCMI Date element - date resource becomes effective.

o Permission: Modify portal content

setExpirationDate(expiration_date)

Set DCMI Date element - date resource expires.

o Permission: Modify portal content

setFormat(format)

Set DCMI Format element - resource format.

o Permission: Modify portal content

setLanguage(language)

Set DCMI Language element - resource language.

o Permission: Modify portal content

setRights(rights)

Set DCMI Rights element - resource copyright.

o Permission: Modify portal content

Discussable Content

These interfaces define the contracts / framework for content object whose discussion can be managed by the Discussion Tool.

interface Products.CMFCore.interfaces.IDiscussionResponse

Interface for objects which are replies to IDiscussable objects.

inReplyTo(REQUEST=None)

Return the IDiscussable object to which this item is a reply.

o Permission: None assigned

setReplyTo(reply_to)

Make this object a response to the passed object.

o ‘reply_to’ is an IDiscussable, or a path (as a string) to one.

o Raise ValueError if ‘reply_to’ is not an IDiscussable (or doesn’t
resolve to one as a path).

o XXX This does not seem like the right exception.

o Permission: None assigned

parentsInThread(size=0)
Return a sequence of IDiscussables which are this object’s parents,
from the point of view of the threaded discussion.

o Parents are ordered oldest to newest.

o If ‘size’ is not zero, only the closest ‘size’ parents will be
returned.
interface Products.CMFCore.interfaces.IOldstyleDiscussable

Oldstyle discussable interface.

createReply(title, text, REQUEST, RESPONSE)

Create a reply in the proper place.

o Returns: HTML (directly or via redirect) # XXX

o Permission: Reply to item

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.

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

getReplies()

Return a sequence of the DiscussionResponse objects which are associated with this Discussable

Permissions: View Returns: sequence of DiscussionResponses

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.

interface Products.CMFCore.interfaces.IDiscussable

Interface for things which can have responses.

createReply(title, text, Creator=None)

Create a reply in the proper place.

o Returns: HTML (directly or via redirect) # XXX

o Permission: Reply to item

getReplies()
Return a sequence of IDiscussionResponse objects which are
replies to this IDiscussable

o Permission: View

quotedContents()
Return this object’s contents in a form suitable for inclusion
as a quote in a response.
o The default implementation returns an empty string. It might be
overridden to return a ‘>’ quoted version of the item.

o Permission: Reply to item

_getReplyResults()

Return the ZCatalog results that represent this object’s replies.

o XXX: Huh?

o Often, the actual objects are not needed. This is less expensive
than fetching the objects.

o Permission: View

Content Workflow

This interface defines the contract for content objects which can participate in the workflow framework provided by the Workflow Tool.

interface Products.CMFCore.interfaces.IWorkflowAware

Interface for notifying the workflow tool.

notifyWorkflowCreated()

Notify the workflow that the object was just created.

Content Containers

This interface defines the contract for content objects which can contain other content as “normal” sub-items.

interface Products.CMFCore.interfaces.IFolderish

General interface for “folderish” content items.

contentItems(filter=None)
Return a sequence of (object ID, object) tuples for
IContentish and IFolderish sub-objects.
o Provide a filtered view onto ‘objectItems’, allowing only
“content space” objects to show through.

o Permission: Public (not publishable)

contentIds(filter=None)

Return a sequence of IDs of IContentish and IFolderish sub-objects.

o Provide a filtered view onto ‘objectIds’, allowing only
“content space” objects to show through.

o Permission: Public (not publishable)

Returns – List of object IDs

contentValues(filter=None)

Return a sequence of IContentish and IFolderish sub-objects.

o Provide a filtered view onto ‘objectValues’, allowing only
“content space” objects to show through.

o Permission: Public (not publishable)

Returns – List of objects

listFolderContents(contentFilter=None)
Return a sequence of IContentish and IFolderish sub-objects,
filtered by the current user’s possession of the View permission.

o Hook around ‘contentValues’ to let ‘folder_contents’ be protected.

o Duplicates ‘skip_unauthorized’ behavior of ‘dtml-in’.

o Permission – List folder contents

Opaque Items

These interfaces define the framework for content objects which can contain other content as “opaque” sub-items.

interface Products.CMFCore.interfaces.ICallableOpaqueItem

Interface for callable opaque items.

o Opaque items are subelements that are contained using something that
is not an ObjectManager.
o 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.
__init__(obj, id)

Return the opaque item and assign it to ‘obj’ as attr with ‘id’.

__call__()

Return the opaque items value.

getId()

Return the id of the opaque item.

interface Products.CMFCore.interfaces.ICallableOpaqueItemEvents

CMF specific events upon copying, renaming and deletion.

manage_afterClone(item)

After clone event hook.

manage_beforeDelete(item, container)

Before delete event hook.

manage_afterAdd(item, container)

After add event hook.

interface Products.CMFCore.interfaces.IOpaqueItemManager

Interface for managing opaque items.

Content Syndication

This interface defines the contract for content objects which can participate in the syndication framework provided by the Syndication Tool.

interface Products.CMFCore.interfaces.ISyndicatable

Filter content for syndication.

synContentValues()

Return a list of IDublinCore objects to be syndicated.

o For example, ‘IFolderish’ containers might returns a list of
recently-created or modified subobjects.

o Topics might return a sequence of objects from a catalog query.