public class JspTemplatingFunction extends Object
Constructor and Description |
---|
JspTemplatingFunction() |
Modifier and Type | Method and Description |
---|---|
static List<ContentMap> |
ancestors(ContentMap contentMap,
String nodeTypeName) |
static ContentMap |
asContentMap(javax.jcr.Node content) |
static List<ContentMap> |
asContentMapList(Collection<javax.jcr.Node> nodeList) |
static javax.jcr.Node |
asJCRNode(ContentMap contentMap) |
static List<javax.jcr.Node> |
asNodeList(Collection<ContentMap> contentMapList) |
static List<ContentMap> |
children(ContentMap content,
String nodeTypeName) |
static javax.jcr.Node |
content(String path,
String repository)
Return the Node for the Given Path
from the given repository.
|
static javax.jcr.Node |
contentByIdentifier(String id,
String repository)
Return the Node for the given identifier
from the given repository.
|
static String |
createHtmlAttribute(String name,
String value)
Util method to create html attributes
name="value" . |
static ContentMap |
decode(ContentMap content)
Removes escaping of HTML on properties.
|
static String |
externalLink(ContentMap content,
String linkPropertyName)
Returns an external link prepended with
http:// in case the protocol is missing or an empty String
if the link does not exist. |
static String |
externalLinkTitle(ContentMap content,
String linkPropertyName,
String linkTitlePropertyName)
Return a link title based on the @param linkTitlePropertyName.
|
static ContentMap |
inherit(ContentMap content,
String relPath) |
static ContentMap |
inherit(ContentMap content,
String relPath,
String nodeTypes,
String nodeInheritance,
String propertyInheritance) |
static List<ContentMap> |
inheritList(ContentMap content,
String relPath) |
static javax.jcr.Property |
inheritProperty(ContentMap content,
String relPath) |
static boolean |
isAuthorInstance() |
static boolean |
isEditMode() |
static boolean |
isFromCurrentPage(ContentMap content) |
static boolean |
isInherited(ContentMap content) |
static boolean |
isPreviewMode() |
static boolean |
isPublicInstance() |
static String |
language()
Get the language used currently.
|
static String |
link(ContentMap contentMap) |
static String |
link(ContentMap contentMap,
String propertyName) |
static String |
linkForProperty(javax.jcr.Property property)
FIXME Add a LinkUtil.createLink(Property property)....
|
static String |
linkForWorkspace(String workspace,
String nodeIdentifier)
Create link for the Node identified by nodeIdentifier in the specified workspace.
|
static String |
metaData(ContentMap content,
String property)
Returns the string representation of a property from the metaData of the node or
null if the node has no Magnolia metaData or if no matching property is found. |
static ContentMap |
page(ContentMap content)
Returns the page's
ContentMap of the passed ContentMap . |
static ContentMap |
parent(ContentMap contentMap,
String nodeTypeName) |
static ContentMap |
root(ContentMap contentMap,
String nodeTypeName) |
static Collection<javax.jcr.Node> |
search(String workspace,
String statement,
String language,
String returnItemType) |
static SiblingsHelper |
siblings(ContentMap node)
Returns an instance of SiblingsHelper for the given contentMap.
|
static Collection<javax.jcr.Node> |
simpleSearch(String workspace,
String statement,
String returnItemType,
String startPath) |
public static javax.jcr.Node asJCRNode(ContentMap contentMap)
public static ContentMap asContentMap(javax.jcr.Node content)
public static List<ContentMap> children(ContentMap content, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static ContentMap root(ContentMap contentMap, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static ContentMap parent(ContentMap contentMap, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static ContentMap page(ContentMap content) throws javax.jcr.RepositoryException
ContentMap
of the passed ContentMap
. If the passed ContentMap
represents a page, the passed ContentMap
will be returned.
If the passed ContentMap
has no parent page at all, null is returned.content
- the ContentMap
to get the page's ContentMap
from.ContentMap
of the passed content ContentMap
.javax.jcr.RepositoryException
public static List<ContentMap> ancestors(ContentMap contentMap, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static ContentMap inherit(ContentMap content, String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static ContentMap inherit(ContentMap content, String relPath, String nodeTypes, String nodeInheritance, String propertyInheritance) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static javax.jcr.Property inheritProperty(ContentMap content, String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static List<ContentMap> inheritList(ContentMap content, String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static boolean isInherited(ContentMap content)
public static boolean isFromCurrentPage(ContentMap content)
public static String linkForWorkspace(String workspace, String nodeIdentifier)
public static String linkForProperty(javax.jcr.Property property)
public static String link(ContentMap contentMap) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static String link(ContentMap contentMap, String propertyName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static String language()
public static String externalLink(ContentMap content, String linkPropertyName)
http://
in case the protocol is missing or an empty String
if the link does not exist.content
- The node's map representation where the link property is stored on.linkPropertyName
- The property where the link value is stored in.http://
public static String externalLinkTitle(ContentMap content, String linkPropertyName, String linkTitlePropertyName)
http://
).content
- The node where the link property is stored on.linkPropertyName
- The property where the link value is stored in.linkTitlePropertyName
- The property where the link title value is storedpublic static boolean isEditMode()
public static boolean isPreviewMode()
public static boolean isAuthorInstance()
public static boolean isPublicInstance()
public static String createHtmlAttribute(String name, String value)
name="value"
. If the value is empty an empty string will be returned.
This is mainly helpful to avoid empty attributes.public static SiblingsHelper siblings(ContentMap node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static javax.jcr.Node content(String path, String repository)
public static javax.jcr.Node contentByIdentifier(String id, String repository)
public static List<ContentMap> asContentMapList(Collection<javax.jcr.Node> nodeList)
public static List<javax.jcr.Node> asNodeList(Collection<ContentMap> contentMapList)
public static ContentMap decode(ContentMap content)
public static String metaData(ContentMap content, String property)
null
if the node has no Magnolia metaData or if no matching property is found.public static Collection<javax.jcr.Node> search(String workspace, String statement, String language, String returnItemType)
public static Collection<javax.jcr.Node> simpleSearch(String workspace, String statement, String returnItemType, String startPath)
Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.