info.magnolia.module.categorization.functions
Class CategorizationTemplatingFunctions

java.lang.Object
  extended by info.magnolia.module.categorization.functions.CategorizationTemplatingFunctions

public class CategorizationTemplatingFunctions
extends Object

This is an component exposing a couple of methods useful for Categorization templates.

Author:
tmiyar

Constructor Summary
CategorizationTemplatingFunctions(info.magnolia.templating.functions.TemplatingFunctions templatingFunction, info.magnolia.module.templatingkit.functions.STKTemplatingFunctions stkTemplatingFunction, info.magnolia.rendering.template.registry.TemplateDefinitionRegistry templateDefinitionRegistry, info.magnolia.module.templatingkit.style.CssSelectorBuilder cssSelectorBuilder, info.magnolia.module.templatingkit.categorization.CategorizationSupport categorizationSupport, info.magnolia.module.templatingkit.sites.SiteManager siteManager)
           
 
Method Summary
 List<javax.jcr.Node> getCategories(javax.jcr.Node node, String nodeDataName)
          Return all Category Nodes linked to the current content.
 String getCategorizationRepository()
           
 String getCategorizationRootPath()
           
 String getCategoryLink(javax.jcr.Node node, String categoryName)
          Get the Link as String of the Higher category.
 String getCategoryName(String identifier)
           
 javax.jcr.Node getCategoryNodeByName(String categoryName)
          Get the Node representing the category defined by categoryName.
 javax.jcr.Node getCategoryOverviewPage(javax.jcr.Node searchRoot)
          Return the CotegoryOverviewPage.
 Collection<javax.jcr.Node> getContentByCategory(javax.jcr.Node node, String name)
           
 Collection<javax.jcr.Node> getContentByCategoryIdentifier(String sitePath, String identifier)
          Return all Nodes refered by the Category identifier.
 javax.jcr.Node getContentByTemplateCategorySubCategory(javax.jcr.Node siteRoot, String category, String subCategory)
          Return the First element returned by super.getContentListByTemplateCategorySubCategory(Node siteRoot, String category, String subCategory).
 Collection<javax.jcr.Node> getRelatedCategories(String name)
          Get all nodes referencing this Category.
 boolean isCategorizable(javax.jcr.Node subNode)
          Check if the node is a category.
 boolean isSTKTemplate(javax.jcr.Node pageNode)
          Check if this is a n STK template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CategorizationTemplatingFunctions

@Inject
public CategorizationTemplatingFunctions(info.magnolia.templating.functions.TemplatingFunctions templatingFunction,
                                                info.magnolia.module.templatingkit.functions.STKTemplatingFunctions stkTemplatingFunction,
                                                info.magnolia.rendering.template.registry.TemplateDefinitionRegistry templateDefinitionRegistry,
                                                info.magnolia.module.templatingkit.style.CssSelectorBuilder cssSelectorBuilder,
                                                info.magnolia.module.templatingkit.categorization.CategorizationSupport categorizationSupport,
                                                info.magnolia.module.templatingkit.sites.SiteManager siteManager)
Method Detail

getCategories

public List<javax.jcr.Node> getCategories(javax.jcr.Node node,
                                          String nodeDataName)
Return all Category Nodes linked to the current content.

Parameters:
content -
nodeDataName -
Returns:

getCategoryLink

public String getCategoryLink(javax.jcr.Node node,
                              String categoryName)
Get the Link as String of the Higher category. If no category found, return null.

Parameters:
node -
categoryName -
Returns:

getContentByTemplateCategorySubCategory

public javax.jcr.Node getContentByTemplateCategorySubCategory(javax.jcr.Node siteRoot,
                                                              String category,
                                                              String subCategory)
                                                       throws javax.jcr.RepositoryException
Return the First element returned by super.getContentListByTemplateCategorySubCategory(Node siteRoot, String category, String subCategory).

Parameters:
siteRoot -
category -
subCategory -
Returns:
Throws:
javax.jcr.RepositoryException

getCategoryOverviewPage

public javax.jcr.Node getCategoryOverviewPage(javax.jcr.Node searchRoot)
Return the CotegoryOverviewPage.

Parameters:
searchRoot -
Returns:

getContentByCategory

public Collection<javax.jcr.Node> getContentByCategory(javax.jcr.Node node,
                                                       String name)

getContentByCategoryIdentifier

public Collection<javax.jcr.Node> getContentByCategoryIdentifier(String sitePath,
                                                                 String identifier)
Return all Nodes refered by the Category identifier. Perform the JCR Query call.

Parameters:
sitePath -
uuid -
Returns:

getRelatedCategories

public Collection<javax.jcr.Node> getRelatedCategories(String name)
Get all nodes referencing this Category. if name=BB tree: X - B - BB - relatedUUID - BBY - BBX - BBC - C result: BB;BBX;BBY;BBC;C

Parameters:
name -
Returns:

getCategoryNodeByName

public javax.jcr.Node getCategoryNodeByName(String categoryName)
                                     throws javax.jcr.RepositoryException
Get the Node representing the category defined by categoryName.

Parameters:
categoryName -
Returns:
Throws:
javax.jcr.RepositoryException

getCategorizationRootPath

public String getCategorizationRootPath()

getCategorizationRepository

public String getCategorizationRepository()

getCategoryName

public String getCategoryName(String identifier)
                       throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

isCategorizable

public boolean isCategorizable(javax.jcr.Node subNode)
                        throws javax.jcr.PathNotFoundException,
                               javax.jcr.RepositoryException
Check if the node is a category.

Parameters:
subNode -
Returns:
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException

isSTKTemplate

public boolean isSTKTemplate(javax.jcr.Node pageNode)
Check if this is a n STK template.

Parameters:
pageNode -
Returns:
Throws:
info.magnolia.registry.RegistrationException


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