com.arsdigita.cms
Class Template

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.versioning.VersionedACSObject
                  extended bycom.arsdigita.cms.ContentItem
                      extended bycom.arsdigita.cms.Asset
                          extended bycom.arsdigita.cms.TextAsset
                              extended bycom.arsdigita.cms.Template
All Implemented Interfaces:
com.arsdigita.auditing.Audited, CustomCopy

public class Template
extends TextAsset

This class represents a template.

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

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String IS_PUBLISHABLE
           
static String JSP_MIME_TYPE
          The default mime-type for templates
static String LABEL
           
static Map SUPPORTED_MIME_TYPES
          This is a map of all mime types with the key being the string representation of the mime type (such as 'text/x-jsp') and the value being a GlobalizedMessage that is the pretty name of the mime type.
static String versionId
           
static String XSL_MIME_TYPE
           
 
Fields inherited from class com.arsdigita.cms.TextAsset
CONTENT
 
Fields inherited from class com.arsdigita.cms.Asset
DESCRIPTION, MIME_TYPE, NAME
 
Fields inherited from class com.arsdigita.cms.ContentItem
ANCESTORS, AUDITING, CHILDREN, CONTENT_SECTION, CONTENT_TYPE, DRAFT, DRAFT_VERSION, LANGUAGE, LIVE, PARENT, PENDING, VERSION, VERSIONS
 
Fields inherited from class com.arsdigita.versioning.VersionedACSObject
IS_DELETED, MASTER
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
Template()
          Default constructor.
Template(BigDecimal id)
          Load a template with the given ID
Template(com.arsdigita.persistence.DataObject obj)
          Load a Template by encapsulating the given data object
Template(com.arsdigita.persistence.OID oid)
          Constructor.
Template(String type)
          Create a new Template with the given type
 
Method Summary
 String getBaseDataObjectType()
           
 String getDisplayName()
          Return the publically viewable name of this template
 String getLabel()
          Get the user-readable label for the template
 String getPath()
          Return the path for the template.
 void initialize()
          Called from the base class (DomainObject) constructors.
 Boolean isPublishable()
          Determine whether it is possible to write the items with this template to the filesystem (as static HTML files).
 void setLabel(String label)
           
 void setPublishable(boolean isPublishable)
          Set whether it is possible to write the items with this template to the filesystem (as static HTML files).
 void setPublishable(Boolean isPublishable)
          Set whether it is possible to write the items with this template to the filesystem (as static HTML files).
 
Methods inherited from class com.arsdigita.cms.TextAsset
getText, readText, recordChanges, setText, writeText, writeToFile
 
Methods inherited from class com.arsdigita.cms.Asset
getDescription, getMimeType, setDescription, setMimeType
 
Methods inherited from class com.arsdigita.cms.ContentItem
addCategory, addPendingVersion, afterSave, assertDraft, assertLive, assertMaster, assertPending, beforeDelete, beforeSave, canPublishToFS, copy, copy, copyProperty, copyProperty, copyServices, copyServicesFrom, createLiveVersion, createPendingVersion, get, getCategories, getCategoryCollection, getChildren, getContentSection, getContentType, getCreationDate, getCreationIP, getCreationUser, getDraftVersion, getLanguage, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser, getLifecycle, getLiveVersion, getLocale, getName, getParent, getPathInfo, getPathInfo, getPathNoJsp, getPendingVersions, getPublicVersion, getVersion, getWorkingVersion, isDraftVersion, isLive, isLiveVersion, isPendingVersion, isPublished, makeCopy, promotePendingVersion, publish, publishToFS, removeCategory, removeLifecycle, removePendingVersion, set, setContentSection, setContentType, setDefaultCategory, setLanguage, setLifecycle, setLive, setLiveVersion, setName, setParent, setVersion, setVersionRecursively, unpublish, unpublishFromFS
 
Methods inherited from class com.arsdigita.versioning.VersionedACSObject
applyTag, applyUniqueTag, autoPropagateMaster, getMaster, getRolledBackTo, getTransactions, getTransactions, isMaster, isRolledBack, isSubtype, permanentlyDelete, propagateMaster, recordAttributeChange, rollBackTo, rollBackTo, rollForward, save, setMaster, trackChanges
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, 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, clear, delete, disconnect, equals, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, 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

LABEL

public static final String LABEL
See Also:
Constant Field Values

IS_PUBLISHABLE

public static final String IS_PUBLISHABLE
See Also:
Constant Field Values

JSP_MIME_TYPE

public static final String JSP_MIME_TYPE
The default mime-type for templates

See Also:
Constant Field Values

XSL_MIME_TYPE

public static final String XSL_MIME_TYPE
See Also:
Constant Field Values

SUPPORTED_MIME_TYPES

public static final Map SUPPORTED_MIME_TYPES
This is a map of all mime types with the key being the string representation of the mime type (such as 'text/x-jsp') and the value being a GlobalizedMessage that is the pretty name of the mime type. This is somewhat of a hack since it is not using the actual label of the MimeType object but that label is not globalized and is not correctly for the XSL type.

Constructor Detail

Template

public Template()
Default constructor. This creates a new content item.


Template

public Template(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.

Template

public Template(BigDecimal id)
         throws com.arsdigita.domain.DataObjectNotFoundException
Load a template with the given ID

Parameters:
id - The id for the retrieved DataObject.

Template

public Template(com.arsdigita.persistence.DataObject obj)
Load a Template by encapsulating the given data object


Template

public Template(String type)
Create a new Template with the given type

Method Detail

initialize

public void initialize()
Description copied from class: ContentItem
Called from the base class (DomainObject) constructors.

Overrides:
initialize in class ContentItem

getBaseDataObjectType

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

getLabel

public String getLabel()
Get the user-readable label for the template


setLabel

public void setLabel(String label)

getDisplayName

public String getDisplayName()
Return the publically viewable name of this template

Overrides:
getDisplayName in class ContentItem
Returns:
The name of the content item

isPublishable

public Boolean isPublishable()
Determine whether it is possible to write the items with this template to the filesystem (as static HTML files).

Returns:
true if the items may be written to the filesystem, false if the template is designed for highly dynamic items which should always be served from the database.

setPublishable

public void setPublishable(Boolean isPublishable)
Set whether it is possible to write the items with this template to the filesystem (as static HTML files).

Parameters:
isPublishable - true if the items may be written to the filesystem, false if the template is designed for highly dynamic items which should always be served from the database.

setPublishable

public void setPublishable(boolean isPublishable)
Set whether it is possible to write the items with this template to the filesystem (as static HTML files).

Parameters:
isPublishable - true if the items may be written to the filesystem, false if the template is designed for highly dynamic items which should always be served from the database.

getPath

public String getPath()
Return the path for the template. This will normally be just the template's name with ".jsp" added

Note that the name of the root folder of the content section where the item resides is not included in the path.

Overrides:
getPath in class ContentItem
Returns:
the path from the item's root to the item
See Also:
ContentItem.getPathInfo(boolean)


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