|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.core.ContentHandler info.magnolia.cms.core.AbstractContent info.magnolia.cms.core.DefaultContent info.magnolia.cms.core.version.ContentVersion
public class ContentVersion
Wraps a versioned node (frozen node) and allows traversing the hierarchy as if the node where in the original place.
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 |
---|
public static final String VERSION_USER
public static final String NAME
Constructor Detail |
---|
public ContentVersion(javax.jcr.version.Version thisVersion, AbstractContent base) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Method Detail |
---|
public Calendar getCreated() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public String getVersionLabel() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public javax.jcr.version.VersionHistory getContainingHistory() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public String getName()
getName
in interface Content
getName
in class DefaultContent
Node
public String getUserName()
public String getHandle()
getHandle
in interface Content
getHandle
in class DefaultContent
public Content getContent(String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
getContent
in interface Content
getContent
in class DefaultContent
name
- of the node acting as Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
- if an error occurs
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationpublic boolean hasContent(String name) throws javax.jcr.RepositoryException
getContent(String)
.
hasContent
in interface Content
hasContent
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic Content createContent(String name) throws AccessDeniedException
AccessDeniedException
as versions are read only.
createContent
in interface Content
createContent
in class AbstractContent
name
- of the node to be created as Content
Content
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationpublic Content createContent(String name, String contentType) throws AccessDeniedException
AccessDeniedException
as versions are read only.
createContent
in interface Content
createContent
in class DefaultContent
name
- of the node to be created as Content
contentType
- JCR node type as configured
Content
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationpublic Content createContent(String name, ItemType contentType) throws AccessDeniedException
AccessDeniedException
as versions are read only.
createContent
in interface Content
createContent
in class AbstractContent
name
- of the node to be created as Content
contentType
- ItemType
Content
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationpublic NodeData createNodeData(String name) throws AccessDeniedException
AccessDeniedException
as versions are read only.
createNodeData
in interface Content
createNodeData
in class AbstractContent
AccessDeniedException
public NodeData createNodeData(String name, javax.jcr.Value value, int type) throws AccessDeniedException
AccessDeniedException
as versions are read only.
AccessDeniedException
public NodeData createNodeData(String name, javax.jcr.Value value) throws AccessDeniedException
AccessDeniedException
as versions are read only.
createNodeData
in interface Content
createNodeData
in class AbstractContent
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationpublic NodeData createNodeData(String name, int type) throws AccessDeniedException
AccessDeniedException
as versions are read only.
createNodeData
in interface Content
createNodeData
in class AbstractContent
AccessDeniedException
public void deleteNodeData(String name) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
deleteNodeData
in interface Content
deleteNodeData
in class AbstractContent
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
- if an error occurspublic void updateMetaData() throws AccessDeniedException
AccessDeniedException
as versions are read only.
updateMetaData
in interface Content
updateMetaData
in class AbstractContent
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationpublic Collection<Content> getChildren(Content.ContentFilter filter, String namePattern, Comparator<Content> orderCriteria)
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.
getChildren
in class DefaultContent
namePattern
- ignored if null.public boolean hasChildren()
hasChildren
in interface Content
hasChildren
in class AbstractContent
public boolean hasChildren(String contentType)
hasChildren
in interface Content
hasChildren
in class AbstractContent
contentType
- JCR node type as configured
collectionType
existspublic Content getParent() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
getParent
in interface Content
getParent
in class DefaultContent
javax.jcr.PathNotFoundException
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.RepositoryException
- if an error occurspublic Content getAncestor(int level) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
getAncestor
in interface Content
getAncestor
in class DefaultContent
level
- level at which the requested node exist, relative to the ROOT node
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
public Collection<Content> getAncestors() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
getAncestors
in interface Content
getAncestors
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.PathNotFoundException
public int getLevel() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
getLevel
in interface Content
getLevel
in class DefaultContent
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
- if an error occurspublic void orderBefore(String srcName, String beforeName) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
orderBefore
in interface Content
orderBefore
in class DefaultContent
srcName
- where current node has to be movedbeforeName
- name of the node before the current node has to be placed
javax.jcr.RepositoryException
- if an error occurspublic int getIndex() throws javax.jcr.RepositoryException
getIndex
in interface Content
getIndex
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic javax.jcr.nodetype.NodeType getNodeType() throws javax.jcr.RepositoryException
getNodeType
in interface Content
getNodeType
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic void restore(String versionName, boolean removeExisting) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
restore
in interface Content
restore
in class DefaultContent
javax.jcr.version.VersionException
- if the specified versionName
does not exist in this
node's version history
javax.jcr.RepositoryException
- if an error occurspublic void restore(javax.jcr.version.Version version, boolean removeExisting) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
restore
in interface Content
restore
in class DefaultContent
javax.jcr.version.VersionException
- if the specified version
is not part of this node's
version history
javax.jcr.RepositoryException
- if an error occurspublic void restore(javax.jcr.version.Version version, String relPath, boolean removeExisting) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
restore
in interface Content
restore
in class DefaultContent
javax.jcr.version.VersionException
- if the specified version
is not part of this node's
version history
javax.jcr.RepositoryException
- if an error occurspublic void restoreByLabel(String versionLabel, boolean removeExisting) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
restoreByLabel
in interface Content
restoreByLabel
in class DefaultContent
javax.jcr.version.VersionException
- if the specified versionLabel
does not exist in this
node's version history
javax.jcr.RepositoryException
- if an error occurspublic javax.jcr.version.Version addVersion() throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
addVersion
in interface Content
addVersion
in class DefaultContent
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
- if an error occurspublic javax.jcr.version.Version addVersion(Rule rule) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
addVersion
in interface Content
addVersion
in class DefaultContent
rule
- to be used to collect content
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
- if an error occursRule
public boolean isModified()
isModified
in interface Content
isModified
in class DefaultContent
true
if this item is modified; false
otherwise.public javax.jcr.version.VersionHistory getVersionHistory() throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
getVersionHistory
in interface Content
getVersionHistory
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic javax.jcr.version.VersionIterator getAllVersions() throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
getAllVersions
in interface Content
getAllVersions
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic ContentVersion getBaseVersion() throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
getBaseVersion
in interface Content
getBaseVersion
in class DefaultContent
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
public ContentVersion getVersionedContent(javax.jcr.version.Version version) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
getVersionedContent
in interface Content
getVersionedContent
in class DefaultContent
javax.jcr.RepositoryException
ContentVersion
public ContentVersion getVersionedContent(String versionName) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
getVersionedContent
in interface Content
getVersionedContent
in class DefaultContent
javax.jcr.RepositoryException
ContentVersion
public void save() throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
save
in interface Content
save
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic boolean isGranted(long permissions)
isGranted
in interface Content
isGranted
in class AbstractContent
permissions
- as defined in javax.jcr.Permission
public void delete() throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
delete
in interface Content
delete
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic void delete(String path) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
delete
in interface Content
delete
in class AbstractContent
javax.jcr.RepositoryException
- if an error occurspublic String getUUID()
getUUID
in interface Content
getUUID
in class DefaultContent
public void addMixin(String type) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
addMixin
in interface Content
addMixin
in class DefaultContent
type
- mixin type to be added
javax.jcr.RepositoryException
- if an error occurspublic void removeMixin(String type) throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
removeMixin
in interface Content
removeMixin
in class DefaultContent
type
- , mixin type to be removed
javax.jcr.RepositoryException
- if an error occurspublic javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
lock
in interface Content
lock
in class DefaultContent
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.
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 occursNode.lock(boolean,boolean)
public javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped, long yieldFor) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
lock
in interface Content
lock
in class DefaultContent
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
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 occursNode.lock(boolean,boolean)
public javax.jcr.lock.Lock getLock() throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
getLock
in interface Content
getLock
in class DefaultContent
javax.jcr.lock.LockException
- If no lock applies to this node, a LockException is thrown.
javax.jcr.RepositoryException
- if an error occurspublic void unlock() throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
unlock
in interface Content
unlock
in class DefaultContent
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 occurspublic boolean holdsLock() throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
holdsLock
in interface Content
holdsLock
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic boolean isLocked() throws javax.jcr.RepositoryException
AccessDeniedException
as versions are read only.
isLocked
in interface Content
isLocked
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic HierarchyManager getHierarchyManager()
getHierarchyManager
in interface Content
getHierarchyManager
in class ContentHandler
@Deprecated public AccessManager getAccessManager()
getAccessManager
in interface Content
getAccessManager
in class ContentHandler
public javax.jcr.Workspace getWorkspace() throws javax.jcr.RepositoryException
Content
getWorkspace
in interface Content
getWorkspace
in class AbstractContent
javax.jcr.RepositoryException
- if unable to get this node sessionpublic boolean hasNodeData(String name) throws javax.jcr.RepositoryException
AbstractContent
NodeData.isExist()
.
hasNodeData
in interface Content
hasNodeData
in class DefaultContent
javax.jcr.RepositoryException
- if an error occursprotected int determineNodeDataType(String name)
determineNodeDataType
in class DefaultContent
public javax.jcr.nodetype.NodeType[] getMixinNodeTypes() throws javax.jcr.RepositoryException
Content
getMixinNodeTypes
in interface Content
getMixinNodeTypes
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic javax.jcr.version.Version[] getPredecessors() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |