|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.cms.DefaultTemplateManager
A default implementation of template manager
.
Field Summary | |
static String |
versionId
|
Fields inherited from interface com.arsdigita.cms.TemplateManager |
PUBLIC_CONTEXT |
Constructor Summary | |
DefaultTemplateManager()
Construct a new template manager |
Method Summary | |
void |
addTemplate(ContentItem item,
Template template,
String context)
Assign a template to the item in the given context. |
void |
addTemplate(ContentItem item,
Template template,
String context,
com.arsdigita.mimetypes.MimeType mimeType)
Assign a template to the item in the given context. |
void |
addTemplate(ContentSection section,
ContentType type,
Template template,
String context)
Add a template to the given content type for the given content section. |
void |
addTemplate(ContentSection section,
ContentType type,
Template template,
String context,
boolean isDefault)
Add a template to the given content type for the given content section. |
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. |
Template |
getDefaultTemplate(ContentSection section,
ContentType type,
String context)
Get the default template for the given section, type and use context |
Template |
getDefaultTemplate(ContentSection section,
ContentType type,
String context,
com.arsdigita.mimetypes.MimeType mimeType)
Get the default template for the given section, type and use context |
Template |
getTemplate(ContentItem item,
String context)
Retrieve a template for the item in the given use context. |
TemplateCollection |
getTemplates(ContentItem item)
Retrieve all templates for the content item |
TemplateCollection |
getTemplates(ContentSection section,
ContentType type)
Get all the templates within the given section and type |
TemplateCollection |
getTemplates(ContentSection section,
ContentType type,
String context)
Get all the templates within the given section, type and context |
TemplateCollection |
getUseContexts(ContentItem item)
Retrieve a collection of all use contexts for the item, along with the templates assigned to each use context (if any). |
void |
removeTemplate(ContentItem item,
Template template,
String context)
Unassign a template from the item in the given context. |
void |
removeTemplate(ContentSection section,
ContentType type,
Template template,
String context)
Remove the specified template from the content type in the given context. |
void |
setDefaultTemplate(ContentSection section,
ContentType type,
Template template,
String useContext)
Designate the given template as the default template within its use context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public DefaultTemplateManager()
Method Detail |
public void addTemplate(ContentItem item, Template template, String context, com.arsdigita.mimetypes.MimeType mimeType)
item
- the content itemtemplate
- the template to be assignedcontext
- the use context for the template, such as "public" or
"abridged".public void addTemplate(ContentItem item, Template template, String context)
TemplateManager
addTemplate
in interface TemplateManager
item
- the content itemtemplate
- the template to be assignedcontext
- the use context for the template, such as "public" or
"abridged".public void removeTemplate(ContentItem item, Template template, String context)
removeTemplate
in interface TemplateManager
item
- the content itemtemplate
- the template to be unassignedcontext
- the use context for the template, such as "public" or
"abridged".public void addTemplate(ContentSection section, ContentType type, Template template, String context, boolean isDefault)
addTemplate
in interface TemplateManager
section
- the content section to which the template will belongtype
- the content type to which the template will belongtemplate
- the template to be addedcontext
- the use context for the template, such as "public" or
"abridged".isDefault
- if true, new content items of the given type will
use this template by default when they are rendered within the specified
use contextpublic void setDefaultTemplate(ContentSection section, ContentType type, Template template, String useContext)
addTemplate(com.arsdigita.cms.ContentItem, com.arsdigita.cms.Template, java.lang.String, com.arsdigita.mimetypes.MimeType)
must
first be called to actually add the template to.
setDefaultTemplate
in interface TemplateManager
section
- the content section where the template residestype
- the content type to which the template belongstemplate
- the template which will be made defaultuseContext
- the use context in which the template will be made defaultpublic void addTemplate(ContentSection section, ContentType type, Template template, String context)
addTemplate
in interface TemplateManager
section
- the content section to which the template will belongtype
- the content type to which the template will belongtemplate
- the template to be addedcontext
- the use context for the template, such as "public" or
"abridged".public void removeTemplate(ContentSection section, ContentType type, Template template, String context)
removeTemplate
in interface TemplateManager
section
- the content section to which the template belongstype
- the content type to which the template belongstemplate
- the template to be removedcontext
- the use context for the template, such as "public" or
"abridged".public Template getTemplate(ContentItem item, String context)
getTemplate
in interface TemplateManager
item
- the content itemcontext
- the use context for the template, such as "public" or
"abridged".
public TemplateCollection getTemplates(ContentItem item)
getTemplates
in interface TemplateManager
item
- the content item
TemplateCollection
of all the templates assigned
to the itemTemplateManager.getUseContexts(com.arsdigita.cms.ContentItem)
public TemplateCollection getUseContexts(ContentItem item)
getTemplates(ContentItem)
, the collection returned
by this method will include all use contexts for an item, even
those use contexts to which no template is yet assigned.
getUseContexts
in interface TemplateManager
item
- the content item
TemplateCollection
of all the templates assigned
to the itempublic com.arsdigita.cms.ItemTemplateCollection getContextsWithTypes(ContentItem item)
getContextsWithTypes
in interface TemplateManager
public Template getDefaultTemplate(ContentSection section, ContentType type, String context)
getDefaultTemplate
in interface TemplateManager
section
- the content section to which the template belongstype
- the content type to which the template belongscontext
- the use context for the template, such as "public" or
"abridged".
public Template getDefaultTemplate(ContentSection section, ContentType type, String context, com.arsdigita.mimetypes.MimeType mimeType)
getDefaultTemplate
in interface TemplateManager
section
- the content section to which the template belongstype
- the content type to which the template belongscontext
- the use context for the template, such as "public" or
"abridged".mimeType
- The mime type of the template that is desired.
public TemplateCollection getTemplates(ContentSection section, ContentType type)
getTemplates
in interface TemplateManager
section
- the content sectiontype
- the content type
public TemplateCollection getTemplates(ContentSection section, ContentType type, String context)
getTemplates
in interface TemplateManager
section
- the content sectiontype
- the content typecontext
- the use context
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |