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 Template
createTemplate(java.lang.String parentPath, java.lang.String templateType, java.lang.String templateName, ValueMap templateProperties)
Creates a new templatevoid
deleteTemplate(Template template)
java.util.List<Template>
getAllTemplates()
java.util.List<Page>
getContainingPages(Template template)
Template
getContainingTemplate(Resource resource)
java.util.List<Resource>
getStructureResources(ComponentContext componentContext)
Template
getTemplate(java.lang.String templatePath)
java.util.List<Template>
getTemplates(Predicate filter)
java.util.List<Template>
getTemplateTypes(java.lang.String parentPath)
Get template typesboolean
isTemplateUsed(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
- theTemplate
to test- Returns:
true
if there is any Page using the Template- Since:
- 1.29
-
-