|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.util.NodeDataUtil
public class NodeDataUtil
Util to work with NodeData
.
Constructor Summary | |
---|---|
NodeDataUtil()
|
Method Summary | |
---|---|
static javax.jcr.Value |
createValue(Object obj,
javax.jcr.ValueFactory valueFactory)
|
static javax.jcr.Value |
createValue(String valueStr,
int type)
Uses the default value factory. |
static javax.jcr.Value |
createValue(String valueStr,
int type,
javax.jcr.ValueFactory valueFactory)
Transforms a string to a jcr value object. |
static boolean |
getBoolean(Content node,
String name,
boolean defaultValue)
|
static Calendar |
getDate(Content node,
String name,
Calendar defaultValue)
|
static String |
getDateFormat()
|
static String |
getI18NString(Content node,
String str)
Uses the i18n mechanism to translate the message if the resulting string is a key. |
static String |
getI18NString(Content node,
String str,
String basename)
Uses the i18n mechanism to translate the message if the resulting string is a key. |
static int |
getJCRPropertyType(Object obj)
|
static long |
getLong(Content node,
String name,
long defaultValue)
|
static NodeData |
getOrCreate(Content node,
String name)
If the NodeData does not exist yet, just create it. |
static NodeData |
getOrCreate(Content node,
String name,
int type)
If the NodeData does not exist yet, just create it. |
static NodeData |
getOrCreate(Content node,
String name,
Object obj)
|
static NodeData |
getOrCreateAndSet(Content node,
String name,
boolean value)
|
static NodeData |
getOrCreateAndSet(Content node,
String name,
int value)
|
static NodeData |
getOrCreateAndSet(Content node,
String name,
long value)
|
static NodeData |
getOrCreateAndSet(Content node,
String name,
Object obj)
|
static NodeData |
getOrCreateAndSet(Content node,
String name,
javax.jcr.Value[] value)
|
static String |
getString(Content node,
String name)
Get the string or the empty string if not existing. |
static String |
getString(Content node,
String name,
String defaultValue)
You can define a default value if not found. |
static String |
getString(String repository,
String path)
Simple method to get strings like configuration informations. |
static String |
getString(String repository,
String path,
String defaultValue)
You can define a default value if not found. |
static String |
getTypeName(NodeData nd)
String representation of the jcr property type. |
static Object |
getValueObject(NodeData nd)
Returns the value as an Object. |
static List<String> |
getValuesStringList(javax.jcr.Value[] values)
|
static String |
getValueString(NodeData nodeData)
Same as getValueString(nd, dateFormat) but using the users short date format. |
static String |
getValueString(NodeData nodeData,
String dateFormat)
Returns a String representation of the value. |
static String |
getValueString(javax.jcr.Value value,
String dateFormat)
Same as value.getString(), but using custom date format. |
static Object |
inherit(Content node,
String name)
Inherit a value. |
static Object |
inherit(Content node,
String name,
Object dflt)
Inherit a value. |
static String |
inheritString(Content node,
String name)
Inherit a value. |
static String |
inheritString(Content node,
String name,
String dflt)
Inherit a value. |
static NodeData |
setValue(NodeData nodeData,
Object valueObj)
Calls the correct setValue method based on object type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeDataUtil()
Method Detail |
---|
public static String getValueString(NodeData nodeData)
public static String getValueString(NodeData nodeData, String dateFormat)
nodeData
- dateFormat
- date format to use in the case it is a date
public static String getValueString(javax.jcr.Value value, String dateFormat)
public static String inheritString(Content node, String name) throws javax.jcr.RepositoryException
node
- Node expected to define or inherit the searched node value.name
- Name of the nodeData.
javax.jcr.RepositoryException
public static String inheritString(Content node, String name, String dflt) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static Object inherit(Content node, String name) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static Object inherit(Content node, String name, Object dflt) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static Object getValueObject(NodeData nd)
public static NodeData setValue(NodeData nodeData, Object valueObj) throws AccessDeniedException, javax.jcr.RepositoryException
AccessDeniedException
javax.jcr.RepositoryException
public static String getTypeName(NodeData nd)
public static String getString(String repository, String path)
public static String getString(Content node, String name)
public static String getString(String repository, String path, String defaultValue)
public static String getString(Content node, String name, String defaultValue)
public static long getLong(Content node, String name, long defaultValue)
public static Calendar getDate(Content node, String name, Calendar defaultValue)
public static boolean getBoolean(Content node, String name, boolean defaultValue)
public static NodeData getOrCreate(Content node, String name) throws AccessDeniedException, javax.jcr.RepositoryException
node
- name
-
AccessDeniedException
PathNotFoundException
javax.jcr.RepositoryException
public static NodeData getOrCreate(Content node, String name, int type) throws AccessDeniedException, javax.jcr.RepositoryException
node
- name
-
AccessDeniedException
PathNotFoundException
javax.jcr.RepositoryException
public static NodeData getOrCreate(Content node, String name, Object obj) throws AccessDeniedException, javax.jcr.RepositoryException
AccessDeniedException
javax.jcr.RepositoryException
public static NodeData getOrCreateAndSet(Content node, String name, Object obj) throws AccessDeniedException, javax.jcr.RepositoryException
AccessDeniedException
javax.jcr.RepositoryException
public static NodeData getOrCreateAndSet(Content node, String name, long value) throws AccessDeniedException, javax.jcr.RepositoryException
AccessDeniedException
javax.jcr.RepositoryException
public static NodeData getOrCreateAndSet(Content node, String name, javax.jcr.Value[] value) throws AccessDeniedException, javax.jcr.RepositoryException
AccessDeniedException
javax.jcr.RepositoryException
public static NodeData getOrCreateAndSet(Content node, String name, int value) throws AccessDeniedException, javax.jcr.RepositoryException
AccessDeniedException
javax.jcr.RepositoryException
public static NodeData getOrCreateAndSet(Content node, String name, boolean value) throws AccessDeniedException, javax.jcr.RepositoryException
AccessDeniedException
javax.jcr.RepositoryException
public static String getI18NString(Content node, String str)
public static String getI18NString(Content node, String str, String basename)
public static javax.jcr.Value createValue(String valueStr, int type) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static javax.jcr.Value createValue(Object obj, javax.jcr.ValueFactory valueFactory) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static javax.jcr.Value createValue(String valueStr, int type, javax.jcr.ValueFactory valueFactory)
public static int getJCRPropertyType(Object obj)
public static List<String> getValuesStringList(javax.jcr.Value[] values)
public static String getDateFormat()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |