info.magnolia.module.templatingkit.util
Class STKUtil

java.lang.Object
  extended by info.magnolia.module.templatingkit.util.STKUtil

public class STKUtil
extends java.lang.Object

Author:
cringele

Field Summary
static STKUtil INSTANCE
           
 
Constructor Summary
STKUtil()
           
 
Method Summary
static java.lang.String abbreviateString(java.lang.String stringToCut, int size)
           
static java.lang.String abbreviateString(java.lang.String stringToCut, int size, java.lang.String closureString)
           
static java.lang.String asStringList(java.util.List<ParagraphConfig> paragraphs)
           
static java.util.Collection collectContentByUsingInheritance(info.magnolia.cms.core.Content content, java.lang.String name)
           
static int count(java.lang.String name)
          Increases the context bound counter and returns the value.
static java.lang.String createBinaryLink(info.magnolia.cms.core.Content content, java.lang.String binaryNodeDataPrefix)
          Deprecated.  
static java.lang.String createImageLink(info.magnolia.cms.core.Content content)
          Deprecated.  
static java.lang.String createImageLink(info.magnolia.cms.core.Content content, java.lang.String imageNodeDataPrefix)
          Deprecated.  
static java.lang.String createImageLink(info.magnolia.cms.core.NodeData binaryNodeData)
           
static java.lang.String createImageLink(info.magnolia.cms.core.NodeData binaryNodeData, info.magnolia.module.templating.RenderingModelImpl model)
           
static java.lang.String createImageLink(info.magnolia.cms.core.NodeData binaryNodeData, java.lang.String variationName)
           
static boolean currentUserHasOneRole(java.util.Collection<java.lang.String> roles)
           
static java.util.List cutList(java.util.List itemsList, int maxResults)
           
static info.magnolia.cms.core.Content decode(info.magnolia.cms.core.Content content)
           
static info.magnolia.cms.core.Content encode(info.magnolia.cms.core.Content content)
           
static Asset getAsset(info.magnolia.cms.core.Content content, java.lang.String nodeDataName)
           
static Asset getAsset(info.magnolia.cms.core.Content content, java.lang.String nodeDataName, java.lang.String variationName)
           
static java.lang.String getAssetLink(info.magnolia.cms.core.Content content, java.lang.String nodeDataName)
           
static java.lang.String getAssetLink(info.magnolia.cms.core.Content content, java.lang.String nodeDataName, info.magnolia.module.templating.RenderingModelImpl model)
           
static java.lang.String getAssetLink(info.magnolia.cms.core.Content content, java.lang.String nodeDataName, java.lang.String variationName)
           
static Asset getAssetVariation(Asset original, java.lang.String variationName)
           
static info.magnolia.cms.core.Content getContentByTemplateCategorySubCategory(info.magnolia.cms.core.Content siteRoot, java.lang.String category, java.lang.String subCategory)
           
static java.util.List getContentListByTemplateCategorySubCategory(info.magnolia.cms.core.Content siteRoot, java.lang.String category, java.lang.String subCategory)
           
static java.util.List getContentListByTemplateName(info.magnolia.cms.core.Content searchRoot, java.lang.String templateName)
           
static java.lang.String getExternalLink(info.magnolia.cms.core.Content content, java.lang.String linkNodeName)
           
static java.lang.String getExternalLinkTitle(info.magnolia.cms.core.Content content, java.lang.String linkNodeName, java.lang.String linkTitleNodeName)
           
static info.magnolia.cms.core.Content getNearestContentByTemplateCategorySubCategory(info.magnolia.cms.core.Content siteRoot, java.lang.String category, java.lang.String subCategory, info.magnolia.cms.core.Content current)
           
static info.magnolia.cms.core.Content getReferencedContent(info.magnolia.cms.core.Content contentNode, java.lang.String nodeDataName, java.lang.String referencedRepository)
          Returns a content object which is referenced with a string uuid stored in a nodedata.
static Site getSite()
           
static Site getSite(info.magnolia.cms.core.Content content)
           
static java.util.Collection getTemplatesCategories()
           
static InheritedContentModel inheritContent(info.magnolia.cms.core.Content content, java.lang.String name)
           
static boolean isChildOf(info.magnolia.cms.core.Content parent, info.magnolia.cms.core.Content child)
           
static java.lang.String resolveImageVariationName(info.magnolia.module.templating.RenderingModelImpl model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final STKUtil INSTANCE
Constructor Detail

STKUtil

public STKUtil()
Method Detail

getAssetVariation

public static Asset getAssetVariation(Asset original,
                                      java.lang.String variationName)

getAsset

public static Asset getAsset(info.magnolia.cms.core.Content content,
                             java.lang.String nodeDataName)

getAsset

public static Asset getAsset(info.magnolia.cms.core.Content content,
                             java.lang.String nodeDataName,
                             java.lang.String variationName)

getAssetLink

public static java.lang.String getAssetLink(info.magnolia.cms.core.Content content,
                                            java.lang.String nodeDataName)

getAssetLink

public static java.lang.String getAssetLink(info.magnolia.cms.core.Content content,
                                            java.lang.String nodeDataName,
                                            info.magnolia.module.templating.RenderingModelImpl model)

getAssetLink

public static java.lang.String getAssetLink(info.magnolia.cms.core.Content content,
                                            java.lang.String nodeDataName,
                                            java.lang.String variationName)

createImageLink

public static java.lang.String createImageLink(info.magnolia.cms.core.NodeData binaryNodeData)

createImageLink

public static java.lang.String createImageLink(info.magnolia.cms.core.NodeData binaryNodeData,
                                               info.magnolia.module.templating.RenderingModelImpl model)

resolveImageVariationName

public static java.lang.String resolveImageVariationName(info.magnolia.module.templating.RenderingModelImpl model)

createImageLink

public static java.lang.String createImageLink(info.magnolia.cms.core.NodeData binaryNodeData,
                                               java.lang.String variationName)

createImageLink

public static java.lang.String createImageLink(info.magnolia.cms.core.Content content)
Deprecated. 


createImageLink

public static java.lang.String createImageLink(info.magnolia.cms.core.Content content,
                                               java.lang.String imageNodeDataPrefix)
Deprecated. 


createBinaryLink

public static java.lang.String createBinaryLink(info.magnolia.cms.core.Content content,
                                                java.lang.String binaryNodeDataPrefix)
Deprecated. 


inheritContent

public static InheritedContentModel inheritContent(info.magnolia.cms.core.Content content,
                                                   java.lang.String name)
                                            throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

collectContentByUsingInheritance

public static java.util.Collection collectContentByUsingInheritance(info.magnolia.cms.core.Content content,
                                                                    java.lang.String name)
                                                             throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

isChildOf

public static boolean isChildOf(info.magnolia.cms.core.Content parent,
                                info.magnolia.cms.core.Content child)

getExternalLink

public static java.lang.String getExternalLink(info.magnolia.cms.core.Content content,
                                               java.lang.String linkNodeName)

getExternalLinkTitle

public static java.lang.String getExternalLinkTitle(info.magnolia.cms.core.Content content,
                                                    java.lang.String linkNodeName,
                                                    java.lang.String linkTitleNodeName)

abbreviateString

public static java.lang.String abbreviateString(java.lang.String stringToCut,
                                                int size)

abbreviateString

public static java.lang.String abbreviateString(java.lang.String stringToCut,
                                                int size,
                                                java.lang.String closureString)

asStringList

public static java.lang.String asStringList(java.util.List<ParagraphConfig> paragraphs)

currentUserHasOneRole

public static boolean currentUserHasOneRole(java.util.Collection<java.lang.String> roles)

getReferencedContent

public static info.magnolia.cms.core.Content getReferencedContent(info.magnolia.cms.core.Content contentNode,
                                                                  java.lang.String nodeDataName,
                                                                  java.lang.String referencedRepository)
Returns a content object which is referenced with a string uuid stored in a nodedata.

Parameters:
contentNode - the node with a nodedata containing a uuid
nodeDataName - the name of the nodedata which contains the uuid as a string
referencedRepository - the repository in which the referenced node exists
Returns:
the referenced node

getContentListByTemplateName

public static java.util.List getContentListByTemplateName(info.magnolia.cms.core.Content searchRoot,
                                                          java.lang.String templateName)
                                                   throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

cutList

public static java.util.List cutList(java.util.List itemsList,
                                     int maxResults)

getContentListByTemplateCategorySubCategory

public static java.util.List getContentListByTemplateCategorySubCategory(info.magnolia.cms.core.Content siteRoot,
                                                                         java.lang.String category,
                                                                         java.lang.String subCategory)
                                                                  throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getNearestContentByTemplateCategorySubCategory

public static info.magnolia.cms.core.Content getNearestContentByTemplateCategorySubCategory(info.magnolia.cms.core.Content siteRoot,
                                                                                            java.lang.String category,
                                                                                            java.lang.String subCategory,
                                                                                            info.magnolia.cms.core.Content current)
                                                                                     throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getContentByTemplateCategorySubCategory

public static info.magnolia.cms.core.Content getContentByTemplateCategorySubCategory(info.magnolia.cms.core.Content siteRoot,
                                                                                     java.lang.String category,
                                                                                     java.lang.String subCategory)
                                                                              throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getTemplatesCategories

public static java.util.Collection getTemplatesCategories()

count

public static int count(java.lang.String name)
Increases the context bound counter and returns the value. This is for instance useful to create unique page wide ids.


encode

public static info.magnolia.cms.core.Content encode(info.magnolia.cms.core.Content content)

decode

public static info.magnolia.cms.core.Content decode(info.magnolia.cms.core.Content content)

getSite

public static Site getSite()

getSite

public static Site getSite(info.magnolia.cms.core.Content content)


Copyright © 2008-2009 Magnolia International. All Rights Reserved.