@Singleton public class STKTemplatingFunctions extends Object
Modifier and Type | Field and Description |
---|---|
protected static String |
SITE_TITLE_PROP_NAME |
static String |
SITEROOT_TEMPLATE_CATEGORY |
protected static String |
TITLE_PROP_NAME |
Constructor and Description |
---|
STKTemplatingFunctions(info.magnolia.templating.functions.TemplatingFunctions templatingFunctions,
CssSelectorBuilder cssSelectorBuilder,
info.magnolia.module.categorization.support.CategorizationSupport categorizationSupport,
info.magnolia.module.site.SiteManager siteManager,
javax.inject.Provider<info.magnolia.module.site.SiteModule> moduleProvider,
info.magnolia.dam.templating.functions.DamTemplatingFunctions damTemplatingFunctions) |
STKTemplatingFunctions(info.magnolia.templating.functions.TemplatingFunctions templatingFunctions,
CssSelectorBuilder cssSelectorBuilder,
info.magnolia.module.categorization.support.CategorizationSupport categorizationSupport,
SiteManager siteManager,
javax.inject.Provider<STKModule> moduleProvider,
info.magnolia.dam.templating.functions.DamTemplatingFunctions damTemplatingFunctions)
Deprecated.
since 2.9 - use
STKTemplatingFunctions(TemplatingFunctions, CssSelectorBuilder, info.magnolia.module.categorization.support.CategorizationSupport, info.magnolia.module.site.SiteManager, Provider instead. |
STKTemplatingFunctions(info.magnolia.templating.functions.TemplatingFunctions templatingFunctions,
CssSelectorBuilder cssSelectorBuilder,
CategorizationSupport categorizationSupport,
SiteManager siteManager,
javax.inject.Provider<STKModule> moduleProvider,
info.magnolia.dam.templating.functions.DamTemplatingFunctions damTemplatingFunctions)
Deprecated.
since 2.9 - use
STKTemplatingFunctions(TemplatingFunctions, CssSelectorBuilder, info.magnolia.module.categorization.support.CategorizationSupport, info.magnolia.module.site.SiteManager, Provider instead. |
Modifier and Type | Method and Description |
---|---|
String |
abbreviateString(String stringToCut,
int size) |
String |
abbreviateString(String stringToCut,
int size,
String closureString) |
List<info.magnolia.jcr.util.ContentMap> |
ancestorsInSite(info.magnolia.jcr.util.ContentMap content) |
List<info.magnolia.jcr.util.ContentMap> |
ancestorsInSite(info.magnolia.jcr.util.ContentMap content,
String nodeTypeName) |
List<javax.jcr.Node> |
ancestorsInSite(javax.jcr.Node content) |
List<javax.jcr.Node> |
ancestorsInSite(javax.jcr.Node content,
String nodeTypeName) |
int |
count(String name)
Increases the context bound counter and returns the value.
|
List<javax.jcr.Node> |
cutList(List<javax.jcr.Node> itemsList,
int maxResults)
Return a Node List with a maximum number or result less or equal to
maxResults.
|
info.magnolia.dam.api.Asset |
getAsset(info.magnolia.jcr.util.ContentMap content,
String assetProperty)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAsset(String) |
info.magnolia.dam.api.Asset |
getAsset(info.magnolia.jcr.util.ContentMap content,
String nodeDataPrefix,
String variationName)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAssetRenditionForAssetId(String, String) |
info.magnolia.dam.api.Asset |
getAsset(javax.jcr.Node content,
String assetProperty)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAsset(String) |
info.magnolia.dam.api.Asset |
getAsset(javax.jcr.Node node,
String assetProperty,
String renditionName)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAssetRenditionForAssetId(String, String) Get the Asset specified by 'nodeDataPrefix' property name
linked to 'node' for the specified 'rendition'. |
String |
getAssetLink(info.magnolia.jcr.util.ContentMap content,
String assetProperty)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAssetLinkForId(String) |
String |
getAssetLink(info.magnolia.jcr.util.ContentMap content,
String assetProperty,
AbstractSTKTemplateModel<? extends info.magnolia.rendering.template.TemplateDefinition> model)
Deprecated.
Since 2.5. Use
(String) |
String |
getAssetLink(info.magnolia.jcr.util.ContentMap content,
String assetProperty,
String renditionName)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAssetLinkForId(String, String) |
String |
getAssetLink(javax.jcr.Node content,
String assetProperty)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAssetLinkForId(String) |
String |
getAssetLink(javax.jcr.Node content,
String assetProperty,
String renditionName)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAssetLinkForId(String, String) |
List<info.magnolia.dam.api.Asset> |
getAssetsByQuery(String statement)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getItems(String, AssetQuery) |
List<info.magnolia.dam.api.Asset> |
getAssetsFromFolder(javax.jcr.Node node,
String assetProperty)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAssetsFromFolderId(String) |
info.magnolia.dam.api.AssetRendition |
getAssetVariation(info.magnolia.dam.api.Asset asset,
String renditionName)
Deprecated.
Since 2.5. Use
DamTemplatingFunctions.getAssetRendition(Asset, String) |
List<info.magnolia.jcr.util.ContentMap> |
getCategories(javax.jcr.Node page)
Deprecated.
since 2.9 - use
CategorizationSupport.getCategories(javax.jcr.Node) by injecting CategorizationSupport instead. |
String |
getCategoryLink(javax.jcr.Node page,
String categoryName)
Deprecated.
since 2.9 - use
CategorizationSupport.getCategoryLink(javax.jcr.Node, String) by injecting CategorizationSupport instead. |
List<javax.jcr.Node> |
getContentListByTemplateCategorySubCategory(javax.jcr.Node siteRoot,
String category,
String subCategory)
FIXME review: should this function be provided by this class?
|
static List<javax.jcr.Node> |
getContentListByTemplateCategorySubCategory(javax.jcr.Node siteRoot,
String category,
String subCategory,
int maxResultSize,
String andClause,
String orderBy)
FIXME review: should this function be provided by this class?
|
static List<javax.jcr.Node> |
getContentListByTemplateName(javax.jcr.Node searchRoot,
String templateName)
FIXME review: should this function be provided by this class?
|
static List<javax.jcr.Node> |
getContentListByTemplateName(javax.jcr.Node searchRoot,
String templateName,
int maxResultSize,
String andClause,
String orderByClause)
FIXME review: should this function be provided by this class?
|
static List<javax.jcr.Node> |
getContentListByTemplateNames(javax.jcr.Node searchRoot,
Set<String> templateIds,
int maxResultSize,
String andClause,
String orderByClause)
FIXME review: should this function be provided by this class?
|
String |
getDivIdAbbreviation(String divID) |
String |
getDivIdAbbreviation(String divID,
String delimiter) |
String |
getImageVariationLinkFromBinary(info.magnolia.jcr.util.ContentMap binaryContent,
AbstractSTKTemplateModel<? extends info.magnolia.rendering.template.TemplateDefinition> model) |
String |
getImageVariationLinkFromBinary(info.magnolia.jcr.util.ContentMap binaryContent,
String rendition) |
String |
getImageVariationLinkFromBinary(javax.jcr.Node binaryContent,
AbstractSTKTemplateModel<? extends info.magnolia.rendering.template.TemplateDefinition> model) |
String |
getImageVariationLinkFromBinary(javax.jcr.Node binaryContent,
String rendition) |
protected ImagingSupport |
getImagingSupport() |
javax.jcr.Node |
getNearestContentByTemplateCategorySubCategory(javax.jcr.Node siteRoot,
String category,
String subCategory,
javax.jcr.Node current)
FIXME review: should this function be provided by this class?
|
javax.jcr.Node |
getReferencedContent(javax.jcr.Node content,
String idPropertyName,
String referencedWorkspace)
Returns a
Node object which is referenced by its id, stored in
the @param propertyName. |
String |
homeLink(info.magnolia.jcr.util.ContentMap content) |
String |
homeLink(javax.jcr.Node content)
Return the home link of this site.
|
String |
homeName(info.magnolia.jcr.util.ContentMap content) |
String |
homeName(javax.jcr.Node content)
Return the Home Site Name = the physical node's object name.
|
String |
homeTitle(info.magnolia.jcr.util.ContentMap content) |
String |
homeTitle(javax.jcr.Node content)
Return the HomeTitle value.
|
String |
metaDataProperty(info.magnolia.jcr.util.ContentMap content,
String property) |
String |
metaDataProperty(javax.jcr.Node content,
String property)
Return a property from the metaData of the node.
|
String |
metaDataTemplate(info.magnolia.jcr.util.ContentMap content) |
String |
metaDataTemplate(javax.jcr.Node content)
Return the template id associated with this content.
|
String |
resolveImageVariationName(AbstractSTKTemplateModel<? extends info.magnolia.rendering.template.TemplateDefinition> model)
Resolves an image variation name based on parameter values found in the model.
|
String |
searchPageLink(info.magnolia.jcr.util.ContentMap content) |
String |
searchPageLink(javax.jcr.Node content)
Method used to get the SearchPageLink.
|
void |
setCategorizationSupport(CategorizationSupport categorizationSupport)
For test purpose only.
|
void |
setCssSelectorBuilder(CssSelectorBuilder cssSelectorBuilder)
For test purpose only.
|
Site |
site() |
Site |
site(info.magnolia.jcr.util.ContentMap content)
Returns the according
Site of the passed content ContentMap . |
Site |
site(javax.jcr.Node content)
Returns the according
Site of the passed content Node . |
info.magnolia.jcr.util.ContentMap |
siteRoot(info.magnolia.jcr.util.ContentMap content)
Returns the site's root
ContentMap of the @param content ContentMap . |
info.magnolia.jcr.util.ContentMap |
siteRoot(info.magnolia.jcr.util.ContentMap content,
String siteRootTemplateCategory)
Returns the site's root
Node of the passed @param content Node . |
javax.jcr.Node |
siteRoot(javax.jcr.Node content)
Returns the site's root
Node of the @param content Node . |
javax.jcr.Node |
siteRoot(javax.jcr.Node content,
String siteRootTemplateCategory)
Returns the site's root
Node of the passed @param content Node . |
String |
siteTitle(info.magnolia.jcr.util.ContentMap content) |
String |
siteTitle(javax.jcr.Node content)
Return the SiteTitle value.
|
Theme |
theme(Site site) |
info.magnolia.module.site.theme.Theme |
theme(info.magnolia.module.site.Site site) |
javax.jcr.Node |
wrap(javax.jcr.Node content)
FIXME review: should this function be provided by this class?
|
public static final String SITEROOT_TEMPLATE_CATEGORY
protected static final String TITLE_PROP_NAME
protected static final String SITE_TITLE_PROP_NAME
@Inject public STKTemplatingFunctions(info.magnolia.templating.functions.TemplatingFunctions templatingFunctions, CssSelectorBuilder cssSelectorBuilder, info.magnolia.module.categorization.support.CategorizationSupport categorizationSupport, info.magnolia.module.site.SiteManager siteManager, javax.inject.Provider<info.magnolia.module.site.SiteModule> moduleProvider, info.magnolia.dam.templating.functions.DamTemplatingFunctions damTemplatingFunctions)
@Deprecated public STKTemplatingFunctions(info.magnolia.templating.functions.TemplatingFunctions templatingFunctions, CssSelectorBuilder cssSelectorBuilder, info.magnolia.module.categorization.support.CategorizationSupport categorizationSupport, SiteManager siteManager, javax.inject.Provider<STKModule> moduleProvider, info.magnolia.dam.templating.functions.DamTemplatingFunctions damTemplatingFunctions)
STKTemplatingFunctions(TemplatingFunctions, CssSelectorBuilder, info.magnolia.module.categorization.support.CategorizationSupport, info.magnolia.module.site.SiteManager, Provider, DamTemplatingFunctions)
instead.@Deprecated public STKTemplatingFunctions(info.magnolia.templating.functions.TemplatingFunctions templatingFunctions, CssSelectorBuilder cssSelectorBuilder, CategorizationSupport categorizationSupport, SiteManager siteManager, javax.inject.Provider<STKModule> moduleProvider, info.magnolia.dam.templating.functions.DamTemplatingFunctions damTemplatingFunctions)
STKTemplatingFunctions(TemplatingFunctions, CssSelectorBuilder, info.magnolia.module.categorization.support.CategorizationSupport, info.magnolia.module.site.SiteManager, Provider, DamTemplatingFunctions)
instead.public String searchPageLink(javax.jcr.Node content)
content
- Current Content node.public String searchPageLink(info.magnolia.jcr.util.ContentMap content)
public String homeName(javax.jcr.Node content)
public String homeName(info.magnolia.jcr.util.ContentMap content)
public String homeTitle(javax.jcr.Node content)
public String homeTitle(info.magnolia.jcr.util.ContentMap content)
public String siteTitle(javax.jcr.Node content)
public String siteTitle(info.magnolia.jcr.util.ContentMap content)
public String homeLink(javax.jcr.Node content)
public String homeLink(info.magnolia.jcr.util.ContentMap content)
public Site site()
public Site site(javax.jcr.Node content)
Site
of the passed content Node
.public info.magnolia.module.site.theme.Theme theme(info.magnolia.module.site.Site site)
public Site site(info.magnolia.jcr.util.ContentMap content)
Site
of the passed content ContentMap
.public javax.jcr.Node siteRoot(javax.jcr.Node content)
Node
of the @param content Node
.
The root Node
is defined as the page Node
having template
category TemplateCategory.HOME. If no ancestor page exists with category
TemplateCategory.HOME, the JCR workspace root is returned.content
- The Node
to determine its site rootNode
The site root Node
of the passed content Node
public info.magnolia.jcr.util.ContentMap siteRoot(info.magnolia.jcr.util.ContentMap content)
ContentMap
of the @param content ContentMap
. The root ContentMap
is defined as the page Node
having template category TemplateCategory.HOME. If no
ancestor page exists with category TemplateCategory.HOME, the JCR
workspace root is returned.content
- The ContentMap
to determine its site rootContentMap
The site root ContentMap
of the passed @param
contentpublic info.magnolia.jcr.util.ContentMap siteRoot(info.magnolia.jcr.util.ContentMap content, String siteRootTemplateCategory)
Node
of the passed @param content Node
. The root Node
is defined as the page Node
with template its category as @param siteRootTemplateCategory. If no
ancestor page exists with category TemplateCategory.HOME, the JCR
workspace root is returned.content
- The Node
to determine its site rootsiteRootTemplateCategory
- The TemplateCategory
value of the site root to detect.
If null or EMPTY is passed, the default value
SITEROOT_TEMPLATE_CATEGORY is used instead.Node
The site root Node
of the passed content Node
public javax.jcr.Node siteRoot(javax.jcr.Node content, String siteRootTemplateCategory)
Node
of the passed @param content Node
. The root Node
is defined as the page Node
with template its category as @param siteRootTemplateCategory. If no
ancestor page exists with category TemplateCategory.HOME, the JCR
workspace root is returned.content
- The Node
to determine its site rootsiteRootTemplateCategory
- The TemplateCategory
value of the site root to detect.
If null or EMPTY is passed, the default value
SITEROOT_TEMPLATE_CATEGORY is used instead.Node
The site root Node
of the passed content Node
public List<info.magnolia.jcr.util.ContentMap> ancestorsInSite(info.magnolia.jcr.util.ContentMap content) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public List<javax.jcr.Node> ancestorsInSite(javax.jcr.Node content) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public List<info.magnolia.jcr.util.ContentMap> ancestorsInSite(info.magnolia.jcr.util.ContentMap content, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public List<javax.jcr.Node> ancestorsInSite(javax.jcr.Node content, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Deprecated public String getAssetLink(javax.jcr.Node content, String assetProperty)
DamTemplatingFunctions.getAssetLinkForId(String)
@Deprecated public String getAssetLink(info.magnolia.jcr.util.ContentMap content, String assetProperty)
DamTemplatingFunctions.getAssetLinkForId(String)
@Deprecated public String getAssetLink(info.magnolia.jcr.util.ContentMap content, String assetProperty, AbstractSTKTemplateModel<? extends info.magnolia.rendering.template.TemplateDefinition> model)
(String)
@Deprecated public String getAssetLink(info.magnolia.jcr.util.ContentMap content, String assetProperty, String renditionName)
DamTemplatingFunctions.getAssetLinkForId(String, String)
@Deprecated public String getAssetLink(javax.jcr.Node content, String assetProperty, String renditionName)
DamTemplatingFunctions.getAssetLinkForId(String, String)
public String resolveImageVariationName(AbstractSTKTemplateModel<? extends info.magnolia.rendering.template.TemplateDefinition> model)
ImagingSupport.VARIATION_ORIGINAL
.CssSelectorBuilder
,
ImageModel
@Deprecated public info.magnolia.dam.api.AssetRendition getAssetVariation(info.magnolia.dam.api.Asset asset, String renditionName)
DamTemplatingFunctions.getAssetRendition(Asset, String)
public javax.jcr.Node wrap(javax.jcr.Node content)
@Deprecated public List<info.magnolia.jcr.util.ContentMap> getCategories(javax.jcr.Node page)
CategorizationSupport.getCategories(javax.jcr.Node)
by injecting CategorizationSupport
instead.@Deprecated public String getCategoryLink(javax.jcr.Node page, String categoryName)
CategorizationSupport.getCategoryLink(javax.jcr.Node, String)
by injecting CategorizationSupport
instead.public List<javax.jcr.Node> getContentListByTemplateCategorySubCategory(javax.jcr.Node siteRoot, String category, String subCategory) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
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
javax.jcr.RepositoryException
public javax.jcr.Node getNearestContentByTemplateCategorySubCategory(javax.jcr.Node siteRoot, String category, String subCategory, javax.jcr.Node current) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static List<javax.jcr.Node> getContentListByTemplateName(javax.jcr.Node searchRoot, String templateName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static List<javax.jcr.Node> getContentListByTemplateName(javax.jcr.Node searchRoot, String templateName, int maxResultSize, String andClause, String orderByClause) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static List<javax.jcr.Node> getContentListByTemplateNames(javax.jcr.Node searchRoot, Set<String> templateIds, int maxResultSize, String andClause, String orderByClause) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public javax.jcr.Node getReferencedContent(javax.jcr.Node content, String idPropertyName, String referencedWorkspace) throws javax.jcr.RepositoryException
Node
object which is referenced by its id, stored in
the @param propertyName.content
- the node with a property containing the referenced id value.idPropertyName
- The name of the property which contains the id of the
referenced Node
.referencedWorkspace
- The workspace in which the referenced Node
exists.Node
javax.jcr.RepositoryException
public info.magnolia.dam.api.Asset getAsset(javax.jcr.Node node, String assetProperty, String renditionName)
DamTemplatingFunctions.getAssetRenditionForAssetId(String, String)
Get the Asset specified by 'nodeDataPrefix' property name
linked to 'node' for the specified 'rendition'.node
- Content NodeassetProperty
- Property name of the node containing the Asset identifier
(composite key containing a reference of the Asset Provider)renditionName
- Name of the rendition. If not specified, the default rendition
will be applied.public info.magnolia.dam.api.Asset getAsset(javax.jcr.Node content, String assetProperty)
DamTemplatingFunctions.getAsset(String)
public info.magnolia.dam.api.Asset getAsset(info.magnolia.jcr.util.ContentMap content, String assetProperty)
DamTemplatingFunctions.getAsset(String)
public info.magnolia.dam.api.Asset getAsset(info.magnolia.jcr.util.ContentMap content, String nodeDataPrefix, String variationName)
DamTemplatingFunctions.getAssetRenditionForAssetId(String, String)
public List<info.magnolia.dam.api.Asset> getAssetsFromFolder(javax.jcr.Node node, String assetProperty)
DamTemplatingFunctions.getAssetsFromFolderId(String)
@Deprecated public List<info.magnolia.dam.api.Asset> getAssetsByQuery(String statement)
DamTemplatingFunctions.getItems(String, AssetQuery)
public List<javax.jcr.Node> cutList(List<javax.jcr.Node> itemsList, int maxResults)
public int count(String name)
public String metaDataProperty(javax.jcr.Node content, String property)
public String metaDataProperty(info.magnolia.jcr.util.ContentMap content, String property)
public String metaDataTemplate(javax.jcr.Node content)
public String metaDataTemplate(info.magnolia.jcr.util.ContentMap content)
public void setCssSelectorBuilder(CssSelectorBuilder cssSelectorBuilder)
public void setCategorizationSupport(CategorizationSupport categorizationSupport)
public String getImageVariationLinkFromBinary(info.magnolia.jcr.util.ContentMap binaryContent, AbstractSTKTemplateModel<? extends info.magnolia.rendering.template.TemplateDefinition> model)
public String getImageVariationLinkFromBinary(javax.jcr.Node binaryContent, AbstractSTKTemplateModel<? extends info.magnolia.rendering.template.TemplateDefinition> model)
public String getImageVariationLinkFromBinary(info.magnolia.jcr.util.ContentMap binaryContent, String rendition)
public String getImageVariationLinkFromBinary(javax.jcr.Node binaryContent, String rendition)
protected ImagingSupport getImagingSupport()
Copyright © 2008–2015 Magnolia International Ltd.. All rights reserved.