info.magnolia.module.templatingkit.templates.category
Class TemplateCategoryUtil

java.lang.Object
  extended by info.magnolia.module.templatingkit.templates.category.TemplateCategoryUtil

public class TemplateCategoryUtil
extends Object

Few util methods to use template categories.


Constructor Summary
TemplateCategoryUtil()
           
 
Method Summary
static info.magnolia.cms.core.Content findParentWithTemplateCategory(info.magnolia.cms.core.Content pageNode, String templateCategory)
          Deprecated. since 2.5. Use findParentWithTemplateCategory(Node, String) instead.
static javax.jcr.Node findParentWithTemplateCategory(javax.jcr.Node pageNode, String templateCategory)
           
static List<javax.jcr.Node> getContentListByTemplateCategorySubCategory(javax.jcr.Node siteRoot, String category, String subCategory)
           
static List<javax.jcr.Node> getContentListByTemplateCategorySubCategory(javax.jcr.Node siteRoot, String category, String subCategory, int maxResultSize, String andClause, String orderBy)
           
static List<javax.jcr.Node> getContentListByTemplateName(javax.jcr.Node searchRoot, String templateName)
           
static List<javax.jcr.Node> getContentListByTemplateName(javax.jcr.Node searchRoot, String templateName, int maxResultSize, String andClause, String orderByClause)
           
static List<javax.jcr.Node> getContentListByTemplateNames(javax.jcr.Node searchRoot, Set<String> templateIds, int maxResultSize, String andClause, String orderByClause)
          Find content objects with one of the given templates below a given search root.
static javax.jcr.Node getNearestContentByTemplateCategorySubCategory(javax.jcr.Node siteRoot, String category, String subCategory, javax.jcr.Node current)
           
static String getTemplateCategory(info.magnolia.cms.core.Content pageNode)
          Deprecated. since 2.5. Use getTemplateCategory(Node) instead.
static String getTemplateCategory(javax.jcr.Node pageNode)
          Returns the category of the template assigned to a node, if the assigned template is not an STK template it default to TemplateCategory.CONTENT and if there is no template assigned or the assigned template doesn't exists it returns the empty string.
static String getTemplateSubCategory(info.magnolia.cms.core.Content pageNode)
          Deprecated. since 2.5. Use getTemplateSubCategory(Node) instead.
static String getTemplateSubCategory(javax.jcr.Node pageNode)
          Returns the sub-category of the template assigned to a node, if the assigned template is not an STK template it default to TemplateCategory.CONTENT and if there is no template assigned or the assigned template doesn't exists it returns the empty string.
static boolean hasTemplateOfCategory(info.magnolia.cms.core.Content pageNode, String templateCategory)
          Deprecated. since 2.5. Use hasTemplateOfCategory(Node, String) instead.
static boolean hasTemplateOfCategory(javax.jcr.Node pageNode, String templateCategory)
           
static boolean isContentPage(info.magnolia.cms.core.Content pageNode)
          Deprecated. since 2.5. Use isContentPage(Node) instead.
static boolean isContentPage(javax.jcr.Node pageNode)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateCategoryUtil

public TemplateCategoryUtil()
Method Detail

getTemplateCategory

public static String getTemplateCategory(javax.jcr.Node pageNode)
Returns the category of the template assigned to a node, if the assigned template is not an STK template it default to TemplateCategory.CONTENT and if there is no template assigned or the assigned template doesn't exists it returns the empty string.


getTemplateCategory

public static String getTemplateCategory(info.magnolia.cms.core.Content pageNode)
Deprecated. since 2.5. Use getTemplateCategory(Node) instead.


getTemplateSubCategory

public static String getTemplateSubCategory(javax.jcr.Node pageNode)
Returns the sub-category of the template assigned to a node, if the assigned template is not an STK template it default to TemplateCategory.CONTENT and if there is no template assigned or the assigned template doesn't exists it returns the empty string.


getTemplateSubCategory

public static String getTemplateSubCategory(info.magnolia.cms.core.Content pageNode)
Deprecated. since 2.5. Use getTemplateSubCategory(Node) instead.


hasTemplateOfCategory

public static boolean hasTemplateOfCategory(javax.jcr.Node pageNode,
                                            String templateCategory)

hasTemplateOfCategory

public static boolean hasTemplateOfCategory(info.magnolia.cms.core.Content pageNode,
                                            String templateCategory)
Deprecated. since 2.5. Use hasTemplateOfCategory(Node, String) instead.


findParentWithTemplateCategory

public static javax.jcr.Node findParentWithTemplateCategory(javax.jcr.Node pageNode,
                                                            String templateCategory)
                                                     throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

findParentWithTemplateCategory

public static info.magnolia.cms.core.Content findParentWithTemplateCategory(info.magnolia.cms.core.Content pageNode,
                                                                            String templateCategory)
                                                                     throws javax.jcr.RepositoryException
Deprecated. since 2.5. Use findParentWithTemplateCategory(Node, String) instead.

Throws:
javax.jcr.RepositoryException

isContentPage

public static boolean isContentPage(javax.jcr.Node pageNode)

isContentPage

public static boolean isContentPage(info.magnolia.cms.core.Content pageNode)
Deprecated. since 2.5. Use isContentPage(Node) instead.


getContentListByTemplateCategorySubCategory

public static List<javax.jcr.Node> getContentListByTemplateCategorySubCategory(javax.jcr.Node siteRoot,
                                                                               String category,
                                                                               String subCategory)
                                                                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getContentListByTemplateCategorySubCategory

public static List<javax.jcr.Node> getContentListByTemplateCategorySubCategory(javax.jcr.Node siteRoot,
                                                                               String category,
                                                                               String subCategory,
                                                                               int maxResultSize,
                                                                               String andClause,
                                                                               String orderBy)
                                                                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getContentListByTemplateName

public static List<javax.jcr.Node> getContentListByTemplateName(javax.jcr.Node searchRoot,
                                                                String templateName)
                                                         throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getContentListByTemplateName

public static List<javax.jcr.Node> getContentListByTemplateName(javax.jcr.Node searchRoot,
                                                                String templateName,
                                                                int maxResultSize,
                                                                String andClause,
                                                                String orderByClause)
                                                         throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getContentListByTemplateNames

public static List<javax.jcr.Node> getContentListByTemplateNames(javax.jcr.Node searchRoot,
                                                                 Set<String> templateIds,
                                                                 int maxResultSize,
                                                                 String andClause,
                                                                 String orderByClause)
                                                          throws javax.jcr.RepositoryException
Find content objects with one of the given templates below a given search root.

Parameters:
searchRoot -
templateIds -
maxResultSize - setting this can drastically improve query performance, if you are interested only in a fixed number of leading result objects
andClause - an additional "AND" clause in SQL syntax, excluding the "AND" itself, e.g. "date IS NOT NULL"
orderByClause - an "ORDER BY" clause in SQL syntax, excluding the "ORDER BY" itself, e.g. "date desc" or "date asc"
Returns:
Throws:
javax.jcr.RepositoryException

getNearestContentByTemplateCategorySubCategory

public static javax.jcr.Node getNearestContentByTemplateCategorySubCategory(javax.jcr.Node siteRoot,
                                                                            String category,
                                                                            String subCategory,
                                                                            javax.jcr.Node current)
                                                                     throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException


Copyright © 2008-2014 Magnolia International Ltd.. All Rights Reserved.