Package com.day.cq.wcm.api
Interface TemplateManager
Template Manger API.
API for managing 'authored' templates and related components.
-
Method Summary
Modifier and TypeMethodDescriptioncreateTemplate(String parentPath, String templateType, String templateName, ValueMap templateProperties) Creates a new templatevoiddeleteTemplate(Template template) getContainingPages(Template template) getContainingTemplate(Resource resource) getStructureResources(ComponentContext componentContext) getTemplate(String templatePath) getTemplates(Predicate filter) getTemplates(Predicate filter) Deprecated.getTemplateTypes(String parentPath) Get template typesbooleanisTemplateUsed(Template template) Verifies if there is any Page using the given Template.
-
Method Details
-
createTemplate
Template createTemplate(String parentPath, String templateType, String templateName, ValueMap templateProperties) throws WCMException Creates a new template- Parameters:
parentPath- the parent pathtemplateType- type of templatetemplateName- the template nametemplateProperties- properties of template- Returns:
- Template
- Throws:
WCMException- is thrown if the template is still used on pages.
-
deleteTemplate
- Parameters:
template- the template- Throws:
WCMException- is thrown if the template is still used on pages.
-
getContainingPages
- Parameters:
template- the template- Returns:
- Containing Pages
-
getStructureResources
- Parameters:
componentContext- the component context- Returns:
- list of structureResources
-
getContainingTemplate
- Parameters:
resource- the resource that contains template- Returns:
- Template
-
getAllTemplates
- Returns:
- List of All Templates
-
getTemplates
- Parameters:
filter- filter templates- Returns:
- Get Filtered Templates
-
getTemplates
Deprecated.usegetTemplates(Predicate filter)instead- Parameters:
filter- filter templates- Returns:
- Get Filtered Templates
-
getTemplate
- Parameters:
templatePath- the path for the template- Returns:
- the template at the templatePath
-
getTemplateTypes
Get template types- Parameters:
parentPath- The parent path for the templates- Returns:
- Template type for each template
-
isTemplateUsed
Verifies if there is any Page using the given Template. If the parameter is null, false is returned.- Parameters:
template- theTemplateto test- Returns:
trueif there is any Page using the Template- Since:
- 1.29
-
getTemplates(Predicate filter)instead