public class ContentVersion extends DefaultContent
Content.ContentFilter
Modifier and Type | Field and Description |
---|---|
static String |
NAME
Name of the base node.
|
static String |
VERSION_USER
User who created this version.
|
node
Constructor and Description |
---|
ContentVersion(RepositoryManager repositoryManager,
javax.jcr.version.Version thisVersion,
Content base) |
ContentVersion(javax.jcr.version.Version thisVersion,
Content base)
Deprecated.
since 5.4
|
Modifier and Type | Method and Description |
---|---|
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.
|
javax.jcr.Node |
getJCRNode()
utility method to get Node object used to create current content object.
|
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 referenced 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. |
addBinaryNodeData, createHierarchyManager, equals, getItemType, getMetaData, getNodeDataCollection, getNodeTypeName, getPrimitiveNodeDatas, hasBinaryNode, hasMetaData, hasMixin, isCheckedOut, isNodeType, isNodeType, newNodeDataInstance, refresh, removeVersionHistory, setNode, wrapAsContent, wrapAsContent, wrapAsContent
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
clone, setAccessManager
public static final String VERSION_USER
public static final String NAME
@Deprecated public ContentVersion(javax.jcr.version.Version thisVersion, Content base) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public ContentVersion(RepositoryManager repositoryManager, javax.jcr.version.Version thisVersion, Content base) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
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.RepositoryException
- if an error occursAccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationjavax.jcr.PathNotFoundException
public 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 configuredContent
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
- ItemTypeContent
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.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 configuredcollectionType
existspublic Content getParent() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
getParent
in interface Content
getParent
in class DefaultContent
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationjavax.jcr.RepositoryException
- if an error occursjavax.jcr.PathNotFoundException
public 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 nodeAccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationjavax.jcr.RepositoryException
- if an error occursjavax.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 occursjavax.jcr.PathNotFoundException
public int getLevel() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
getLevel
in interface Content
getLevel
in class DefaultContent
javax.jcr.RepositoryException
- if an error occursjavax.jcr.PathNotFoundException
public 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 placedjavax.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 historyjavax.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 historyjavax.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 historyjavax.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 historyjavax.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.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 contentjavax.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.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.Permissionpublic 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 addedjavax.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 removedjavax.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 lockjavax.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 tokenjavax.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 DefaultContent
@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 DefaultContent
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
public javax.jcr.Node getJCRNode()
Content
getJCRNode
in interface Content
getJCRNode
in class DefaultContent
Copyright © 2003–2016 Magnolia International Ltd.. All rights reserved.