Copyright© 2008-2026 Sitevision AB, all rights reserved.
@Requireable(value="TemplateUtil") public interface TemplateUtil
sv:template.
Sitevision templates comes in different flavours:
sv:template that can be used to create a page/article.
sv:template that can only be used to create other templates.
sv:collaborationGroupTemplate that can be used to create collaboration groups.
See method documentation to see what specific flavours each method supports.
Also see CollaborationGroupTemplateUtil when working with collaboration group templates.
An instance of the Sitevision class implementing this interface can be obtained via Utils.getTemplateUtil().
See Utils for how to obtain an instance of the Utils interface.
CollaborationGroupTemplateUtil| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getContentAreaNames(Node aTemplate)
Gets the names of the content areas in a template.
|
Node |
getPageTemplateByName(String aPageTemplateName)
Gets first found page template with a given name.
|
List<Node> |
getPageTemplates()
Gets the page templates.
|
Node |
getTemplateByName(String aTemplateName)
Gets first found template with a given name.
|
List<Node> |
getTemplates()
Gets all templates.
|
boolean |
isPageTemplate(Node aTemplate)
Whether or not a node is a page template.
|
Node getTemplateByName(String aTemplateName)
Note! This methods returns the first matching template - regardless of its type/state. It might be a collaboration group template, it might be a page template that can be used to create pages/articles of and it might be a template that is a sub-template (i.e. a template that only can be used by other templates).
getPageTemplateByName(String) to get first page template.
CollaborationGroupTemplateUtil.getCollaborationGroupTemplateByName(String)
to get first collaboration group template.
Permission note! Only the templates that current user has PermissionUtil.Permission.READ
on will be considered.
aTemplateName - the name of the templatenull if indeterminable (e.g. no accessible template named aTemplateName could be found)List<Node> getTemplates()
Note! This methods returns all templates - regardless of their type/state. The result might contain collaboration group templates, it might contain page templates that can be used to create pages/articles of and it might contain templates that are sub-templates (i.e. templates that only can be used by other templates).
getPageTemplates() to get all page templates.
CollaborationGroupTemplateUtil.getCollaborationGroupTemplates()
to get all collaboration group templates.
Permission note! The list will only contain page templates that current user has
PermissionUtil.Permission.READ on.
Node getPageTemplateByName(String aPageTemplateName)
A page template is a sv:template that can be used to create pages/articles.
It typically contains one or more content areas.
Permission note! Only the page templates that current user has
PermissionUtil.Permission.READ on will be considered.
aPageTemplateName - the name of the page templatenull if indeterminable
(e.g. no accessible page template named aPageTemplateName could be found)List<Node> getPageTemplates()
A page template is a sv:template that can be used to create pages/articles.
It typically contains one or more content areas.
Permission note! The list will only contain page templates that current user has
PermissionUtil.Permission.READ on.
boolean isPageTemplate(Node aTemplate)
A page template is a sv:template that can be used to create pages/articles.
It typically contains one or more content areas.
aTemplate - a templateSitevision - Content Management Made Easy
Sitevision is an advanced Java enterprise portal product that implements Java Content Repository (JSR 283).
Copyright© 2008-2026 Sitevision AB, all rights reserved.