com.arsdigita.cms
Class ItemTemplateMapping

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

public class ItemTemplateMapping
extends TemplateMapping

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

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

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String ITEM
           
static String TEMPLATE
           
static String USE_CONTEXT
           
static String versionId
           
 
Fields inherited from class com.arsdigita.cms.TemplateMapping
IS_DEFAULT
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
ItemTemplateMapping()
           
ItemTemplateMapping(BigDecimal id)
           
ItemTemplateMapping(com.arsdigita.persistence.DataObject obj)
           
ItemTemplateMapping(com.arsdigita.persistence.OID oid)
           
ItemTemplateMapping(String type)
           
 
Method Summary
 ContentItem getContentItem()
           
 ContentSection getContentSection()
          Return the context section where the template is associated.
protected static com.arsdigita.cms.ItemTemplateCollection getContextsWithTypes(ContentItem item)
          Retrieve all use context/mime type combinations along with possibly null template for the item in that pair.
protected static com.arsdigita.cms.ItemTemplateCollection getItems(Template template)
          Retrieve all content items for the given template, along with their use context
static ItemTemplateMapping getMapping(ContentItem item, String useContext)
          Deprecated. use getMapping(ContentItem item, String useContext, MimeType mimeType)
static ItemTemplateMapping getMapping(ContentItem item, String useContext, com.arsdigita.mimetypes.MimeType mimeType)
          Load the specified mapping; return null if no such mapping exists
static ItemTemplateMapping getMapping(ContentItem item, String useContext, Template template)
           
 com.arsdigita.kernel.ACSObject getParent()
          Return the parent of the template within the section.
protected static Template getTemplate(ContentItem item, String useContext)
          Deprecated. use getTemplate(ContentItem item, String useContext, MimeType mimeType)
protected static Template getTemplate(ContentItem item, String useContext, com.arsdigita.mimetypes.MimeType mimeType)
          Get the template for the item in the specified use context.
protected static com.arsdigita.cms.ItemTemplateCollection getTemplates(ContentItem item)
          Retrieve all templates for the given content item, along with their use context
protected static com.arsdigita.cms.ItemTemplateCollection getUseContexts(ContentItem item)
          Retrieve all use contexts along with possibly null template for the item in that use context.
 Boolean isDefault()
          Determine if the template will be the default within its context.
 void setContentItem(ContentItem item)
           
 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

ITEM

public static final String ITEM
See Also:
Constant Field Values

TEMPLATE

public static final String TEMPLATE
See Also:
Constant Field Values

USE_CONTEXT

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

ItemTemplateMapping

public ItemTemplateMapping()

ItemTemplateMapping

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

ItemTemplateMapping

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

ItemTemplateMapping

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

ItemTemplateMapping

public ItemTemplateMapping(String type)
Method Detail

getContentSection

public 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

getContentItem

public final ContentItem getContentItem()

setContentItem

public final void setContentItem(ContentItem item)

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

isDefault

public Boolean isDefault()
Description copied from class: TemplateMapping
Determine if the template will be the default within its context. Child classes should override this method to do the right thing.

Specified by:
isDefault in class TemplateMapping

setDefault

public void setDefault(Boolean b)
Description copied from class: TemplateMapping
Set whether the template will be the default within its context. Child classes should override this method to do the right thing.

Specified by:
setDefault in class TemplateMapping

getMapping

public static ItemTemplateMapping getMapping(ContentItem item,
                                             String useContext)
Deprecated. use getMapping(ContentItem item, String useContext, MimeType mimeType)

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


getMapping

public static ItemTemplateMapping getMapping(ContentItem item,
                                             String useContext,
                                             com.arsdigita.mimetypes.MimeType mimeType)
Load the specified mapping; return null if no such mapping exists


getMapping

public static ItemTemplateMapping getMapping(ContentItem item,
                                             String useContext,
                                             Template template)

getTemplate

protected static Template getTemplate(ContentItem item,
                                      String useContext)
Deprecated. use getTemplate(ContentItem item, String useContext, MimeType mimeType)

Get the template for the item in the specified use context. Return null if no such template exists


getTemplate

protected static Template getTemplate(ContentItem item,
                                      String useContext,
                                      com.arsdigita.mimetypes.MimeType mimeType)
Get the template for the item in the specified use context. Return null if no such template exists


getTemplates

protected static com.arsdigita.cms.ItemTemplateCollection getTemplates(ContentItem item)
Retrieve all templates for the given content item, along with their use context


getUseContexts

protected static com.arsdigita.cms.ItemTemplateCollection getUseContexts(ContentItem item)
Retrieve all use contexts along with possibly null template for the item in that use context.


getContextsWithTypes

protected static com.arsdigita.cms.ItemTemplateCollection getContextsWithTypes(ContentItem item)
Retrieve all use context/mime type combinations along with possibly null template for the item in that pair. This returns one row for each use context/mime type pair. So, you could get 4 rows if there is public/jsp, public/xsl, alternate/jsp, and alternate/xsl. This is because there can be one template per context/mime-type pair


getItems

protected static com.arsdigita.cms.ItemTemplateCollection getItems(Template template)
Retrieve all content items for the given template, along with their use context



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