|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.module.data.util.DataUtil
public class DataUtil
Data related utilities.
Field Summary | |
---|---|
static info.magnolia.cms.core.ItemType |
MULTI_VALUE_ITEM_TYPE
Multi value node item type. |
Constructor Summary | |
---|---|
DataUtil()
|
Method Summary | |
---|---|
static info.magnolia.cms.core.Content |
addMultiValue(info.magnolia.cms.core.Content node,
String name,
String value)
Adds multi value type. |
static info.magnolia.cms.core.Content |
addMultiValue(info.magnolia.cms.core.Content node,
String name,
String valueStr,
info.magnolia.cms.core.ItemType itemType)
Adds multi value type. |
static info.magnolia.cms.core.Content |
addMultiValue(info.magnolia.cms.core.Content node,
String name,
javax.jcr.Value value,
info.magnolia.cms.core.ItemType itemType)
Adds multi value type. |
static info.magnolia.cms.core.Content |
addMultiValueOnce(info.magnolia.cms.core.Content node,
String name,
String value)
Adds multi value type if such doesn't exist yet. |
static info.magnolia.cms.core.Content |
addMultiValueOnce(info.magnolia.cms.core.Content node,
String name,
String value,
info.magnolia.cms.core.ItemType itemType)
Adds multi value type if such doesn't exist yet. |
static String |
configureDialog(info.magnolia.cms.core.Content type)
Creating or updating the dialog for editing instances of the type. |
static TypeDefinition |
createTypeDefinition(info.magnolia.cms.core.Content content)
Create a TypeDefinition object from a content node. |
static List<info.magnolia.cms.core.Content> |
getMultiValueNodes(info.magnolia.cms.core.Content node,
String name)
Gets list of child nodes with given content node name. |
static List<Object> |
getMultiValues(info.magnolia.cms.core.Content node,
String name)
Gets list of values extracted from content nodes with given name for provided parent node. |
static boolean |
hasMultiValue(info.magnolia.cms.core.Content node,
String name,
Object value)
Validates whether node with given value already exists. |
static void |
registerNodeType(TypeDefinition type)
Registers a new node type for the given repository and type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final info.magnolia.cms.core.ItemType MULTI_VALUE_ITEM_TYPE
Constructor Detail |
---|
public DataUtil()
Method Detail |
---|
public static info.magnolia.cms.core.Content addMultiValue(info.magnolia.cms.core.Content node, String name, String value) throws javax.jcr.RepositoryException
node
- Parent node.name
- Name of the value node.value
- Value.
javax.jcr.RepositoryException
- When node can't be created or saved.public static info.magnolia.cms.core.Content addMultiValue(info.magnolia.cms.core.Content node, String name, String valueStr, info.magnolia.cms.core.ItemType itemType) throws javax.jcr.RepositoryException
node
- Parent node.name
- Name of the value node.valueStr
- Node value formatted as a String.itemType
- Item type of newly created node.
javax.jcr.RepositoryException
- When node can't be created or saved.MULTI_VALUE_ITEM_TYPE
public static info.magnolia.cms.core.Content addMultiValue(info.magnolia.cms.core.Content node, String name, javax.jcr.Value value, info.magnolia.cms.core.ItemType itemType) throws javax.jcr.RepositoryException
node
- Parent node.name
- Name of the value node.value
- Value.itemType
- Item type of newly created node.
javax.jcr.RepositoryException
- When node can't be created or saved.MULTI_VALUE_ITEM_TYPE
public static info.magnolia.cms.core.Content addMultiValueOnce(info.magnolia.cms.core.Content node, String name, String value) throws javax.jcr.RepositoryException
node
- Parent node.name
- Name of the value node.value
- Value.
javax.jcr.RepositoryException
- When node can't be created or saved.public static info.magnolia.cms.core.Content addMultiValueOnce(info.magnolia.cms.core.Content node, String name, String value, info.magnolia.cms.core.ItemType itemType) throws javax.jcr.RepositoryException
node
- Parent node.name
- Name of the value node.value
- Value.itemType
- Item type of newly created node.
javax.jcr.RepositoryException
- When node can't be created or saved.MULTI_VALUE_ITEM_TYPE
public static boolean hasMultiValue(info.magnolia.cms.core.Content node, String name, Object value) throws javax.jcr.RepositoryException
node
- Checked node.name
- Child content node name.value
- Expected value.
javax.jcr.RepositoryException
- When repository can't be accessed.public static List<Object> getMultiValues(info.magnolia.cms.core.Content node, String name) throws javax.jcr.RepositoryException
node
- Parent node.name
- Child content node name.
javax.jcr.RepositoryException
- When access to repository fails.public static List<info.magnolia.cms.core.Content> getMultiValueNodes(info.magnolia.cms.core.Content node, String name) throws javax.jcr.RepositoryException
node
- Parent node.name
- Child content node name.
javax.jcr.RepositoryException
- When access to repository fails.public static String configureDialog(info.magnolia.cms.core.Content type) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static void registerNodeType(TypeDefinition type) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- when node type can't be registered. Most often this happens when the node type of given name already exists or when the definition is invalidpublic static TypeDefinition createTypeDefinition(info.magnolia.cms.core.Content content)
content
- the node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |