/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { String } from "../../types/java/lang/String"; import type { Node } from "../../types/javax/jcr/Node"; import type { List } from "../../types/java/util/List"; import type { Set } from "../../types/java/util/Set"; /** * Template utility interface that primarily handles nodes with primary node type sv:template. * *

* Sitevision templates comes in different flavours: *

* *

* See method documentation to see what specific flavours each method supports. * Also see {@link senselogic.sitevision.api.collaboration.CollaborationGroupTemplateUtil} when working with collaboration group templates. *

* *

* An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getTemplateUtil()}. * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface. *

* @author Mikael Wikblom * @since Sitevision 2.6.1_04 * @see senselogic.sitevision.api.collaboration.CollaborationGroupTemplateUtil */ export interface TemplateUtil { /** * Gets first found template with a given name. * *

* 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). *

* * *

* Permission note! Only the templates that current user has {@link senselogic.sitevision.api.security.PermissionUtil.Permission#READ} * on will be considered. *

* @param aTemplateName the name of the template * @return the template, or null if indeterminable (e.g. no accessible template named aTemplateName could be found) */ getTemplateByName(aTemplateName: String | string): Node; /** * Gets all templates. * *

* 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). *

* * *

* Permission note! The list will only contain page templates that current user has * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#READ} on. *

* @return all accessible templates, or empty list if there are no accessible page templates. * @since Sitevision 4.1 */ getTemplates(): List; /** * Gets first found page template with a given name. * *

* 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 * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#READ} on will be considered. *

* @param aPageTemplateName the name of the page template * @return the page template, or null if indeterminable (e.g. no accessible page template named aPageTemplateName could be found) * @since Sitevision 4.1 */ getPageTemplateByName(aPageTemplateName: String | string): Node; /** * Gets the page templates. * *

* 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 * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#READ} on. *

* @return all accessible templates that can be used to create pages/articles, or empty list if there are no accessible page templates. * @since Sitevision 4.1 */ getPageTemplates(): List; /** * Whether or not a node is a page template. * *

* A page template is a sv:template that can be used to create pages/articles. * It typically contains one or more content areas. *

* @param aTemplate a template * @return true if aTemplate can be used to create pages/articles, false otherwise * @since Sitevision 4.1 */ isPageTemplate(aTemplate: Node): boolean; /** * Gets the names of the content areas in a template. * @param aTemplate a template (sv:template or sv:collaborationGroupTemplate) * @return the names of the content areas in aTemplate, or empty set * @since Sitevision 4.1 */ getContentAreaNames(aTemplate: Node): Set; } declare namespace TemplateUtil {} declare var templateUtil: TemplateUtil; export default templateUtil;