info.magnolia.cms.core.version
Class ContentVersion

java.lang.Object
  extended by info.magnolia.cms.core.ContentHandler
      extended by info.magnolia.cms.core.AbstractContent
          extended by info.magnolia.cms.core.DefaultContent
              extended by info.magnolia.cms.core.version.ContentVersion
All Implemented Interfaces:
Content, Cloneable

public class ContentVersion
extends DefaultContent

Wraps a versioned node (frozen node) and allows traversing the hierarchy as if the node where in the original place.

Author:
Sameer Charles $Id: ContentVersion.java 41137 2011-01-06 18:19:25Z gjoseph $

Nested Class Summary
 
Nested classes/interfaces inherited from interface info.magnolia.cms.core.Content
Content.ContentFilter
 
Field Summary
static String NAME
          Name of the base node.
static String VERSION_USER
          User who created this version.
 
Fields inherited from class info.magnolia.cms.core.DefaultContent
node
 
Fields inherited from class info.magnolia.cms.core.ContentHandler
hierarchyManager
 
Constructor Summary
ContentVersion(javax.jcr.version.Version thisVersion, AbstractContent base)
           
 
Method Summary
 void addMixin(String type)
          Throws an AccessDeniedException as versions are read only.
 javax.jcr.version.Version addVersion()
          Throws an AccessDeniedException as versions are read only.
 javax.jcr.version.Version addVersion(Rule rule)
          Throws an AccessDeniedException as versions are read only.
 Content createContent(String name)
          Throws an AccessDeniedException as versions are read only.
 Content createContent(String name, ItemType contentType)
          Throws an AccessDeniedException as versions are read only.
 Content createContent(String name, String contentType)
          Throws an AccessDeniedException as versions are read only.
 NodeData createNodeData(String name)
          Throws an AccessDeniedException as versions are read only.
 NodeData createNodeData(String name, int type)
          Throws an AccessDeniedException as versions are read only.
 NodeData createNodeData(String name, javax.jcr.Value value)
          Throws an AccessDeniedException as versions are read only.
 NodeData createNodeData(String name, javax.jcr.Value value, int type)
          Throws an AccessDeniedException as versions are read only.
 void delete()
          Throws an AccessDeniedException as versions are read only.
 void delete(String path)
          Throws an AccessDeniedException as versions are read only.
 void deleteNodeData(String name)
          Throws an AccessDeniedException as versions are read only.
protected  int determineNodeDataType(String name)
           
 AccessManager getAccessManager()
          Deprecated. use getHierarchyManager instead
 javax.jcr.version.VersionIterator getAllVersions()
          Throws an AccessDeniedException as versions are read only.
 Content getAncestor(int level)
          get absolute parent object starting from the root node.
 Collection<Content> getAncestors()
          Convenience method for taglib.
 ContentVersion getBaseVersion()
          Throws an AccessDeniedException as versions are read only.
 Collection<Content> getChildren(Content.ContentFilter filter, String namePattern, Comparator<Content> orderCriteria)
          All AbstractContent.getChildren() methods delegate to this method.
 javax.jcr.version.VersionHistory getContainingHistory()
          Get containing version history.
 Content getContent(String name)
          Returns a direct child if it was included in the version.
 Calendar getCreated()
          Get creation date of this version.
 String getHandle()
          Get original path of this versioned content.
 HierarchyManager getHierarchyManager()
          Get hierarchy manager if previously set for this object.
 int getIndex()
          This method returns the index of this node within the ordered set of its same-name sibling nodes.
 int getLevel()
          Get node level from the ROOT node : FIXME implement getDepth in javax.jcr.
 javax.jcr.lock.Lock getLock()
          Throws an AccessDeniedException as versions are read only.
 javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
          Returns an array of NodeType objects representing the mixin node types assigned to this node.
 String getName()
          The original name of the node.
 javax.jcr.nodetype.NodeType getNodeType()
          Returns primary node type definition of the associated Node of this object.
 Content getParent()
          Returns the parent of the base node.
 javax.jcr.version.Version[] getPredecessors()
           
 String getUserName()
          The name of the user who created this version.
 String getUUID()
          UUID of the node refrenced by this object.
 ContentVersion getVersionedContent(String versionName)
          Throws an AccessDeniedException as versions are read only.
 ContentVersion getVersionedContent(javax.jcr.version.Version version)
          Throws an AccessDeniedException as versions are read only.
 javax.jcr.version.VersionHistory getVersionHistory()
          Throws an AccessDeniedException as versions are read only.
 String getVersionLabel()
          Return the name of the version represented by this object.
 javax.jcr.Workspace getWorkspace()
          get workspace to which this node attached to.
 boolean hasChildren()
           
 boolean hasChildren(String contentType)
           
 boolean hasContent(String name)
          Uses the same approach as getContent(String).
 boolean hasNodeData(String name)
          Delegates to NodeData.isExist().
 boolean holdsLock()
          Throws an AccessDeniedException as versions are read only.
 boolean isGranted(long permissions)
          Checks for the allowed access rights.
 boolean isLocked()
          Throws an AccessDeniedException as versions are read only.
 boolean isModified()
          Returns always false as verions are read only.
 javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped)
          Throws an AccessDeniedException as versions are read only.
 javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped, long yieldFor)
          Throws an AccessDeniedException as versions are read only.
 void orderBefore(String srcName, String beforeName)
          Throws an AccessDeniedException as versions are read only.
 void removeMixin(String type)
          Throws an AccessDeniedException as versions are read only.
 void restore(String versionName, boolean removeExisting)
          Throws an AccessDeniedException as versions are read only.
 void restore(javax.jcr.version.Version version, boolean removeExisting)
          Throws an AccessDeniedException as versions are read only.
 void restore(javax.jcr.version.Version version, String relPath, boolean removeExisting)
          Throws an AccessDeniedException as versions are read only.
 void restoreByLabel(String versionLabel, boolean removeExisting)
          Throws an AccessDeniedException as versions are read only.
 void save()
          Throws an AccessDeniedException as versions are read only.
 void unlock()
          Throws an AccessDeniedException as versions are read only.
 void updateMetaData()
          Throws an AccessDeniedException as versions are read only.
 
Methods inherited from class info.magnolia.cms.core.DefaultContent
getItemType, getJCRNode, getMetaData, getNodeDataCollection, getNodeTypeName, getPrimitiveNodeDatas, hasMetaData, hasMixin, isCheckedOut, isNodeType, isNodeType, newNodeDataInstance, refresh, removeVersionHistory, setNode, setPath, setRootNode
 
Methods inherited from class info.magnolia.cms.core.AbstractContent
createNodeData, createNodeData, getBinaryNodeDatas, getChildByName, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getNodeData, getNodeDataCollection, getTemplate, getTitle, isNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, toString
 
Methods inherited from class info.magnolia.cms.core.ContentHandler
clone, setAccessManager, setHierarchyManager
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION_USER

public static final String VERSION_USER
User who created this version.

See Also:
Constant Field Values

NAME

public static final String NAME
Name of the base node.

See Also:
Constant Field Values
Constructor Detail

ContentVersion

public ContentVersion(javax.jcr.version.Version thisVersion,
                      AbstractContent base)
               throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException
Method Detail

getCreated

public Calendar getCreated()
                    throws javax.jcr.RepositoryException
Get creation date of this version.

Returns:
creation date as calendar
Throws:
javax.jcr.RepositoryException

getVersionLabel

public String getVersionLabel()
                       throws javax.jcr.RepositoryException
Return the name of the version represented by this object.

Returns:
the versions name
Throws:
javax.jcr.RepositoryException

getContainingHistory

public javax.jcr.version.VersionHistory getContainingHistory()
                                                      throws javax.jcr.RepositoryException
Get containing version history.

Returns:
version history associated to this version
Throws:
javax.jcr.RepositoryException

getName

public String getName()
The original name of the node.

Specified by:
getName in interface Content
Overrides:
getName in class DefaultContent
Returns:
String name of the current Node

getUserName

public String getUserName()
The name of the user who created this version.


getHandle

public String getHandle()
Get original path of this versioned content.

Specified by:
getHandle in interface Content
Overrides:
getHandle in class DefaultContent
Returns:
String representing path (handle) of the content

getContent

public Content getContent(String name)
                   throws javax.jcr.PathNotFoundException,
                          javax.jcr.RepositoryException,
                          AccessDeniedException
Returns a direct child if it was included in the version. Otherwise it tries to get the child from the original place. The versioning rule is respected.

Specified by:
getContent in interface Content
Overrides:
getContent in class DefaultContent
Parameters:
name - of the node acting as Content
Returns:
Content
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException - if an error occurs
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation

hasContent

public boolean hasContent(String name)
                   throws javax.jcr.RepositoryException
Uses the same approach as getContent(String).

Specified by:
hasContent in interface Content
Overrides:
hasContent in class DefaultContent
Throws:
javax.jcr.RepositoryException - if an error occurs

createContent

public Content createContent(String name)
                      throws AccessDeniedException
Throws an AccessDeniedException as versions are read only.

Specified by:
createContent in interface Content
Overrides:
createContent in class AbstractContent
Parameters:
name - of the node to be created as Content
Returns:
newly created Content
Throws:
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation

createContent

public Content createContent(String name,
                             String contentType)
                      throws AccessDeniedException
Throws an AccessDeniedException as versions are read only.

Specified by:
createContent in interface Content
Overrides:
createContent in class DefaultContent
Parameters:
name - of the node to be created as Content
contentType - JCR node type as configured
Returns:
newly created Content
Throws:
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation

createContent

public Content createContent(String name,
                             ItemType contentType)
                      throws AccessDeniedException
Throws an AccessDeniedException as versions are read only.

Specified by:
createContent in interface Content
Overrides:
createContent in class AbstractContent
Parameters:
name - of the node to be created as Content
contentType - ItemType
Returns:
newly created Content
Throws:
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation

createNodeData

public NodeData createNodeData(String name)
                        throws AccessDeniedException
Throws an AccessDeniedException as versions are read only.

Specified by:
createNodeData in interface Content
Overrides:
createNodeData in class AbstractContent
Throws:
AccessDeniedException

createNodeData

public NodeData createNodeData(String name,
                               javax.jcr.Value value,
                               int type)
                        throws AccessDeniedException
Throws an AccessDeniedException as versions are read only.

Throws:
AccessDeniedException

createNodeData

public NodeData createNodeData(String name,
                               javax.jcr.Value value)
                        throws AccessDeniedException
Throws an AccessDeniedException as versions are read only.

Specified by:
createNodeData in interface Content
Overrides:
createNodeData in class AbstractContent
Throws:
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation

createNodeData

public NodeData createNodeData(String name,
                               int type)
                        throws AccessDeniedException
Throws an AccessDeniedException as versions are read only.

Specified by:
createNodeData in interface Content
Overrides:
createNodeData in class AbstractContent
Throws:
AccessDeniedException

deleteNodeData

public void deleteNodeData(String name)
                    throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
deleteNodeData in interface Content
Overrides:
deleteNodeData in class AbstractContent
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException - if an error occurs

updateMetaData

public void updateMetaData()
                    throws AccessDeniedException
Throws an AccessDeniedException as versions are read only.

Specified by:
updateMetaData in interface Content
Overrides:
updateMetaData in class AbstractContent
Throws:
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation

getChildren

public Collection<Content> getChildren(Content.ContentFilter filter,
                                       String namePattern,
                                       Comparator<Content> orderCriteria)
All AbstractContent.getChildren() methods delegate to this method. We combine the direct children and children from the current node which were not included by the version rule.

Overrides:
getChildren in class DefaultContent
namePattern - ignored if null.

hasChildren

public boolean hasChildren()
Specified by:
hasChildren in interface Content
Overrides:
hasChildren in class AbstractContent
Returns:
Boolean, if sub node(s) exists

hasChildren

public boolean hasChildren(String contentType)
Specified by:
hasChildren in interface Content
Overrides:
hasChildren in class AbstractContent
Parameters:
contentType - JCR node type as configured
Returns:
Boolean, if sub collectionType exists

getParent

public Content getParent()
                  throws javax.jcr.PathNotFoundException,
                         javax.jcr.RepositoryException,
                         AccessDeniedException
Returns the parent of the base node.

Specified by:
getParent in interface Content
Overrides:
getParent in class DefaultContent
Returns:
Content representing parent node
Throws:
javax.jcr.PathNotFoundException
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation
javax.jcr.RepositoryException - if an error occurs

getAncestor

public Content getAncestor(int level)
                    throws javax.jcr.PathNotFoundException,
                           javax.jcr.RepositoryException,
                           AccessDeniedException
Description copied from interface: Content
get absolute parent object starting from the root node.

Specified by:
getAncestor in interface Content
Overrides:
getAncestor in class DefaultContent
Parameters:
level - level at which the requested node exist, relative to the ROOT node
Returns:
Content representing parent node
Throws:
AccessDeniedException - if the current session does not have sufficient access rights to complete the operation
javax.jcr.RepositoryException - if an error occurs
javax.jcr.PathNotFoundException

getAncestors

public Collection<Content> getAncestors()
                                 throws javax.jcr.PathNotFoundException,
                                        javax.jcr.RepositoryException
Convenience method for taglib.

Specified by:
getAncestors in interface Content
Overrides:
getAncestors in class DefaultContent
Returns:
Content representing node on level 0
Throws:
javax.jcr.RepositoryException - if an error occurs
javax.jcr.PathNotFoundException

getLevel

public int getLevel()
             throws javax.jcr.PathNotFoundException,
                    javax.jcr.RepositoryException
Get node level from the ROOT node : FIXME implement getDepth in javax.jcr.

Specified by:
getLevel in interface Content
Overrides:
getLevel in class DefaultContent
Returns:
level at which current node exist, relative to the ROOT node
Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException - if an error occurs

orderBefore

public void orderBefore(String srcName,
                        String beforeName)
                 throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
orderBefore in interface Content
Overrides:
orderBefore in class DefaultContent
Parameters:
srcName - where current node has to be moved
beforeName - name of the node before the current node has to be placed
Throws:
javax.jcr.RepositoryException - if an error occurs

getIndex

public int getIndex()
             throws javax.jcr.RepositoryException
This method returns the index of this node within the ordered set of its same-name sibling nodes. This index is the one used to address same-name siblings using the square-bracket notation, e.g., /a[3]/b[4]. Note that the index always starts at 1 (not 0), for compatibility with XPath. As a result, for nodes that do not have same-name-siblings, this method will always return 1.

Specified by:
getIndex in interface Content
Overrides:
getIndex in class DefaultContent
Returns:
The index of this node within the ordered set of its same-name sibling nodes.
Throws:
javax.jcr.RepositoryException - if an error occurs

getNodeType

public javax.jcr.nodetype.NodeType getNodeType()
                                        throws javax.jcr.RepositoryException
Returns primary node type definition of the associated Node of this object.

Specified by:
getNodeType in interface Content
Overrides:
getNodeType in class DefaultContent
Throws:
javax.jcr.RepositoryException - if an error occurs

restore

public void restore(String versionName,
                    boolean removeExisting)
             throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
restore in interface Content
Overrides:
restore in class DefaultContent
Throws:
javax.jcr.version.VersionException - if the specified versionName does not exist in this node's version history
javax.jcr.RepositoryException - if an error occurs

restore

public void restore(javax.jcr.version.Version version,
                    boolean removeExisting)
             throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
restore in interface Content
Overrides:
restore in class DefaultContent
Throws:
javax.jcr.version.VersionException - if the specified version is not part of this node's version history
javax.jcr.RepositoryException - if an error occurs

restore

public void restore(javax.jcr.version.Version version,
                    String relPath,
                    boolean removeExisting)
             throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
restore in interface Content
Overrides:
restore in class DefaultContent
Throws:
javax.jcr.version.VersionException - if the specified version is not part of this node's version history
javax.jcr.RepositoryException - if an error occurs

restoreByLabel

public void restoreByLabel(String versionLabel,
                           boolean removeExisting)
                    throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
restoreByLabel in interface Content
Overrides:
restoreByLabel in class DefaultContent
Throws:
javax.jcr.version.VersionException - if the specified versionLabel does not exist in this node's version history
javax.jcr.RepositoryException - if an error occurs

addVersion

public javax.jcr.version.Version addVersion()
                                     throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
addVersion in interface Content
Overrides:
addVersion in class DefaultContent
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException - if an error occurs

addVersion

public javax.jcr.version.Version addVersion(Rule rule)
                                     throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
addVersion in interface Content
Overrides:
addVersion in class DefaultContent
Parameters:
rule - to be used to collect content
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException - if an error occurs
See Also:
Rule

isModified

public boolean isModified()
Returns always false as verions are read only.

Specified by:
isModified in interface Content
Overrides:
isModified in class DefaultContent
Returns:
true if this item is modified; false otherwise.

getVersionHistory

public javax.jcr.version.VersionHistory getVersionHistory()
                                                   throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
getVersionHistory in interface Content
Overrides:
getVersionHistory in class DefaultContent
Returns:
version history
Throws:
javax.jcr.RepositoryException - if an error occurs

getAllVersions

public javax.jcr.version.VersionIterator getAllVersions()
                                                 throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
getAllVersions in interface Content
Overrides:
getAllVersions in class DefaultContent
Returns:
Version iterator retreived from version history
Throws:
javax.jcr.RepositoryException - if an error occurs

getBaseVersion

public ContentVersion getBaseVersion()
                              throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
getBaseVersion in interface Content
Overrides:
getBaseVersion in class DefaultContent
Returns:
base ContentVersion
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException

getVersionedContent

public ContentVersion getVersionedContent(javax.jcr.version.Version version)
                                   throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
getVersionedContent in interface Content
Overrides:
getVersionedContent in class DefaultContent
Returns:
version object wrapped in ContentVersion
Throws:
javax.jcr.RepositoryException
See Also:
ContentVersion

getVersionedContent

public ContentVersion getVersionedContent(String versionName)
                                   throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
getVersionedContent in interface Content
Overrides:
getVersionedContent in class DefaultContent
Returns:
version object wrapped in ContentVersion
Throws:
javax.jcr.RepositoryException
See Also:
ContentVersion

save

public void save()
          throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
save in interface Content
Overrides:
save in class DefaultContent
Throws:
javax.jcr.RepositoryException - if an error occurs

isGranted

public boolean isGranted(long permissions)
Checks for the allowed access rights.

Specified by:
isGranted in interface Content
Overrides:
isGranted in class AbstractContent
Parameters:
permissions - as defined in javax.jcr.Permission
Returns:
true is the current user has specified access on this node.

delete

public void delete()
            throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
delete in interface Content
Overrides:
delete in class DefaultContent
Throws:
javax.jcr.RepositoryException - if an error occurs

delete

public void delete(String path)
            throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
delete in interface Content
Overrides:
delete in class AbstractContent
Throws:
javax.jcr.RepositoryException - if an error occurs

getUUID

public String getUUID()
UUID of the node refrenced by this object.

Specified by:
getUUID in interface Content
Overrides:
getUUID in class DefaultContent
Returns:
uuid

addMixin

public void addMixin(String type)
              throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
addMixin in interface Content
Overrides:
addMixin in class DefaultContent
Parameters:
type - mixin type to be added
Throws:
javax.jcr.RepositoryException - if an error occurs

removeMixin

public void removeMixin(String type)
                 throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
removeMixin in interface Content
Overrides:
removeMixin in class DefaultContent
Parameters:
type - , mixin type to be removed
Throws:
javax.jcr.RepositoryException - if an error occurs

lock

public javax.jcr.lock.Lock lock(boolean isDeep,
                                boolean isSessionScoped)
                         throws javax.jcr.lock.LockException,
                                javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
lock in interface Content
Overrides:
lock in class DefaultContent
Parameters:
isDeep - if true this lock will apply to this node and all its descendants; if false, it applies only to this node.
isSessionScoped - if true, this lock expires with the current session; if false it expires when explicitly or automatically unlocked for some other reason.
Returns:
A Lock object containing a lock token.
Throws:
javax.jcr.lock.LockException - if this node is already locked or isDeep is true and a descendant node of this node already holds a lock.
javax.jcr.RepositoryException - if an error occurs
See Also:
Node.lock(boolean,boolean)

lock

public javax.jcr.lock.Lock lock(boolean isDeep,
                                boolean isSessionScoped,
                                long yieldFor)
                         throws javax.jcr.lock.LockException,
                                javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
lock in interface Content
Overrides:
lock in class DefaultContent
Parameters:
isDeep - if true this lock will apply to this node and all its descendants; if false, it applies only to this node.
isSessionScoped - if true, this lock expires with the current session; if false it expires when explicitly or automatically unlocked for some other reason.
yieldFor - number of milliseconds for which this method will try to get a lock
Returns:
A Lock object containing a lock token.
Throws:
javax.jcr.lock.LockException - if this node is already locked or isDeep is true and a descendant node of this node already holds a lock.
javax.jcr.RepositoryException - if an error occurs
See Also:
Node.lock(boolean,boolean)

getLock

public javax.jcr.lock.Lock getLock()
                            throws javax.jcr.lock.LockException,
                                   javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
getLock in interface Content
Overrides:
getLock in class DefaultContent
Throws:
javax.jcr.lock.LockException - If no lock applies to this node, a LockException is thrown.
javax.jcr.RepositoryException - if an error occurs

unlock

public void unlock()
            throws javax.jcr.lock.LockException,
                   javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
unlock in interface Content
Overrides:
unlock in class DefaultContent
Throws:
javax.jcr.lock.LockException - if either does not currently hold a lock, or holds a lock for which this Session does not have the correct lock token
javax.jcr.RepositoryException - if an error occurs

holdsLock

public boolean holdsLock()
                  throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
holdsLock in interface Content
Overrides:
holdsLock in class DefaultContent
Returns:
a boolean
Throws:
javax.jcr.RepositoryException - if an error occurs

isLocked

public boolean isLocked()
                 throws javax.jcr.RepositoryException
Throws an AccessDeniedException as versions are read only.

Specified by:
isLocked in interface Content
Overrides:
isLocked in class DefaultContent
Returns:
a boolean
Throws:
javax.jcr.RepositoryException - if an error occurs

getHierarchyManager

public HierarchyManager getHierarchyManager()
Get hierarchy manager if previously set for this object.

Specified by:
getHierarchyManager in interface Content
Overrides:
getHierarchyManager in class ContentHandler
Returns:
HierarchyManager

getAccessManager

@Deprecated
public AccessManager getAccessManager()
Deprecated. use getHierarchyManager instead

Get access manager if previously set for this object.

Specified by:
getAccessManager in interface Content
Overrides:
getAccessManager in class ContentHandler
Returns:
AccessManager

getWorkspace

public javax.jcr.Workspace getWorkspace()
                                 throws javax.jcr.RepositoryException
Description copied from interface: Content
get workspace to which this node attached to.

Specified by:
getWorkspace in interface Content
Overrides:
getWorkspace in class AbstractContent
Throws:
javax.jcr.RepositoryException - if unable to get this node session

hasNodeData

public boolean hasNodeData(String name)
                    throws javax.jcr.RepositoryException
Description copied from class: AbstractContent
Delegates to NodeData.isExist().

Specified by:
hasNodeData in interface Content
Overrides:
hasNodeData in class DefaultContent
Throws:
javax.jcr.RepositoryException - if an error occurs

determineNodeDataType

protected int determineNodeDataType(String name)
Overrides:
determineNodeDataType in class DefaultContent

getMixinNodeTypes

public javax.jcr.nodetype.NodeType[] getMixinNodeTypes()
                                                throws javax.jcr.RepositoryException
Description copied from interface: Content
Returns an array of NodeType objects representing the mixin node types assigned to this node. This includes only those mixin types explicitly assigned to this node, and therefore listed in the property jcr:mixinTypes. It does not include mixin types inherited through the addition of supertypes to the primary type hierarchy.

Specified by:
getMixinNodeTypes in interface Content
Overrides:
getMixinNodeTypes in class DefaultContent
Returns:
an array of mixin NodeType objects.
Throws:
javax.jcr.RepositoryException - if an error occurs

getPredecessors

public javax.jcr.version.Version[] getPredecessors()
                                            throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.