/** * This file is auto generated from JavaDoc. Do not modify it manually. */ import type { Node } from "../../types/javax/jcr/Node"; import type { String } from "../../types/java/lang/String"; import type { Binary } from "../../types/javax/jcr/Binary"; import type { Calendar } from "../../types/java/util/Calendar"; import type { List } from "../../types/java/util/List"; /** * Utility interface for getting Node property values. * *
* An instance of the Sitevision class implementing this interface can be obtained via
* {@link senselogic.sitevision.api.Utils#getPropertyUtil()}.
* See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the Utils interface.
*
* The advantage of using these methods instead of explicitly use the "get property" methods as defined in JCR is that none of the * methods defined here throw Exceptions. (Exception handling can of course be handled properly if you implements your own JSR 286 * portlet in Java, but when rendering in Velocity you can't catch Exceptions.) *
* ---------------------------------------------------------Node have a
* boolean property called "isInUse"* 1. The JCR way: *
*
* a) This can return true, false or throw an Exception:
*
* #if ($aNode.getProperty('isInUse').boolean)
* ...
* #end
*
* b) Even if you ensure there actually are a property called "isInUse" it can still throw an Exception if the property isn't a
* boolean:
*
* #if ($aNode.hasProperty('isInUse') && $aNode.getProperty('isInUse').boolean)
* ...
* #end
*
* c) Your best possible effort to avoid Exceptions is to ensure that there are a property and that it actually is of boolean
* type before you check its value:
* (Note! Property types are defined in javax.jcr.PropertyType and the BOOLEAN type is represented by the
* int value 6):
*
* #if ($aNode.hasProperty('isInUse') && $aNode.getProperty('isInUse').type == 6 && $aNode.getProperty('isInUse').boolean)
* ...
* #end
*
* The drawback with this alternative is that you miss boolean properties that isn't registered as the
* BOOLEAN type (e.g. a String property with the value "true" or "false")
*
* 2. The PropertyUtil way: *
*
* This always returns true or false:
*
* #set ($propertyUtil = $sitevisionUtils.propertyUtil)
* ...
* #if ($propertyUtil.getBoolean($aNode, 'isInUse')
* ...
* #end
*
* --------------------------------------------------------- int value and a int
* property "myNumber".#set statement)* 1. The JCR way: *
*
* This can't be achieved in Velocity! You can only fetch the value as a long ($aNode.getProperty('myNumber').long)
* but Velocity needs an int or an Integer to perform addition.
*
* 2. The PropertyUtil way: *
*
* This will work in Velocity (i.e. use PropertyUtil to get the int):
*
* #set ($propertyUtil = $sitevisionUtils.propertyUtil)
* ...
* #set ($result = $propertyUtil.getInt($aNode, 'myNumber') + 45)
* ---------------------------------------------------------
* Since the property name "anIllegal[./]name" contains illegal characters it must be escaped.
* To do this you typically use the {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String) escapeJcrName(String)}
* method in {@link senselogic.sitevision.api.text.EndecUtil}.
* Note that the property name "aLegalName" is not escaped since it doesn't contain any illegal characters.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
*
* #set ($propertyUtil = $sitevisionUtils.propertyUtil)
* #set ($endecUtil = $sitevisionUtils.endecUtil)
* ...
* #set ($escapedName = $endecUtil.escapeJcrName('anIllegal[./]name'))
* #set ($firstValue = $propertyUtil.getInt($aNode, $escapedName)
*
* #set ($secondValue = $propertyUtil.getInt($aNode, 'aLegalName')
*
* @author Magnus Lövgren
*/
export interface PropertyUtil {
/**
* Gets a String property from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node has a
* String property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @return the value for aPropertyName as String. If no property exists, null is returned.
* @see #getNestedStringEscaped(javax.jcr.Node, String, String)
*/
getNestedString(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): string;
/**
* Gets a String property from a "nested" Node's property and returns it XML escaped.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node has a
* String property).
*
* * This is a convenience method for getting a "nested" String property that also should be XML escaped. A String that should be included * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems. *
** This Velocity code: *
*
* #set ($endecUtil = ...)
* #set ($propertyUtil = ...)
* ...
* <p>
* $endecUtil.escapeXML($propertyUtil.getNestedString($myNode, 'aNodeProperty', 'aProperty'))
* </p>
*
* would typically be replaced with this:
*
* #set ($propertyUtil = ...)
* ...
* <p>
* $!propertyUtil.getNestedStringEscaped($myNode, 'aNodeProperty', 'aProperty')
* </p>
*
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @return the value for aPropertyName as an XML escaped String. If no property exists, null is returned.
* @see #getNestedString(javax.jcr.Node, String, String)
* @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
* @since Sitevision 3.5
*/
getNestedStringEscaped(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): string;
/**
* Gets a String property from a "nested" Node's property with a fallback value if the property doesn't exist.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node has a
* String property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as String. If no property exists, aDefaultValue is returned.
* @see #getNestedStringEscaped(javax.jcr.Node, String, String, String)
*/
getNestedString(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: String | string
): string;
/**
* Gets a String property from a "nested" Node's property with a fallback value if the property doesn't exist, and returns it XML escaped.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a String property).
*
* * This is a convenience method for getting a "nested" String property that also should be XML escaped. A String that should be included * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems. *
** This Velocity code: *
*
* #set ($endecUtil = ...)
* #set ($propertyUtil = ...)
* ...
* <p>
* $endecUtil.escapeXML($propertyUtil.getNestedString($myNode, 'aNodeProperty', 'aProperty', 'a default value'))
* </p>
*
* would typically be replaced with this:
*
* #set ($propertyUtil = ...)
* ...
* <p>
* $propertyUtil.getNestedStringEscaped($myNode, 'aNodeProperty', 'aProperty', 'a default value')
* </p>
*
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @param aDefaultValue a (non XML escaped) fallback value if no value exists
* @return the value for aPropertyName as an XML escaped String. If no property exists, aDefaultValue is XML escaped and returned.
* @see #getNestedString(javax.jcr.Node, String, String, String)
* @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
* @since Sitevision 3.5
*/
getNestedStringEscaped(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: String | string
): string;
/**
* Gets an int property from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has an int/Integer property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @return the value for aPropertyName as int. If no property exists or it isn't compatible with an int, 0 is returned.
*/
getNestedInt(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): number;
/**
* Gets an int property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible with the int type.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has an int/Integer property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as int. If no property exists or it isn't compatible with an int,
aDefaultValue is returned.
*/
getNestedInt(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: number
): number;
/**
* Gets a double property from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a double/Double property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @return the value for aPropertyName as double. If no property exists or it isn't compatible with a double,
0.0 is returned.
* @since Sitevision 2.6.1_09
*/
getNestedDouble(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): number;
/**
* Gets a double property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible
* with the double type.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a double/Double property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as double. If no property exists or it isn't compatible with a double,
aDefaultValue is returned.
* @since Sitevision 2.6.1_09
*/
getNestedDouble(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: number
): number;
/**
* Gets a boolean property from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a Boolean property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @return the value for aPropertyName as boolean. If no property exists or it isn't compatible with a boolean,
false is returned.
*/
getNestedBoolean(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): boolean;
/**
* Gets a boolean property from a "nested" Node's property with a fallback value if the property doesn't exist or is incompatible
* with the boolean type.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a Boolean property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as boolean. If no property exists or it isn't compatible with a boolean,
aDefaultValue is returned.
*/
getNestedBoolean(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: boolean
): boolean;
/**
* Gets a Node property from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a Node property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @return the value for aPropertyName as Node. If no property exists or it isn't a Node, null is returned.
*/
getNestedNode(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): Node;
/**
* Gets a Node property from a "nested" Node's property with a fallback value if the property doesn't exist.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a Node property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as Node. If no property exists or it isn't a Node, aDefaultValue is returned.
*/
getNestedNode(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: Node
): Node;
/**
* Gets a Binary property from a Node.
*
*
* Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
* you must also close the stream when you are done.
*
* Note! The Binary support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the value for aPropertyName as Binary. If no property exists, null is returned.
* @since Sitevision 3.5
*/
getBinary(aNode: Node, aPropertyName: String | string): Binary;
/**
* Gets a Binary property from a node with a fallback value if the property doesn't exist.
*
*
* Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
* you must also close the stream when you are done.
*
* Note! The Binary support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as Binary. If no property exists, aDefaultValue is returned.
* @since Sitevision 3.5
*/
getBinary(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: Binary
): Binary;
/**
* Gets a Binary property from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a Binary property).
*
*
* Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
* you must also close the stream when you are done.
*
* Note! The Binary support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the Binary property for the "inner/nested" Node
* @return the value for aPropertyName as Binary. If no property exists or it isn't a Binary,
null is returned.
* @since Sitevision 3.5
*/
getNestedBinary(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): Binary;
/**
* Gets a Binary property from a "nested" Node's property with a fallback value if the property doesn't exist.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a Binary property).
*
*
* Ensure to always handle resources appropriately when working with Binary! If you get a stream via {@link javax.jcr.Binary#getStream()},
* you must also close the stream when you are done.
*
* Note! The Binary support is limited, see {@link javax.jcr.Property#getBinary()} for more information!
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the Binary property for the "inner/nested" Node
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as Binary. If no property exists or it isn't a Binary, aDefaultValue is returned.
* @since Sitevision 3.5
*/
getNestedBinary(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: Binary
): Binary;
/**
* Gets a String property from a Node.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the value for aPropertyName as String. If no property exists, null is returned.
* @see #getStringEscaped(javax.jcr.Node, String)
*/
getString(aNode: Node, aPropertyName: String | string): string;
/**
* Gets a String property from a Node and returns it XML escaped.
*
* * This is a convenience method for getting a String property that also should be XML escaped. A String that should be included * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems. *
** This Velocity code: *
*
* #set ($endecUtil = ...)
* #set ($propertyUtil = ...)
* ...
* <p>
* $endecUtil.escapeXML($propertyUtil.getString($myNode, 'aProperty'))
* </p>
*
* would typically be replaced with this:
*
* #set ($propertyUtil = ...)
* ...
* <p>
* $!propertyUtil.getStringEscaped($myNode, 'aProperty')
* </p>
*
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the value for aPropertyName as an XML escaped String. If no property exists, null is returned.
* @see #getString(javax.jcr.Node, String)
* @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
* @since Sitevision 3.5
*/
getStringEscaped(aNode: Node, aPropertyName: String | string): string;
/**
* Gets a String property from a node with a fallback value if the property doesn't exist.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as String. If no property exists, aDefaultValue is returned.
* @see #getStringEscaped(javax.jcr.Node, String, String)
*/
getString(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: String | string
): string;
/**
* Gets a String property from a Node, with a fallback value, and returns it XML escaped.
*
* * This is a convenience method for getting a String property that also should be XML escaped. A String that should be included * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems. *
** This Velocity code: *
*
* #set ($endecUtil = ...)
* #set ($propertyUtil = ...)
* ...
* <p>
* $endecUtil.escapeXML($propertyUtil.getString($myNode, 'aProperty', 'a default value'))
* </p>
*
* would typically be replaced with this:
*
* #set ($propertyUtil = ...)
* ...
* <p>
* $propertyUtil.getStringEscaped($myNode, 'aProperty', 'a default value')
* </p>
*
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @param aDefaultValue a (non XML escaped) fallback value if no value exists
* @return the value for aPropertyName as an XML escaped String. If no property exists, aDefaultValue is XML escaped and returned.
* @see #getString(javax.jcr.Node, String, String)
* @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
* @since Sitevision 3.5
*/
getStringEscaped(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: String | string
): string;
/**
* Gets an int property from a Node.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the int value for aPropertyName. If no property exists or it isn't compatible with an int, 0 is returned.
*/
getInt(aNode: Node, aPropertyName: String | string): number;
/**
* Gets an int property from a node with a fallback value if the property doesn't exist or is incompatible with the int type.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @param aDefaultValue fallback value if no value exists
* @return the int value for aPropertyName. If no property exists or it isn't compatible with an int,
aDefaultValue is returned.
*/
getInt(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: number
): number;
/**
* Gets a double property from a Node.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the double value for aPropertyName. If no property exists or it isn't compatible with a double,
0.0 is returned.
* @since Sitevision 2.6.1_09
*/
getDouble(aNode: Node, aPropertyName: String | string): number;
/**
* Gets a double property from a node with a fallback value if the property doesn't exist or is incompatible with the double type.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @param aDefaultValue fallback value if no value exists
* @return the double value for aPropertyName. If no property exists or it isn't compatible with a double,
aDefaultValue is returned.
* @since Sitevision 2.6.1_09
*/
getDouble(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: number
): number;
/**
* Gets a boolean property from a Node.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the value for aPropertyName as boolean. If no property exists or it isn't compatible with a boolean,
false is returned.
*/
getBoolean(aNode: Node, aPropertyName: String | string): boolean;
/**
* Gets a boolean property from a Node with a fallback value if the property doesn't exist or is incompatible with the boolean type.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as boolean. If no property exists or it isn't compatible with a boolean,
aDefaultValue is returned.
*/
getBoolean(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: boolean
): boolean;
/**
* Gets a Node property from a Node.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the value for aPropertyName as Node. If no property exists or it isn't a Node, null is returned.
*/
getNode(aNode: Node, aPropertyName: String | string): Node;
/**
* Gets a Node property from a Node if an enabling property allows it.
*
*
* In some Sitevision portlet configs there are a "boolean" property that enables a "Node" property and the "Node" might be null.
* This is a convenience method for such cases. In Velocity, code like this:
*
* #set ($startPage = ...) ## Ensure start page value...
* #if ($propertyUtil.getBoolean($portlet, 'useCustomStartPage'))
* #set ($customStartPage = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customStartPage')}))
* #if ($customStartPage)
* #set ($startPage = $customStartPage)
* #end
* #end
*
* would typically be replaced with this:
*
* #set ($startPage = $scriptUtil.getNonNull(${propertyUtil.getEnabledNode($portlet, 'useCustomStartPage', 'customStartPage')}))
* #if (!$startPage)
* #set ($startPage = ...) ## Set default start page value if no custom start page was set...
* #end
*
*
*
* Note! This method does not escape names
* (i.e. aEnablingPropertyName and aNodePropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has the properties
* @param aEnablingPropertyName the name of the boolean property that enables the Node denoted by aPropertyName
* @param aNodePropertyName the name of the property
* @return the value for aNodePropertyName as Node. If no property exists or it isn't a Node,
null is returned.
A Node will never be returned if aEnablingPropertyName doesn't exist, isn't compatible with a
boolean or isn't true.
* @see #getEnabledNode(javax.jcr.Node, String, String, javax.jcr.Node)
* @since Sitevision 3.0
*/
getEnabledNode(
aNode: Node,
aEnablingPropertyName: String | string,
aNodePropertyName: String | string
): Node;
/**
* Gets a Node property from a Node if an enabling property allows it, with a fallback Node value.
*
*
* Note! This method does not escape names
* (i.e. aEnablingPropertyName and aNodePropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has the properties
* @param aEnablingPropertyName the name of the boolean property that enables the Node denoted by aPropertyName
* @param aNodePropertyName the name of the property
* @param aDefaultValue fallback value if no value exists
* @return the value for aNodePropertyName as Node. If no property exists or it isn't a Node,
aDefaultValue is returned.
If aEnablingPropertyName doesn't exist, isn't compatible with a boolean or isn't true,
aDefaultValue is returned.
* @see #getEnabledNode(javax.jcr.Node, String, String)
* @since Sitevision 3.0
*/
getEnabledNode(
aNode: Node,
aEnablingPropertyName: String | string,
aNodePropertyName: String | string,
aDefaultValue: Node
): Node;
/**
* Gets a String property from a Node if an enabling boolean property allows it.
*
*
* In some Sitevision portlet configs there are a "boolean" property that enables a "String" property and the "String" might
* be null. This is a convenience method for such cases. In Velocity, code like this:
*
* #set ($name = ...) ## Set default name...
* #if ($propertyUtil.getBoolean($portlet, 'useCustomName'))
* #set ($customName = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customName')}))
* #if ($customName)
* #set ($name = $customName)
* #end
* #end
*
* would typically be replaced with this:
*
* #set ($name = $scriptUtil.getNonNull(${propertyUtil.getEnabledString($portlet, 'useCustomName', 'customName')}))
* #if (!$name)
* #set ($name = ...) ## Set default name if no custom name was set...
* #end
*
*
*
* Note! This method does not escape names
* (i.e. aEnablingPropertyName and aStringPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has the properties
* @param aEnablingPropertyName the name of the boolean property that enables the String denoted by aStringPropertyName
* @param aStringPropertyName the name of the String property
* @return the value for aStringPropertyName as String. If no property exists, null is returned.
Null will always be returned if aEnablingPropertyName doesn't exist, isn't compatible with a boolean
or isn't true.
* @see #getEnabledString(javax.jcr.Node, String, String, String)
* @since Sitevision 4.0
*/
getEnabledString(
aNode: Node,
aEnablingPropertyName: String | string,
aStringPropertyName: String | string
): string;
/**
* Gets a String property from a Node if an enabling boolean property allows it, with a fallback value.
*
*
* Note! This method does not escape names
* (i.e. aEnablingPropertyName and aStringPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has the properties
* @param aEnablingPropertyName the name of the boolean property that enables the String denoted by aStringPropertyName
* @param aStringPropertyName the name of the String property
* @param aDefaultValue fallback value to return if no value exist
* @return the value for aStringPropertyName as String. If no property exists, aDefaultValue is returned.
aDefaultValue will always be returned if aEnablingPropertyName doesn't exist, isn't compatible with a
boolean or isn't true.
* @see #getEnabledString(javax.jcr.Node, String, String)
* @since Sitevision 4.0
*/
getEnabledString(
aNode: Node,
aEnablingPropertyName: String | string,
aStringPropertyName: String | string,
aDefaultValue: String | string
): string;
/**
* Gets a String property from a Node if an enabling boolean property allows it, and returns it XML escaped.
*
*
* In some Sitevision portlet configs there are a "boolean" property that enables a "String" property and the "String"
* might be null. This is a convenience method for such cases where you want the value XML escaped. In Velocity, code like this:
*
* #set ($endecUtil = ...)
* #set ($escapedName = ...) ## Set default escaped name...
* #if ($propertyUtil.getBoolean($portlet, 'useCustomName'))
* #set ($customName = $scriptUtil.getNonNull(${propertyUtil.getNode($portlet, 'customName')}))
* #if ($customName)
* #set ($escapedName = $endecUtil.escapeXML($customName))
* #end
* #end
*
* would typically be replaced with this:
*
* #set ($escapedName = $scriptUtil.getNonNull(${propertyUtil.getEnabledStringEscaped($portlet, 'useCustomName', 'customName')}))
* #if (!$escapedName)
* #set ($escapedName = ...) ## Set default escaped name if no custom name was set...
* #end
*
*
*
* Note! This method does not escape names
* (i.e. aEnablingPropertyName and aStringPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has the properties
* @param aEnablingPropertyName the name of the boolean property that enables the String denoted by aStringPropertyName
* @param aStringPropertyName the name of the String property
* @return the value for aStringPropertyName as a XML escaped String. If no property exists, null is returned.
Null will always be returned if aEnablingPropertyName doesn't exist, isn't compatible with a boolean
or isn't true.
* @see #getEnabledStringEscaped(javax.jcr.Node, String, String, String)
* @since Sitevision 4.0
*/
getEnabledStringEscaped(
aNode: Node,
aEnablingPropertyName: String | string,
aStringPropertyName: String | string
): string;
/**
* Gets a String property from a Node if an enabling boolean property allows it, and returns it XML escaped with a fallback value.
*
*
* Note! This method does not escape names
* (i.e. aEnablingPropertyName and aStringPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has the properties
* @param aEnablingPropertyName the name of the boolean property that enables the String denoted by aStringPropertyName
* @param aStringPropertyName the name of the String property
* @param aDefaultValue the (non XML escaped) fallback value to return if no value exist
* @return the value for aStringPropertyName as a XML escaped String. If no property exists, aDefaultValue is
XML escaped and returned.
aDefaultValue will always be XML escaped and returned if aEnablingPropertyName doesn't exist,
isn't compatible with a boolean or isn't true.
* @see #getEnabledStringEscaped(javax.jcr.Node, String, String)
* @since Sitevision 4.0
*/
getEnabledStringEscaped(
aNode: Node,
aEnablingPropertyName: String | string,
aStringPropertyName: String | string,
aDefaultValue: String | string
): string;
/**
* Gets a Calendar property from a Node.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the value for aPropertyName as Calendar. If no property exists or it isn't a Calendar,
null is returned.
* @since Sitevision 2.6.1_02
*/
getCalendar(aNode: Node, aPropertyName: String | string): Calendar;
/**
* Gets a Calendar property from a Node with a fallback value if the property doesn't exist or is incompatible with the Calendar type.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as Calendar. If no property exists or it isn't compatible with a Calendar,
aDefaultValue is returned.
* @since Sitevision 2.6.1_02
*/
getCalendar(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: Calendar
): Calendar;
/**
* Gets a Calendar property from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a Calendar/Date property).
*
* Note! The name of this method might seem awkward since a Calendar is returned, but this is to resemble the pattern of a
* javax.jcr.Node that has the method getDate() that returns a Calendar.
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the Calendar property for the "inner/nested" Node
* @return the value for aPropertyName as Calendar. If no property exists or it isn't a Calendar,
null is returned.
* @since Sitevision 2.6.1_02
*/
getNestedCalendar(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): Calendar;
/**
* Gets a Calendar property from a "nested" Node's property with a fallback value if the property doesn't exist.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a Calendar/Date property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the Calendar property for the "inner/nested" Node
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as Calendar. If no property exists or it isn't a Calendar,
aDefaultValue is returned.
* @since Sitevision 2.6.1_02
*/
getNestedCalendar(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: Calendar
): Calendar;
/**
* Gets a Node property from a Node with a fallback value if the property doesn't exist.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @param aDefaultValue fallback value if no value exists
* @return the value for aPropertyName as Node. If no property exists or it isn't a Node, aDefaultValue is returned.
*/
getNode(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: Node
): Node;
/**
* Gets a List of property values from a Node.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the string value(s) for aPropertyName as a List. If no property exists, null is returned.
* @see #getStringsEscaped(javax.jcr.Node, String)
* @since Sitevision 2.6_06
*/
getStrings(aNode: Node, aPropertyName: String | string): List;
/**
* Gets a List of XML escaped property values from a Node.
*
* * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems. *
** This Velocity code: *
*
* #set ($endecUtil = ...)
* #set ($propertyUtil = ...)
* ...
* #set ($valueList = $propertyUtil.getStrings($myNode, 'aProperty'))
* <ul>
* #foreach ($value in $valueList)
* <li>
* $endecUtil.escapeXML($value)
* </li>
* #end
* </ul>
*
* would typically be replaced with this:
*
* #set ($propertyUtil = ...)
* ...
* #set ($escapedValueList = $propertyUtil.getStringsEscaped($myNode, 'aProperty'))
* <ul>
* #foreach ($escapedValue in $escapedValueList)
* <li>
* $escapedValue
* </li>
* #end
* </ul>
*
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the string value(s) for aPropertyName, XML escaped and embedded in a List.
If no property exists, null is returned.
* @see #getString(javax.jcr.Node, String)
* @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
* @since Sitevision 3.5
*/
getStringsEscaped(aNode: Node, aPropertyName: String | string): List;
/**
* Gets a List of property values from a Node with a fallback value if the property doesn't exist.
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the string value(s) for aPropertyName as a List. If no property exists, aDefaultValue is returned.
* @param aDefaultValue fallback value if no value exists
* @see #getStringsEscaped(javax.jcr.Node, String, java.util.List)
* @since Sitevision 3.0
*/
getStrings(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: List | unknown[]
): List;
/**
* Gets a List of XML escaped property values from a Node with a fallback value if the property doesn't exist.
*
* * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems. *
** This Velocity code: *
*
* #set ($endecUtil = ...)
* #set ($propertyUtil = ...)
* #set ($myDefaultList = ...)
* ...
* #set ($valueList = $propertyUtil.getStrings($myNode, 'aProperty', $myDefaultList))
* <ul>
* #foreach ($value in $valueList)
* <li>
* $endecUtil.escapeXML($value)
* </li>
* #end
* </ul>
*
* would typically be replaced with this:
*
* #set ($propertyUtil = ...)
* #set ($myDefaultList = ...)
* ...
* #set ($escapedValueList = $propertyUtil.getStringsEscaped($myNode, 'aProperty', $myDefaultList))
* <ul>
* #foreach ($escapedValue in $escapedValueList)
* <li>
* $escapedValue
* </li>
* #end
* </ul>
*
*
*
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property
* @param aPropertyName the name of the property
* @return the string value(s) for aPropertyName, XML escaped and embedded in a List.
If no property exists, aDefaultValue is returned.
* @param aDefaultValue fallback list if no value exists. Note! The actual fallback list is never returned
but it's values might be used. If the fallback list are about to be returned, a copy of it will be created and
all values from the fallback list will be XML escaped and added to the new list before it is returned.
* @see #getString(javax.jcr.Node, String, String)
* @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
* @since Sitevision 3.5
*/
getStringsEscaped(
aNode: Node,
aPropertyName: String | string,
aDefaultValue: List | unknown[]
): List;
/**
* Gets a List of property values from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a String property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @return the string value(s) for aPropertyName as a List. If no property exists, null is returned.
* @since Sitevision 2.6_06
*/
getNestedStrings(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): List;
/**
* Gets a List of XML escaped property values from a "nested" Node's property.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a String property).
*
* * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems. *
** This Velocity code: *
*
* #set ($endecUtil = ...)
* #set ($propertyUtil = ...)
* ...
* #set ($valueList = $propertyUtil.getNestedStrings($myNode, 'aNodeProperty', 'aProperty'))
* <ul>
* #foreach ($value in $valueList)
* <li>
* $endecUtil.escapeXML($value)
* </li>
* #end
* </ul>
*
* would typically be replaced with this:
*
* #set ($propertyUtil = ...)
* ...
* #set ($escapedValueList = $propertyUtil.getNestedStringsEscaped($myNode, 'aNodeProperty', 'aProperty'))
* <ul>
* #foreach ($escapedValue in $escapedValueList)
* <li>
* $escapedValue
* </li>
* #end
* </ul>
*
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @return the string value(s) for aPropertyName as a List. If no property exists, null is returned.
* @see #getNestedStrings(javax.jcr.Node, String, String)
* @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
* @since Sitevision 3.5
*/
getNestedStringsEscaped(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string
): List;
/**
* Gets a List of property values from a "nested" Node's property with a fallback value if the property doesn't exist.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a String property).
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @param aDefaultValue fallback value if no value exists
* @return the string value(s) for aPropertyName as a List. If no property exists, aDefaultValue is returned.
* @since Sitevision 3.0
*/
getNestedStrings(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: List | unknown[]
): List;
/**
* Gets a List of property values from a "nested" Node's property with a fallback value if the property doesn't exist,
* and returns it XML escaped.
* (i.e. the base Node has a property that is a Node, and that "inner/nested" Node
* has a String property).
*
* * This is a convenience method for getting a list of property values that also should be XML escaped. Strings that should be included * in the html output should typically always be XML escaped to be valid XHTML and avoid XSS problems. *
** This Velocity code: *
*
* #set ($endecUtil = ...)
* #set ($propertyUtil = ...)
* #set ($myDefaultList = ...)
* ...
* #set ($valueList = $propertyUtil.getNestedStrings($myNode, 'aNodeProperty', 'aProperty', $myDefaultList))
* <ul>
* #foreach ($value in $valueList)
* <li>
* $endecUtil.escapeXML($value)
* </li>
* #end
* </ul>
*
* would typically be replaced with this:
*
* #set ($propertyUtil = ...)
* #set ($myDefaultList = ...)
* ...
* #set ($escapedValueList = $propertyUtil.getNestedStringsEscaped($myNode, 'aNodeProperty', 'aProperty', $myDefaultList))
* <ul>
* #foreach ($escapedValue in $escapedValueList)
* <li>
* $escapedValue
* </li>
* #end
* </ul>
*
*
*
* Note! This method does not escape names (i.e. aNodePropertyName and aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*
Node that has a property that is a Node
* @param aNodePropertyName the name of the "inner/nested" Node that is a property on aNode
* @param aPropertyName the name of the property for the "inner/nested" Node
* @param aDefaultValue fallback list if no value exists. Note! The actual fallback list is never returned,
but it's values might be used.
If the fallback list are about to be returned, a copy of it will be created and all values from the fallback list will
be XML escaped and added to the new list before it is returned.
* @return the string value(s) for aPropertyName as a List. If no property exists, aDefaultValue
is XML escaped and returned.
* @see #getNestedStrings(javax.jcr.Node, String, String, java.util.List)
* @see senselogic.sitevision.api.text.EndecUtil#escapeXML(String)
* @since Sitevision 3.5
*/
getNestedStringsEscaped(
aNode: Node,
aNodePropertyName: String | string,
aPropertyName: String | string,
aDefaultValue: List | unknown[]
): List;
/**
* Whether a Node has a property or not.
*
* * This is a lenient method for checking if a property exists on a Node without having to catch a potential exception from JCR. * This method is typically more efficient than its JCR counterpart {@link javax.jcr.Node#hasProperty(String)} method. *
* *
* Note! This method does not escape the property name (i.e. aPropertyName).
* Illegal characters in node names and property names must always be escaped, typically via
* {@link senselogic.sitevision.api.text.EndecUtil#escapeJcrName(String)}.
* For best performance - never escape a name if you are certain that it doesn't contain any illegal characters.
* Sitevision model properties never contain illegal characters. Though, depending on configuration "dynamic" ones
* (e.g. metadata properties) might contain illegal characters.
*