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.

Version:
$Id: TemplateCategoryUtil.java 53070 2011-12-30 15:39:24Z tmattsson $
Author:
pbracher

Constructor Summary
TemplateCategoryUtil()
           
 
Method Summary
static info.magnolia.cms.core.Content findParentWithTemplateCategory(info.magnolia.cms.core.Content pageNode, String templateCategory)
           
static javax.jcr.Node findParentWithTemplateCategory(javax.jcr.Node pageNode, String templateCategory)
          FIXME nested method call: for work around Content.
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> 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)
          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 getTemplateCategory(javax.jcr.Node pageNode)
          FIXME nested method call: for work around Content.
static String getTemplateSubCategory(info.magnolia.cms.core.Content 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 String getTemplateSubCategory(javax.jcr.Node pageNode)
          FIXME nested method call: for work around Content.
static boolean hasTemplateOfCategory(info.magnolia.cms.core.Content pageNode, String templateCatergory)
           
static boolean hasTemplateOfCategory(javax.jcr.Node pageNode, String templateCatergory)
          FIXME nested method call: for work around Content.
static boolean isContentPage(info.magnolia.cms.core.Content pageNode)
           
static boolean isContentPage(javax.jcr.Node pageNode)
          FIXME nested method call: for work around Content.
 
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)
FIXME nested method call: for work around Content.


getTemplateCategory

public static String getTemplateCategory(info.magnolia.cms.core.Content 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.


getTemplateSubCategory

public static String getTemplateSubCategory(javax.jcr.Node pageNode)
FIXME nested method call: for work around Content.


getTemplateSubCategory

public static String getTemplateSubCategory(info.magnolia.cms.core.Content 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.


hasTemplateOfCategory

public static boolean hasTemplateOfCategory(javax.jcr.Node pageNode,
                                            String templateCatergory)
FIXME nested method call: for work around Content.


hasTemplateOfCategory

public static boolean hasTemplateOfCategory(info.magnolia.cms.core.Content pageNode,
                                            String templateCatergory)

findParentWithTemplateCategory

public static javax.jcr.Node findParentWithTemplateCategory(javax.jcr.Node pageNode,
                                                            String templateCategory)
                                                     throws javax.jcr.RepositoryException
FIXME nested method call: for work around Content.

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
Throws:
javax.jcr.RepositoryException

isContentPage

public static boolean isContentPage(javax.jcr.Node pageNode)
FIXME nested method call: for work around Content.


isContentPage

public static boolean isContentPage(info.magnolia.cms.core.Content pageNode)

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

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-2012 Magnolia International Ltd.. All Rights Reserved.