Package com.day.cq.wcm.api
Interface Template
-
- All Superinterfaces:
Adaptable
,JSONItem
,LabeledResource
@ProviderType public interface Template extends Adaptable, LabeledResource, JSONItem
Defines the interface of a CQ WCM template.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getDescription()
Returns the description of the template ornull
if not defined.java.lang.String
getIconPath()
Returns the path to an icon for this template ornull
if this template does not provide an icon.java.lang.String
getInitialContentPath()
Get the initial content path.java.util.Calendar
getLastModified()
Get last modified date of template.java.lang.String
getPageTypePath()
Get page typejava.lang.String
getPath()
Returns the path of the template resourceValueMap
getProperties()
Get the template's properties.java.lang.Long
getRanking()
Returns the ranking in the template list.java.lang.String
getShortTitle()
Returns the short title of the template ornull
if not defined.java.lang.String
getThumbnailPath()
Returns the path to a thumbnail for this template ornull
if the template does not provide a thumbnail.java.lang.String
getTitle()
Returns the title of the template or the name of the resource (i.e.boolean
hasStructureSupport()
Check if it has structure support.boolean
isAllowed(java.lang.String parentPath)
Checks if this template is allowed to be used for a new page below the given path.boolean
isAllowed(Resource parent)
Checks if this template is allowed to be used for a new page below the given parent.boolean
isAllowedChild(Template template)
Checks if the given template is allowed as a child template.void
write(JSONWriter jsonWriter)
Serializes this descriptor to json-
Methods inherited from interface com.day.cq.commons.LabeledResource
getName
-
-
-
-
Method Detail
-
getPath
java.lang.String getPath()
Returns the path of the template resource- Specified by:
getPath
in interfaceLabeledResource
- Returns:
- path
-
getTitle
java.lang.String getTitle()
Returns the title of the template or the name of the resource (i.e. last path segment) if not defined.- Specified by:
getTitle
in interfaceLabeledResource
- Returns:
- title
-
getShortTitle
java.lang.String getShortTitle()
Returns the short title of the template ornull
if not defined.- Returns:
- short title
-
getDescription
java.lang.String getDescription()
Returns the description of the template ornull
if not defined.- Specified by:
getDescription
in interfaceLabeledResource
- Returns:
- description
-
getIconPath
java.lang.String getIconPath()
Returns the path to an icon for this template ornull
if this template does not provide an icon.- Returns:
- the path to an icon or
null
-
getThumbnailPath
java.lang.String getThumbnailPath()
Returns the path to a thumbnail for this template ornull
if the template does not provide a thumbnail.- Returns:
- the path to a thumbnail or
null
-
getRanking
java.lang.Long getRanking()
Returns the ranking in the template list.- Returns:
- the ranking
-
isAllowed
boolean isAllowed(java.lang.String parentPath)
Checks if this template is allowed to be used for a new page below the given path. Note: This template is not allowed, if the parent template cannot be evaluated but the template specifies "allowedParents" Always useisAllowed(Resource)
in loops for better performance.- Parameters:
parentPath
- parent path for the new page- Returns:
true
if it is allowed.
-
isAllowed
boolean isAllowed(Resource parent)
Checks if this template is allowed to be used for a new page below the given parent. Note: This template is not allowed, if the parent template cannot be evaluated but the template specifies "allowedParents"- Parameters:
parent
- the parent resource for the new page- Returns:
true
if it is allowed.
-
isAllowedChild
boolean isAllowedChild(Template template)
Checks if the given template is allowed as a child template.- Parameters:
template
- the child template- Returns:
true
if the given template is allowed as child template.
-
write
void write(JSONWriter jsonWriter) throws JSONException
Serializes this descriptor to json- Specified by:
write
in interfaceJSONItem
- Parameters:
jsonWriter
- json writer- Throws:
JSONException
- if a JSON error occurs
-
getInitialContentPath
java.lang.String getInitialContentPath()
Get the initial content path.- Returns:
String
the initial content path.
-
getProperties
ValueMap getProperties()
Get the template's properties.- Returns:
- The template's properties. Never returns
null
.
-
hasStructureSupport
boolean hasStructureSupport()
Check if it has structure support.- Returns:
- boolean.
-
getPageTypePath
java.lang.String getPageTypePath()
Get page type- Returns:
- page type.
-
getLastModified
java.util.Calendar getLastModified()
Get last modified date of template.- Returns:
- last modified date of template.
-
-