info.magnolia.ui.vaadin.integration.jcr
Class JcrItemUtil

java.lang.Object
  extended by info.magnolia.ui.vaadin.integration.jcr.JcrItemUtil

public class JcrItemUtil
extends Object

Utility methods for item ids used in the container.

The format is:


Field Summary
static String PROPERTY_NAME_AND_IDENTIFIER_SEPARATOR
          String separating property name and node identifier.
 
Constructor Summary
JcrItemUtil()
           
 
Method Summary
static String getItemId(javax.jcr.Item jcrItem)
           
static String getItemId(String workspaceName, String absPath)
          Returns the itemId for a node at the given path if it exists, otherwise returns null.
static String getItemPath(javax.jcr.Item item)
           
static javax.jcr.Item getJcrItem(String workspaceName, String itemId)
          Returns the JCR Item represented by the given itemId or returns null if it doesn't exist.
static List<javax.jcr.Item> getJcrItems(String workspaceName, List<String> ids)
           
static boolean isPropertyItemId(String itemId)
           
static boolean itemExists(String workspaceName, String itemId)
           
static String parseNodeIdentifier(String itemId)
           
static String parsePropertyName(String itemId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_NAME_AND_IDENTIFIER_SEPARATOR

public static final String PROPERTY_NAME_AND_IDENTIFIER_SEPARATOR
String separating property name and node identifier.

See Also:
Constant Field Values
Constructor Detail

JcrItemUtil

public JcrItemUtil()
Method Detail

parseNodeIdentifier

public static String parseNodeIdentifier(String itemId)
Returns:
all chars in front of #PROPERTY_NAME_AND_IDENTIFIER_SEPARATOR - if it doesn't contain #PROPERTY_NAME_AND_IDENTIFIER_SEPARATOR the provided itemId (then we assume it's already a nodeId)

parsePropertyName

public static String parsePropertyName(String itemId)

isPropertyItemId

public static boolean isPropertyItemId(String itemId)

getJcrItem

public static javax.jcr.Item getJcrItem(String workspaceName,
                                        String itemId)
                                 throws javax.jcr.RepositoryException
Returns the JCR Item represented by the given itemId or returns null if it doesn't exist.

Throws:
javax.jcr.RepositoryException

itemExists

public static boolean itemExists(String workspaceName,
                                 String itemId)
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getItemId

public static String getItemId(javax.jcr.Item jcrItem)
                        throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getItemId

public static String getItemId(String workspaceName,
                               String absPath)
                        throws javax.jcr.RepositoryException
Returns the itemId for a node at the given path if it exists, otherwise returns null.

Throws:
javax.jcr.RepositoryException

getJcrItems

public static List<javax.jcr.Item> getJcrItems(String workspaceName,
                                               List<String> ids)

getItemPath

public static String getItemPath(javax.jcr.Item item)


Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.