|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.templating.jsp.cmsfn.JspTemplatingFunction
public class JspTemplatingFunction
Static wrapper of the Templating function class. This wrapper gives us the ability to expose these functions as Tags in the JSP's.
Constructor Summary | |
---|---|
JspTemplatingFunction()
|
Method Summary | |
---|---|
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 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 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 |
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 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 SiblingsHelper |
siblings(ContentMap node)
Returns an instance of SiblingsHelper for the given contentMap. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JspTemplatingFunction()
Method Detail |
---|
@Function public static javax.jcr.Node asJCRNode(ContentMap contentMap)
@Function public static ContentMap asContentMap(javax.jcr.Node content)
@Function public static List<ContentMap> children(ContentMap content, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function public static ContentMap root(ContentMap contentMap, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function public static ContentMap parent(ContentMap contentMap, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function 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
@Function public static List<ContentMap> ancestors(ContentMap contentMap, String nodeTypeName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function public static ContentMap inherit(ContentMap content, String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function public static javax.jcr.Property inheritProperty(ContentMap content, String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function public static List<ContentMap> inheritList(ContentMap content, String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function public static boolean isInherited(ContentMap content)
@Function public static boolean isFromCurrentPage(ContentMap content)
@Function public static String linkForWorkspace(String workspace, String nodeIdentifier)
@Function public static String linkForProperty(javax.jcr.Property property)
@Function public static String link(ContentMap contentMap) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function public static String language()
@Function 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://
@Function 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 stored
@Function public static boolean isEditMode()
@Function public static boolean isPreviewMode()
@Function public static boolean isAuthorInstance()
@Function public static boolean isPublicInstance()
@Function 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.
@Function public static SiblingsHelper siblings(ContentMap node) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
@Function public static javax.jcr.Node content(String path, String repository)
@Function public static List<ContentMap> asContentMapList(Collection<javax.jcr.Node> nodeList)
@Function public static List<javax.jcr.Node> asNodeList(Collection<ContentMap> contentMapList)
@Function public static ContentMap decode(ContentMap content)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |