|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.domain.Entity
ccc.domain.ResourceEntity
ccc.domain.HistoricalResource<Template,TemplateRevision>
ccc.domain.TemplateEntity
public class TemplateEntity
A template is used to define how a resource will be displayed.
Constructor Summary | |
---|---|
protected |
TemplateEntity()
Constructor: for persistence only. |
|
TemplateEntity(ResourceName name,
java.lang.String title,
java.lang.String description,
java.lang.String body,
java.lang.String definiton,
MimeType mimeType,
RevisionMetadata metadata)
Constructor. |
|
TemplateEntity(java.lang.String title,
java.lang.String description,
java.lang.String body,
java.lang.String definiton,
MimeType mimeType,
RevisionMetadata metadata)
Constructor. |
Method Summary | |
---|---|
protected java.util.Collection<Template> |
deltaTemplates(java.util.List<TemplateEntity> templates)
Create deltas for a collection of templates. |
Template |
forCurrentRevision()
Create a snapshot for the current revision. |
Template |
forSpecificRevision(int revNo)
Create a snapshot for the specified revision. |
Template |
forWorkingCopy()
Create a snapshot for the working copy. |
java.lang.String |
getBody()
Accessor for the template's body. |
java.lang.String |
getDefinition()
Accessor for the template's definition. |
MimeType |
getMimeType()
Accessor. |
ResourceType |
getType()
Query the type of this resource. |
static java.util.List<Template> |
mapTemplates(java.util.List<TemplateEntity> templates)
Create summaries for a collection of templates. |
Template |
summarize()
Create a summary for a template. |
void |
update(Template delta,
RevisionMetadata metadata)
Update the contents of this template. |
Methods inherited from class ccc.domain.HistoricalResource |
---|
addRevision, currentRevision, currentRevisionNo, revision, revisions, toJson |
Methods inherited from class ccc.domain.Entity |
---|
equals, getId, getVersion, hashCode, setId, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected TemplateEntity()
public TemplateEntity(java.lang.String title, java.lang.String description, java.lang.String body, java.lang.String definiton, MimeType mimeType, RevisionMetadata metadata)
title
- The title of the template.description
- The description for the template.body
- A valid velocity template for rendering a page.definiton
- An xml definition of the fields that the body requires.mimeType
- The mime type this template will produce.metadata
- The metadata describing the initial revision.public TemplateEntity(ResourceName name, java.lang.String title, java.lang.String description, java.lang.String body, java.lang.String definiton, MimeType mimeType, RevisionMetadata metadata)
name
- The name of the template.title
- The title of the template.description
- The description for the template.body
- A valid velocity template for rendering a page.definiton
- An xml definition of the fields that the body requires.mimeType
- The mime type this template will produce.metadata
- The metadata of the template.Method Detail |
---|
public final ResourceType getType()
getType
in class ResourceEntity
public java.lang.String getBody()
public java.lang.String getDefinition()
public MimeType getMimeType()
public void update(Template delta, RevisionMetadata metadata)
delta
- The new content for the template.metadata
- The metadata describing this revision.public Template forCurrentRevision()
public Template forSpecificRevision(int revNo)
revNo
- The revision to create a snapshot for.
public Template forWorkingCopy()
public Template summarize()
public static java.util.List<Template> mapTemplates(java.util.List<TemplateEntity> templates)
templates
- The templates.
protected java.util.Collection<Template> deltaTemplates(java.util.List<TemplateEntity> templates)
templates
- The templates.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |