com.arsdigita.cms
Class CategoryTemplateMapping

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

public class CategoryTemplateMapping
extends TemplateMapping

Represents a mapping from (category + content type) to a template.

Version:
$Id: //cms/dev/src/com/arsdigita/cms/CategoryTemplateMapping.java#8 $

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String CATEGORY
           
static String CONTENT_TYPE
           
static String SECTION
           
static String versionId
           
 
Fields inherited from class com.arsdigita.cms.TemplateMapping
IS_DEFAULT, TEMPLATE, USE_CONTEXT
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
CategoryTemplateMapping()
          Default constructor.
CategoryTemplateMapping(BigDecimal id)
          Constructor in which the contained DataObject is retrieved from the persistent storage mechanism using the specified BigDecimal ID and ObjectType of "CategoryTemplateMapping".
CategoryTemplateMapping(com.arsdigita.persistence.DataObject obj)
          Constructor in which a CategoryTemplateMapping is created using passed-in DataObject.
CategoryTemplateMapping(com.arsdigita.persistence.OID oid)
          Constructor in which the contained DataObject is retrieved from the persistent storage mechanism using the specified OID.
CategoryTemplateMapping(String type)
          Constructor in which the contained DataObject is initialized with a new DataObject with an ObjectType specified by the string type.
 
Method Summary
 com.arsdigita.categorization.Category getCategory()
          Returns the Category for this CategoryTemplateMapping
 ContentSection getContentSection()
          Returns the ContentSection for this CategoryTemplateMapping
 ContentType getContentType()
          Returns the ContentType for this CategoryTemplateMapping
static Template getDefaultTemplate(com.arsdigita.categorization.Category category, ContentType type, String useContext)
          Get the default template for the given use context
static CategoryTemplateMapping getMapping(com.arsdigita.categorization.Category category, ContentType type, Template template, String useContext)
          Load the specified mapping; return null if no such mapping exists
 com.arsdigita.kernel.ACSObject getParent()
          Return the parent of the template within the category.
static CategoryTemplateCollection getTemplates(com.arsdigita.categorization.Category category)
          Retrieve all templates for the given category, and all types within it, along with their use context
static CategoryTemplateCollection getTemplates(com.arsdigita.categorization.Category category, ContentType type)
          Retrieve all templates for the given category and type, along with their use context
static CategoryTemplateCollection getTemplates(com.arsdigita.categorization.Category category, ContentType type, String useContext)
          Retrieve all templates for the given category, type, and use context
 Boolean isDefault()
          Determine if the template will be the default within its context
 void setCategory(com.arsdigita.categorization.Category cat)
          Sets the Category for this CategoryTemplateMapping
 void setContentSection(ContentSection sec)
          Sets the ContentSection for this CategoryTemplateMapping
 void setContentType(ContentType t)
          Sets the ContentType for this CategoryTemplateMapping
 void setDefault(Boolean b)
          Set whether the template will be the default within its context
 
Methods inherited from class com.arsdigita.cms.TemplateMapping
getTemplate, getUseContext, setTemplate, setUseContext
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getBaseDataObjectType, 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

CATEGORY

public static final String CATEGORY
See Also:
Constant Field Values

SECTION

public static final String SECTION
See Also:
Constant Field Values

CONTENT_TYPE

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

CategoryTemplateMapping

public CategoryTemplateMapping()
Default constructor. The contained DataObject is initialized with a new DataObject with an ObjectType of "CategoryTemplateMapping".

See Also:
CategoryTemplateMapping(String), ObjectType

CategoryTemplateMapping

public CategoryTemplateMapping(com.arsdigita.persistence.OID oid)
                        throws com.arsdigita.domain.DataObjectNotFoundException
Constructor in which the contained DataObject is retrieved from the persistent storage mechanism using the specified OID.

Parameters:
oid - the OID for the retrieved DataObject
See Also:
ObservableDomainObject.ObservableDomainObject(OID), DataObject, OID

CategoryTemplateMapping

public CategoryTemplateMapping(BigDecimal id)
                        throws com.arsdigita.domain.DataObjectNotFoundException
Constructor in which the contained DataObject is retrieved from the persistent storage mechanism using the specified BigDecimal ID and ObjectType of "CategoryTemplateMapping".

Parameters:
id - the ID for the retrieved DataObject
See Also:
DataObject, OID

CategoryTemplateMapping

public CategoryTemplateMapping(com.arsdigita.persistence.DataObject obj)
Constructor in which a CategoryTemplateMapping is created using passed-in DataObject.

Parameters:
obj - the DataObject to initialize this CategoryTemplateMapping
See Also:
ObservableDomainObject.ObservableDomainObject(DataObject), DataObject, OID

CategoryTemplateMapping

public CategoryTemplateMapping(String type)
Constructor in which the contained DataObject is initialized with a new DataObject with an ObjectType specified by the string type.

Parameters:
type - the name of the ObjectType of the contained DataObject
See Also:
ObservableDomainObject.ObservableDomainObject(String), DataObject, ObjectType
Method Detail

getContentSection

public final ContentSection getContentSection()
Returns the ContentSection for this CategoryTemplateMapping

Specified by:
getContentSection in class TemplateMapping
Returns:
The ContentSection for which this mapping is valid.

setContentSection

public final void setContentSection(ContentSection sec)
Sets the ContentSection for this CategoryTemplateMapping

Parameters:
sec - The ContentSection for which this mapping should be valid.

getCategory

public com.arsdigita.categorization.Category getCategory()
Returns the Category for this CategoryTemplateMapping

Returns:
The Category for which this mapping is valid.

setCategory

public void setCategory(com.arsdigita.categorization.Category cat)
Sets the Category for this CategoryTemplateMapping

Parameters:
cat - The Category for which this mapping should be valid.

getParent

public com.arsdigita.kernel.ACSObject getParent()
Return the parent of the template within the category. Currently this returns the ContentType

Specified by:
getParent in class TemplateMapping
Returns:
the parent of this TemplateMapping

getContentType

public ContentType getContentType()
Returns the ContentType for this CategoryTemplateMapping

Returns:
The ContentType for which this mapping is valid.

setContentType

public void setContentType(ContentType t)
Sets the ContentType for this CategoryTemplateMapping

Parameters:
t - The ContentType for which this mapping should be valid.

isDefault

public Boolean isDefault()
Determine if the template will be the default within its context

Specified by:
isDefault in class TemplateMapping
Returns:
whether the template is the default within its context.

setDefault

public void setDefault(Boolean b)
Set whether the template will be the default within its context

Specified by:
setDefault in class TemplateMapping
Parameters:
b - whether the template is the default within its context.

getMapping

public static CategoryTemplateMapping getMapping(com.arsdigita.categorization.Category category,
                                                 ContentType type,
                                                 Template template,
                                                 String useContext)
Load the specified mapping; return null if no such mapping exists

Parameters:
category - The Category for the return mapping
type - The ContentType for the return mapping
template - The Template for the return mapping
useContext - The use context for the return mapping
Returns:
the CategoryTemplateMapping matching the specified inputs, null if none exist

getDefaultTemplate

public static Template getDefaultTemplate(com.arsdigita.categorization.Category category,
                                          ContentType type,
                                          String useContext)
Get the default template for the given use context

Parameters:
category - The Category for the return mapping
type - The ContentType for the return mapping
useContext - The use context for the return mapping
Returns:
the Template matching the specified inputs, null if none exist

getTemplates

public static CategoryTemplateCollection getTemplates(com.arsdigita.categorization.Category category,
                                                      ContentType type,
                                                      String useContext)
Retrieve all templates for the given category, type, and use context

Parameters:
category - The Category for the return mapping
type - The ContentType for the return mapping
useContext - The use context for the return mapping
Returns:
the CategoryTemplateCollection matching the specified inputs

getTemplates

public static CategoryTemplateCollection getTemplates(com.arsdigita.categorization.Category category,
                                                      ContentType type)
Retrieve all templates for the given category and type, along with their use context

Parameters:
category - The Category for the return mapping
type - The ContentType for the return mapping
Returns:
the CategoryTemplateCollection matching the specified inputs

getTemplates

public static CategoryTemplateCollection getTemplates(com.arsdigita.categorization.Category category)
Retrieve all templates for the given category, and all types within it, along with their use context

Parameters:
category - The Category for the return mapping
Returns:
the CategoryTemplateCollection matching the specified inputs


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