API Documentation

Classes

ContentTypeInformation , portal_types

Type registration tool interface.

$Id: portal_types.py,v 1.13.14.2 2004/04/23 21:11:34 sidnei Exp $


class ContentTypeInformation

Registry entry interface.


Methods

getActionById(id):

Return the URL of the action whose ID is id.

isConstructionAllowed(container):

Does the current user have the permission required in order to construct an instance?

Description():

Textual description of the class of objects (intended for display in a "constructor list").

Title():

Return the "human readable" type name (note that it may not map exactly to the meta_type, e.g., for l10n/i18n or where a single content class is being used twice, under different names.

getIcon():

Returns the portal-relative icon for this type.

Metatype():

Return the Zope meta_type for this content object.

allowType(contentType):

Can objects of contentType be added to containers whose type object we are?

constructInstance(container, id):

Build a "bare" instance of the appropriate type in container, using id as its id. Return the instance, seated in the container.

allowDiscussion():

Can this type of object support discussion?


class portal_types

Provides a configurable registry of portal content types.


id = Must be set to "portal_types"

Methods

constructContent(contentType, container, id, RESPONSE=None, *args, **kw):

Build an instance of the appropriate content class in container, using id. If RESPONSE is provided, redirect to the new object's "initial view".

getTypeInfo(contentType):

Return an instance which implements the ContentTypeInformation interface, corresponding to the specified contentType. If contentType is actually an object, rather than a string, attempt to look up the appropriate type info using its portal_type.

listContentTypes(container=None, by_metatype=0):

Return list of content types, or the equivalent metatypes; if container is passed, then filter the list to include only types which are addable in container.

listTypeInfo(container=None):

Return a sequence of instances which implement the ContentTypeInformation interface, one for each content type regisetered in the portal. If the container is specified, the list will be filtered according to the user's permissions.