|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.magnolia.cms.core.ContentHandler
info.magnolia.cms.core.AbstractContent
info.magnolia.cms.core.DefaultContent
info.magnolia.cms.core.version.ContentVersion
public class ContentVersion
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface info.magnolia.cms.core.Content |
---|
Content.ContentFilter |
Field Summary | |
---|---|
static java.lang.String |
NAME
name of the base node |
static java.lang.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)
package private constructor |
Method Summary | |
---|---|
void |
addMixin(java.lang.String type)
add specified mixin type if allowed |
javax.jcr.version.Version |
addVersion()
add version leaving the node checked out |
javax.jcr.version.Version |
addVersion(Rule rule)
add version leaving the node checked out |
Content |
createContent(java.lang.String name)
create Content node under the current node with the specified name |
Content |
createContent(java.lang.String name,
ItemType contentType)
Create Content node under the current node with the specified name. |
Content |
createContent(java.lang.String name,
java.lang.String contentType)
create Content node under the current node with the specified name |
NodeData |
createNodeData(java.lang.String name)
create top level NodeData object |
NodeData |
createNodeData(java.lang.String name,
int type)
create top level NodeData object |
NodeData |
createNodeData(java.lang.String name,
javax.jcr.Value value)
Create NodeData with the given value and type. |
NodeData |
createNodeData(java.lang.String name,
javax.jcr.Value value,
int type)
Create NodeData with the given value and type. |
void |
delete()
Remove this path |
void |
delete(java.lang.String path)
Remove specified path |
void |
deleteNodeData(java.lang.String name)
delete NodeData with the specified name |
AccessManager |
getAccessManager()
Deprecated. use getHierarchyManager instead |
javax.jcr.version.VersionIterator |
getAllVersions()
|
Content |
getAncestor(int level)
get absolute parent object starting from the root node |
java.util.Collection<Content> |
getAncestors()
Convenience method for taglib |
ContentVersion |
getBaseVersion()
get the current base version of this node |
java.util.Collection<Content> |
getChildren()
gets a Collection containing all child nodes of the same NodeType as "this" object. |
java.util.Collection<Content> |
getChildren(ItemType contentType)
Get collection of specified content type |
java.util.Collection<Content> |
getChildren(java.lang.String contentType)
Get collection of specified content type |
java.util.Collection<Content> |
getChildren(java.lang.String contentType,
java.lang.String namePattern)
Get collection of specified content type. |
javax.jcr.version.VersionHistory |
getContainingHistory()
Get containing version history |
Content |
getContent(java.lang.String name)
Gets the Content node of the current node with the specified name. |
java.util.Calendar |
getCreated()
Get creation date of this version |
java.lang.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()
Returns the Lock object that applies to this node. |
java.lang.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()
get parent content object |
java.lang.String |
getUserName()
The name of the user who created this version |
java.lang.String |
getUUID()
UUID of the node refrenced by this object |
ContentVersion |
getVersionedContent(java.lang.String versionName)
get content view over the jcr version object |
ContentVersion |
getVersionedContent(javax.jcr.version.Version version)
get content view over the jcr version object |
javax.jcr.version.VersionHistory |
getVersionHistory()
|
java.lang.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(java.lang.String contentType)
|
boolean |
holdsLock()
Returns true if this node holds a lock; otherwise returns false. |
boolean |
isGranted(long permissions)
checks for the allowed access rights |
boolean |
isLocked()
Returns true if this node is locked either as a result of a lock held by this node or by a deep lock on a node above this node; otherwise returns false. |
boolean |
isModified()
Returns true if this Item has been saved but has subsequently been modified through
the current session and therefore the state of this item as recorded in the session differs from the state of
this item as saved. |
javax.jcr.lock.Lock |
lock(boolean isDeep,
boolean isSessionScoped)
places a lock on this object |
javax.jcr.lock.Lock |
lock(boolean isDeep,
boolean isSessionScoped,
long yieldFor)
places a lock on this object |
void |
orderBefore(java.lang.String srcName,
java.lang.String beforeName)
move current node to the specified location above the named beforename |
void |
removeMixin(java.lang.String type)
Removes the specified mixin node type from this node. |
void |
restore(java.lang.String versionName,
boolean removeExisting)
Restores this node to the state defined by the version with the specified versionName. |
void |
restore(javax.jcr.version.Version version,
boolean removeExisting)
Restores this node to the state defined by the specified version. |
void |
restore(javax.jcr.version.Version version,
java.lang.String relPath,
boolean removeExisting)
Restores the specified version to relPath, relative to this node. |
void |
restoreByLabel(java.lang.String versionLabel,
boolean removeExisting)
Restores this node to the state recorded in the version specified by versionLabel. |
void |
save()
Persists all changes to the repository if validation succeds |
void |
unlock()
Removes the lock on this node. |
void |
updateMetaData()
you could call this method anytime to update working page properties - Modification date & Author ID |
Methods inherited from class info.magnolia.cms.core.DefaultContent |
---|
determineNodeDataType, getChildren, getItemType, getJCRNode, getMetaData, getMixinNodeTypes, getNodeDataCollection, getNodeTypeName, getPrimitiveNodeDatas, hasContent, hasMetaData, hasNodeData, isCheckedOut, isNodeType, isNodeType, newNodeDataInstance, refresh, removeVersionHistory, setNode, setPath, setRootNode |
Methods inherited from class info.magnolia.cms.core.AbstractContent |
---|
createNodeData, createNodeData, getBinaryNodeDatas, getChildByName, 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 java.lang.String VERSION_USER
public static final java.lang.String NAME
Constructor Detail |
---|
public ContentVersion(javax.jcr.version.Version thisVersion, AbstractContent base) throws javax.jcr.RepositoryException
thisVersion
- base
- content on which this version is based on
javax.jcr.RepositoryException
Method Detail |
---|
public java.util.Calendar getCreated() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public java.lang.String getVersionLabel() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public javax.jcr.version.VersionHistory getContainingHistory() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public java.lang.String getName()
getName
in interface Content
getName
in class DefaultContent
Node
public java.lang.String getUserName()
public java.lang.String getHandle()
getHandle
in interface Content
getHandle
in class DefaultContent
public Content getContent(java.lang.String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
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 Content createContent(java.lang.String name) throws AccessDeniedException
createContent
in interface Content
createContent
in class AbstractContent
name
- of the node to be created as Content
AccessDeniedException
- if the current session does not have sufficient access
rights to complete the operationpublic Content createContent(java.lang.String name, java.lang.String contentType) throws AccessDeniedException
createContent
in interface Content
createContent
in class DefaultContent
name
- of the node to be created as Content
contentType
- JCR node type as configured
AccessDeniedException
- if the current session does not have sufficient access
rights to complete the operationpublic Content createContent(java.lang.String name, ItemType contentType) throws AccessDeniedException
createContent
in interface Content
createContent
in class AbstractContent
name
- of the node to be created as Content
contentType
- ItemType
AccessDeniedException
- if the current session does not have sufficient access
rights to complete the operationpublic NodeData createNodeData(java.lang.String name) throws AccessDeniedException
createNodeData
in interface Content
createNodeData
in class AbstractContent
name
- to be created
NodeData
object
AccessDeniedException
- if the current session does not have sufficient access
rights to complete the operationpublic NodeData createNodeData(java.lang.String name, javax.jcr.Value value, int type) throws AccessDeniedException
name
- to be createdvalue
- to be set initiallytype
- propertyType
NodeData
object
AccessDeniedException
- if the current session does not have sufficient access
rights to complete the operationpublic NodeData createNodeData(java.lang.String name, javax.jcr.Value value) throws AccessDeniedException
createNodeData
in interface Content
createNodeData
in class AbstractContent
name
- to be createdvalue
- to be set initially
NodeData
object
AccessDeniedException
- if the current session does not have sufficient access
rights to complete the operationpublic NodeData createNodeData(java.lang.String name, int type) throws AccessDeniedException
createNodeData
in interface Content
createNodeData
in class AbstractContent
name
- to be createdtype
- propertyType
NodeData
object
AccessDeniedException
- if the current session does not have sufficient access
rights to complete the operationpublic void deleteNodeData(java.lang.String name) throws javax.jcr.RepositoryException
deleteNodeData
in interface Content
deleteNodeData
in class AbstractContent
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.PathNotFoundException
public void updateMetaData() throws AccessDeniedException
updateMetaData
in interface Content
updateMetaData
in class AbstractContent
AccessDeniedException
- if the current session does not have sufficient access
rights to complete the operationpublic java.util.Collection<Content> getChildren()
getChildren
in interface Content
getChildren
in class AbstractContent
public java.util.Collection<Content> getChildren(java.lang.String contentType)
getChildren
in interface Content
getChildren
in class AbstractContent
contentType
- JCR node type as configured
public java.util.Collection<Content> getChildren(ItemType contentType)
getChildren
in interface Content
getChildren
in class AbstractContent
contentType
- ItemType
public java.util.Collection<Content> getChildren(java.lang.String contentType, java.lang.String namePattern)
getChildren
in interface Content
getChildren
in class AbstractContent
contentType
- JCR node type as configurednamePattern
-
public boolean hasChildren()
hasChildren
in interface Content
hasChildren
in class AbstractContent
public boolean hasChildren(java.lang.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
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 java.util.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(java.lang.String srcName, java.lang.String beforeName) throws javax.jcr.RepositoryException
beforename
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(java.lang.String versionName, boolean removeExisting) throws javax.jcr.RepositoryException
restore
in interface Content
restore
in class DefaultContent
versionName
- removeExisting
-
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.version.VersionException
- if the specified versionName
does not exist in this
node's version historypublic void restore(javax.jcr.version.Version version, boolean removeExisting) throws javax.jcr.RepositoryException
restore
in interface Content
restore
in class DefaultContent
version
- removeExisting
-
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.version.VersionException
- if the specified version
is not part of this node's
version historypublic void restore(javax.jcr.version.Version version, java.lang.String relPath, boolean removeExisting) throws javax.jcr.RepositoryException
restore
in interface Content
restore
in class DefaultContent
version
- relPath
- removeExisting
-
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.version.VersionException
- if the specified version
is not part of this node's
version historypublic void restoreByLabel(java.lang.String versionLabel, boolean removeExisting) throws javax.jcr.RepositoryException
restoreByLabel
in interface Content
restoreByLabel
in class DefaultContent
versionLabel
- removeExisting
-
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.version.VersionException
- if the specified versionLabel
does not exist in this
node's version historypublic javax.jcr.version.Version addVersion() throws javax.jcr.RepositoryException
addVersion
in interface Content
addVersion
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.UnsupportedRepositoryOperationException
public javax.jcr.version.Version addVersion(Rule rule) throws javax.jcr.RepositoryException
addVersion
in interface Content
addVersion
in class DefaultContent
rule
- to be used to collect content
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.UnsupportedRepositoryOperationException
Rule
public boolean isModified()
true
if this Item
has been saved but has subsequently been modified through
the current session and therefore the state of this item as recorded in the session differs from the state of
this item as saved. Within a transaction, isModified
on an Item
may return
false
(because the Item
has been saved since the modification) even if the
modification in question is not in persistent storage (because the transaction has not yet been committed).
Note that in level 1 (that is, read-only) implementations, this method will always return false
.
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
getVersionHistory
in interface Content
getVersionHistory
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic javax.jcr.version.VersionIterator getAllVersions() throws javax.jcr.RepositoryException
getAllVersions
in interface Content
getAllVersions
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic ContentVersion getBaseVersion() throws javax.jcr.RepositoryException
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
getVersionedContent
in interface Content
getVersionedContent
in class DefaultContent
version
-
javax.jcr.RepositoryException
ContentVersion
public ContentVersion getVersionedContent(java.lang.String versionName) throws javax.jcr.RepositoryException
getVersionedContent
in interface Content
getVersionedContent
in class DefaultContent
versionName
-
javax.jcr.RepositoryException
ContentVersion
public void save() throws javax.jcr.RepositoryException
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
delete
in interface Content
delete
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic void delete(java.lang.String path) throws javax.jcr.RepositoryException
delete
in interface Content
delete
in class AbstractContent
javax.jcr.RepositoryException
- if an error occurspublic java.lang.String getUUID()
getUUID
in interface Content
getUUID
in class DefaultContent
public void addMixin(java.lang.String type) throws javax.jcr.RepositoryException
addMixin
in interface Content
addMixin
in class DefaultContent
type
- mixin type to be added
javax.jcr.RepositoryException
- if an error occurspublic void removeMixin(java.lang.String type) throws javax.jcr.RepositoryException
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
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
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
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
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
holdsLock
in interface Content
holdsLock
in class DefaultContent
javax.jcr.RepositoryException
- if an error occurspublic boolean isLocked() throws javax.jcr.RepositoryException
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
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 session
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |