Package com.day.cq.wcm.api
Interface TemplateManager
-
@ProviderType public interface TemplateManager
Template Manger API. API for managing 'authored' templates and related components.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TemplatecreateTemplate(java.lang.String parentPath, java.lang.String templateType, java.lang.String templateName, ValueMap templateProperties)Creates a new templatevoiddeleteTemplate(Template template)java.util.List<Template>getAllTemplates()java.util.List<Page>getContainingPages(Template template)TemplategetContainingTemplate(Resource resource)java.util.List<Resource>getStructureResources(ComponentContext componentContext)TemplategetTemplate(java.lang.String templatePath)java.util.List<Template>getTemplates(Predicate filter)java.util.List<Template>getTemplateTypes(java.lang.String parentPath)Get template typesbooleanisTemplateUsed(Template template)Verifies if there is any Page using the given Template.
-
-
-
Method Detail
-
createTemplate
Template createTemplate(java.lang.String parentPath, java.lang.String templateType, java.lang.String templateName, ValueMap templateProperties) throws WCMException
Creates a new template- Parameters:
parentPath- the parent pathtemplateName- the template nametemplateProperties- properties of templatetemplateType- type of template- Returns:
- Template
- Throws:
WCMException- is thrown if the template is still used on pages.
-
deleteTemplate
void deleteTemplate(Template template) throws WCMException
- Parameters:
template- the template- Throws:
WCMException- is thrown if the template is still used on pages.
-
getContainingPages
java.util.List<Page> getContainingPages(Template template)
- Parameters:
template- the template- Returns:
- Containing Pages
-
getStructureResources
java.util.List<Resource> getStructureResources(ComponentContext componentContext)
- Parameters:
componentContext- the component context- Returns:
- list of structureResources
-
getContainingTemplate
Template getContainingTemplate(Resource resource)
- Parameters:
resource- the resource that contains template- Returns:
- Template
-
getAllTemplates
java.util.List<Template> getAllTemplates()
- Returns:
- List of All Templates
-
getTemplates
java.util.List<Template> getTemplates(Predicate filter)
- Parameters:
filter- filter templates- Returns:
- Get Filtered Templates
-
getTemplate
Template getTemplate(java.lang.String templatePath)
- Parameters:
templatePath- the path for the template- Returns:
- the template at the templatePath
-
getTemplateTypes
java.util.List<Template> getTemplateTypes(java.lang.String parentPath)
Get template types- Parameters:
parentPath- The parent path for the templates- Returns:
- Template type for each template
-
isTemplateUsed
boolean isTemplateUsed(Template template)
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
-
-