com.arsdigita.cms
Class SectionTemplateMapping

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.SectionTemplateMapping

public class SectionTemplateMapping
extends TemplateMapping

Represents a mapping from (content section + content type) to a template. This class is is package scope since it is part of the internal templating implementation.

Version:
$Id: //cms/dev/src/com/arsdigita/cms/SectionTemplateMapping.java#12 $
Author:
Stanislav Freidin (sfreidin@arsdigita.com)

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
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
SectionTemplateMapping()
           
SectionTemplateMapping(BigDecimal id)
           
SectionTemplateMapping(com.arsdigita.persistence.DataObject obj)
           
SectionTemplateMapping(com.arsdigita.persistence.OID oid)
           
SectionTemplateMapping(String type)
           
 
Method Summary
 ContentSection getContentSection()
          Return the context section where the template is associated.
 ContentType getContentType()
           
protected static Template getDefaultTemplate(ContentSection section, ContentType type, String useContext)
          Deprecated. use getDefaultTemplates with the MimeType or use the collection since there can be one default per mime type per context
protected static Template getDefaultTemplate(ContentSection section, ContentType type, String useContext, com.arsdigita.mimetypes.MimeType mimeType)
          Get the default template for the given use context and mime type
protected static com.arsdigita.cms.SectionTemplateCollection getDefaultTemplates(ContentSection section, ContentType type, String useContext)
          Get the default template for the given use context
protected static SectionTemplateMapping getMapping(ContentSection section, ContentType type, Template template, String useContext)
          Deprecated. use getMapping(ContentSection section, ContentType type, Template template, String useContext, MimeType mimeType)
protected static SectionTemplateMapping getMapping(ContentSection section, ContentType type, Template template, String useContext, com.arsdigita.mimetypes.MimeType mimeType)
          Load the specified mapping; return null if no such mapping exists
 com.arsdigita.kernel.ACSObject getParent()
          Return the parent of the template within the section.
protected static com.arsdigita.cms.SectionTemplateCollection getTemplates(ContentSection section)
          Retrieve all templates for the given content section, and all types within it, along with their use context
protected static com.arsdigita.cms.SectionTemplateCollection getTemplates(ContentSection section, ContentType type)
          Retrieve all templates for the given content section and type, along with their use context
protected static com.arsdigita.cms.SectionTemplateCollection getTemplates(ContentSection section, ContentType type, String useContext)
          Retrieve all templates for the given content, type, and use context
 Boolean isDefault()
          Determine if the template will be the default within its context
 void setContentSection(ContentSection sec)
           
 void setContentType(ContentType t)
           
 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

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

SectionTemplateMapping

public SectionTemplateMapping()

SectionTemplateMapping

public SectionTemplateMapping(com.arsdigita.persistence.OID oid)
                       throws com.arsdigita.domain.DataObjectNotFoundException

SectionTemplateMapping

public SectionTemplateMapping(BigDecimal id)
                       throws com.arsdigita.domain.DataObjectNotFoundException

SectionTemplateMapping

public SectionTemplateMapping(com.arsdigita.persistence.DataObject obj)

SectionTemplateMapping

public SectionTemplateMapping(String type)
Method Detail

getContentSection

public final ContentSection getContentSection()
Description copied from class: TemplateMapping
Return the context section where the template is associated. Child classes should override this method to do the right thing.

Specified by:
getContentSection in class TemplateMapping

setContentSection

public final void setContentSection(ContentSection sec)

getParent

public com.arsdigita.kernel.ACSObject getParent()
Description copied from class: TemplateMapping
Return the parent of the template within the section. This will most likely be a content type or a content item.

Specified by:
getParent in class TemplateMapping

getContentType

public final ContentType getContentType()

setContentType

public final void setContentType(ContentType t)

isDefault

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

Specified by:
isDefault in class TemplateMapping

setDefault

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

Specified by:
setDefault in class TemplateMapping

getMapping

protected static SectionTemplateMapping getMapping(ContentSection section,
                                                   ContentType type,
                                                   Template template,
                                                   String useContext)
Deprecated. use getMapping(ContentSection section, ContentType type, Template template, String useContext, MimeType mimeType)

Load the specified mapping; return null if no such mapping exists


getMapping

protected static SectionTemplateMapping getMapping(ContentSection section,
                                                   ContentType type,
                                                   Template template,
                                                   String useContext,
                                                   com.arsdigita.mimetypes.MimeType mimeType)
Load the specified mapping; return null if no such mapping exists


getDefaultTemplate

protected static Template getDefaultTemplate(ContentSection section,
                                             ContentType type,
                                             String useContext,
                                             com.arsdigita.mimetypes.MimeType mimeType)
Get the default template for the given use context and mime type


getDefaultTemplate

protected static Template getDefaultTemplate(ContentSection section,
                                             ContentType type,
                                             String useContext)
Deprecated. use getDefaultTemplates with the MimeType or use the collection since there can be one default per mime type per context

Get the default template for the given use context


getDefaultTemplates

protected static com.arsdigita.cms.SectionTemplateCollection getDefaultTemplates(ContentSection section,
                                                                                 ContentType type,
                                                                                 String useContext)
Get the default template for the given use context


getTemplates

protected static com.arsdigita.cms.SectionTemplateCollection getTemplates(ContentSection section,
                                                                          ContentType type,
                                                                          String useContext)
Retrieve all templates for the given content, type, and use context


getTemplates

protected static com.arsdigita.cms.SectionTemplateCollection getTemplates(ContentSection section,
                                                                          ContentType type)
Retrieve all templates for the given content section and type, along with their use context


getTemplates

protected static com.arsdigita.cms.SectionTemplateCollection getTemplates(ContentSection section)
Retrieve all templates for the given content section, and all types within it, along with their use context



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