com.arsdigita.cms
Class ContentType

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.cms.ContentType

public class ContentType
extends com.arsdigita.kernel.ACSObject

A Content Type defines the characteristics of a content item. Content management resources are registered to a content type, including the Authoring Kit, and templates.

Each content type is associated with a domain object and a data object type.

Version:
$Revision: #16 $ $Date: 2004/04/07 $
Author:
Michael Pih (pihman@arsdigita.com), Jack Chung (flattop@arsdigita.com)

Field Summary
static String AUTHORING_KIT
           
static String BASE_DATA_OBJECT_TYPE
           
static String CLASSNAME
           
static String DESCRIPTION
           
static String IS_INTERNAL
           
static String ITEM_FORM
           
static String ITEM_FORM_ID
           
static String LABEL
           
static String OBJECT_TYPE
           
static String versionId
           
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID
 
Constructor Summary
  ContentType()
          Default constructor.
  ContentType(BigDecimal id)
          Constructor.
  ContentType(com.arsdigita.persistence.DataObject obj)
           
  ContentType(com.arsdigita.persistence.OID oid)
          Constructor.
protected ContentType(String type)
           
 
Method Summary
protected  void beforeSave()
           
 AuthoringKit createAuthoringKit()
          Create an authoring kit to this content type.
 AuthoringKit createAuthoringKit(String createComponent)
          Create an authoring kit to this content type.
static ContentType findByAssociatedObjectType(String objType)
          Find the content type with the associated with the object type.
static ContentTypeCollection getAllContentTypes()
          Fetches a collection of all content types, including internal content types.
 String getAssociatedObjectType()
          Returns the object type of the items of this content type.
 AuthoringKit getAuthoringKit()
          Fetch the authoring kit for this content type.
 String getBaseDataObjectType()
           
 String getClassName()
          Fetch the class name of the Java domain object implementation.
 String getDescription()
          Fetches the description for the content type.
 com.arsdigita.formbuilder.PersistentForm getItemForm()
          Retrieve the persistent form of this content type
 BigDecimal getItemFormID()
          Fetch the item creation form id of the Java domain object implementation.
 String getLabel()
          Fetches the label for the content type.
static ContentTypeCollection getRegisteredContentTypes()
          Fetches a collection of content types that have been registered to at least one content section, excluding internal content types.
static ContentTypeCollection getUserDefinedContentTypes()
          Fetches a collection of all user-defined (non-internal) content types.
static Iterator getXSLFileURLs()
          Gets an iterator of java.net.URL objects for all registered XSL files
 Boolean isInternal()
          An internal content type is one that is not user-defined and maintained internally.
static void registerXSLFile(ContentType type, String path)
          NB this interface is liable to change.
 void setAssociatedObjectType(String objType)
          Set the data object type representation of this content type.
 void setClassName(String className)
          Set the name of the Java class implementation of this content type.
 void setDescription(String description)
          Sets the description for this content type.
 void setInternal(boolean isInternal)
          Make this content type internal or not.
 void setItemFormID(BigDecimal itemFormID)
          Sets the item creation form id of the Java domain object implementation.
 void setLabel(String label)
          Sets the label for this content type.
static void unregisterXSLFile(ContentType type, String path)
          NB this interface is liable to change.
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

OBJECT_TYPE

public static final String OBJECT_TYPE
See Also:
Constant Field Values

LABEL

public static final String LABEL
See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
See Also:
Constant Field Values

CLASSNAME

public static final String CLASSNAME
See Also:
Constant Field Values

IS_INTERNAL

public static final String IS_INTERNAL
See Also:
Constant Field Values

AUTHORING_KIT

public static final String AUTHORING_KIT
See Also:
Constant Field Values

ITEM_FORM_ID

public static final String ITEM_FORM_ID
See Also:
Constant Field Values

ITEM_FORM

public static final String ITEM_FORM
See Also:
Constant Field Values
Constructor Detail

ContentType

public ContentType()
Default constructor. This creates a new folder.


ContentType

public ContentType(com.arsdigita.persistence.OID oid)
            throws com.arsdigita.domain.DataObjectNotFoundException
Constructor. The contained DataObject is retrieved from the persistent storage mechanism with an OID specified by oid.

Parameters:
oid - The OID for the retrieved DataObject.

ContentType

public ContentType(BigDecimal id)
            throws com.arsdigita.domain.DataObjectNotFoundException
Constructor. The contained DataObject is retrieved from the persistent storage mechanism with an OID specified by id and ContentType.BASE_DATA_OBJECT_TYPE.

Parameters:
id - The id for the retrieved DataObject.

ContentType

protected ContentType(String type)

ContentType

public ContentType(com.arsdigita.persistence.DataObject obj)
Method Detail

getBaseDataObjectType

public String getBaseDataObjectType()
Returns:
the base PDL object type for this item. Child classes should override this method to return the correct value

beforeSave

protected void beforeSave()

getAssociatedObjectType

public String getAssociatedObjectType()
Returns the object type of the items of this content type. (For example: If I create a ContentType "foo". Then a I create an item "bar" of type foo. This associated object type is the same as bar.getObjectType())

Returns:
The data object type representation of this content type

setAssociatedObjectType

public void setAssociatedObjectType(String objType)
Set the data object type representation of this content type.

Parameters:
objType - The qualified name of the data object type

getLabel

public String getLabel()
Fetches the label for the content type.

Returns:
The label

setLabel

public void setLabel(String label)
Sets the label for this content type.

Parameters:
label - The label

getDescription

public String getDescription()
Fetches the description for the content type.

Returns:
The description

setDescription

public void setDescription(String description)
Sets the description for this content type.

Parameters:
description - The description

getClassName

public String getClassName()
Fetch the class name of the Java domain object implementation.

Returns:
The class name of the Java domain object

setClassName

public void setClassName(String className)
Set the name of the Java class implementation of this content type.

Parameters:
className - The name of the Java domain object

isInternal

public Boolean isInternal()

An internal content type is one that is not user-defined and maintained internally. A content type should be made internal under the following two conditions:

  1. The object type needs to take advantage of content type services (i.e., versioning, categorization, lifecycle, workflow) that are already implemented in CMS.
  2. The content type cannot be explicitly registered to a content section.

The Template content type is one such internal content type.

Returns:
Boolean.TRUE if this content type is internal, Boolean.FALSE otherwise.

setInternal

public void setInternal(boolean isInternal)
Make this content type internal or not.

Parameters:
isInternal - true if this content type should be internal, false otherwise

getAuthoringKit

public AuthoringKit getAuthoringKit()
Fetch the authoring kit for this content type.

Returns:
The authoring kit

createAuthoringKit

public AuthoringKit createAuthoringKit()
Create an authoring kit to this content type. To save this authoring kit, you need to call save() method on the returned AuthoringKit.


createAuthoringKit

public AuthoringKit createAuthoringKit(String createComponent)
Create an authoring kit to this content type. To save this authoring kit, you need to call save() method on the returned AuthoringKit.

Parameters:
createComponent - the create component class associated with the authoring kit

getItemFormID

public BigDecimal getItemFormID()
Fetch the item creation form id of the Java domain object implementation. applies to user-defined types

Returns:
The id of the persistent form used to create an item of this content type

setItemFormID

public void setItemFormID(BigDecimal itemFormID)
Sets the item creation form id of the Java domain object implementation. applies to user-defined types

Parameters:
itemFormID - The id of the persistent form used to create an item of this content type

getItemForm

public com.arsdigita.formbuilder.PersistentForm getItemForm()
                                                     throws com.arsdigita.domain.DataObjectNotFoundException
Retrieve the persistent form of this content type

Returns:
the persistent form used to create or edit content items of this type (only applies to user-defined types)
Throws:
com.arsdigita.domain.DataObjectNotFoundException

findByAssociatedObjectType

public static ContentType findByAssociatedObjectType(String objType)
                                              throws com.arsdigita.domain.DataObjectNotFoundException
Find the content type with the associated with the object type.

Parameters:
objType - The fully-qualified name of the data object type
Returns:
The content type associated with the object type
Throws:
com.arsdigita.domain.DataObjectNotFoundException

getAllContentTypes

public static ContentTypeCollection getAllContentTypes()
Fetches a collection of all content types, including internal content types.

Returns:
A collection of all content types

getUserDefinedContentTypes

public static ContentTypeCollection getUserDefinedContentTypes()
Fetches a collection of all user-defined (non-internal) content types.

Returns:
A collection of user-defined content types

getRegisteredContentTypes

public static ContentTypeCollection getRegisteredContentTypes()
Fetches a collection of content types that have been registered to at least one content section, excluding internal content types.

Returns:
A collection of registered content types

registerXSLFile

public static void registerXSLFile(ContentType type,
                                   String path)
NB this interface is liable to change. Registers an XSL file against a content type.

Parameters:
type - the content type
path - the path relative to the server root

unregisterXSLFile

public static void unregisterXSLFile(ContentType type,
                                     String path)
NB this interface is liable to change. Unregisters an XSL file against a content type.

Parameters:
type - the content type
path - the path relative to the server root

getXSLFileURLs

public static Iterator getXSLFileURLs()
Gets an iterator of java.net.URL objects for all registered XSL files



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 19 2004:2352 UTC