|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Content
Represents a piece of content (node) which has nodedatas (properties) containing the values and
which can have sub contents. This is is very similar to the JCR Node
interface.
Nested Class Summary | |
---|---|
static interface |
Content.ContentFilter
Implement this interface to be used as node filter by getChildren(). |
Method Summary | |
---|---|
void |
addMixin(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(String name)
Creates a Content node under the current node with the specified name. |
Content |
createContent(String name,
ItemType contentType)
Creates a Content node under the current node with the specified name. |
Content |
createContent(String name,
String contentType)
Creates a Content node under the current node with the specified name. |
NodeData |
createNodeData(String name)
Deprecated. since 4.3, as JCR only supports set or remove operations for properties we recommend to use setNodeData(String, Object) instead. |
NodeData |
createNodeData(String name,
int type)
Deprecated. since 4.3, as JCR only supports set or remove operations for properties we recommend to use setNodeData(String, Object) instead. |
NodeData |
createNodeData(String name,
Object obj)
Deprecated. since 4.3, as JCR only supports set or remove operations for properties we recommend to use setNodeData(String, Object) instead. |
NodeData |
createNodeData(String name,
javax.jcr.Value value)
Deprecated. since 4.3, as JCR only supports set or remove operations for properties we recommend to use setNodeData(String, Value) instead. |
NodeData |
createNodeData(String name,
javax.jcr.Value[] value)
Deprecated. since 4.3, as JCR only supports set or remove operations for properties we recommend to use setNodeData(String, Value[]) instead. |
void |
delete()
Remove this path. |
void |
delete(String path)
Remove specified path. |
void |
deleteNodeData(String name)
Delete NodeData with the specified name. |
AccessManager |
getAccessManager()
Deprecated. since 4.0 - use getHierarchyManager instead |
javax.jcr.version.VersionIterator |
getAllVersions()
|
Content |
getAncestor(int level)
get absolute parent object starting from the root node. |
Collection<Content> |
getAncestors()
Convenience method for taglib. |
ContentVersion |
getBaseVersion()
get the current base version of this node. |
Content |
getChildByName(String namePattern)
Deprecated. since 4.3, either use getContent(String) or getChildren(String) |
Collection<Content> |
getChildren()
Gets a Collection containing all child nodes of the same NodeType as "this" object. |
Collection<Content> |
getChildren(Content.ContentFilter filter)
Get a collection containing child nodes which satisfies the given filter. |
Collection<Content> |
getChildren(Content.ContentFilter filter,
Comparator<Content> orderCriteria)
Get a collection containing child nodes which satisfies the given filter. |
Collection<Content> |
getChildren(ItemType contentType)
Get collection of specified content type. |
Collection<Content> |
getChildren(String contentType)
Get collection of specified content type and its subtypes. |
Collection<Content> |
getChildren(String contentType,
String namePattern)
Get collection of specified content type. |
Content |
getContent(String name)
Gets the Content node of the current node with the specified name. |
String |
getHandle()
get a handle representing path relative to the content repository. |
HierarchyManager |
getHierarchyManager()
|
int |
getIndex()
This method returns the index of this node within the ordered set of its same-name sibling nodes. |
ItemType |
getItemType()
Get the magnolia ItemType. |
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. |
javax.jcr.lock.Lock |
getLock()
Returns the Lock object that applies to this node. |
MetaData |
getMetaData()
Returns the meta data of the current node. |
javax.jcr.nodetype.NodeType[] |
getMixinNodeTypes()
Returns an array of NodeType objects representing the mixin node types assigned to this node. |
String |
getName()
get node name. |
NodeData |
getNodeData(String name)
Returns a NodeData object. |
Collection<NodeData> |
getNodeDataCollection()
Gets all properties bind in NodeData object excluding JCR system properties. |
Collection<NodeData> |
getNodeDataCollection(String namePattern)
Gets all node datas matching the given pattern. |
javax.jcr.nodetype.NodeType |
getNodeType()
returns primary node type definition of the associated Node of this object. |
String |
getNodeTypeName()
returns primary node type name of the associated Node of this object. |
Content |
getParent()
get parent content object. |
String |
getTemplate()
Returns the template name which is assigned to this content. |
String |
getTitle()
|
String |
getUUID()
UUID of the node referenced by this object. |
ContentVersion |
getVersionedContent(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()
|
javax.jcr.Workspace |
getWorkspace()
get workspace to which this node attached to. |
boolean |
hasChildren()
|
boolean |
hasChildren(String contentType)
|
boolean |
hasContent(String name)
|
boolean |
hasMetaData()
checks if this node has a sub node with name MetaData. |
boolean |
hasMixin(String mixinName)
Checks whether or not given mixin is assigned to a type. |
boolean |
hasNodeData(String name)
|
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. |
boolean |
isNodeData(String path)
checks if the requested resource is an NodeData (Property). |
boolean |
isNodeType(String type)
evaluate primary node type of the associated Node of this object. |
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(String srcName,
String beforeName)
move current node to the specified location above the named beforename . |
void |
refresh(boolean keepChanges)
If keepChanges is false, this method discards all pending changes recorded in this session. |
void |
removeMixin(String type)
Removes the specified mixin node type from this node. |
void |
removeVersionHistory()
removes all versions of this node and associated version graph. |
void |
restore(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,
String relPath,
boolean removeExisting)
Restores the specified version to relPath, relative to this node. |
void |
restoreByLabel(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 succeeds. |
NodeData |
setNodeData(String name,
boolean value)
Sets the node data. |
NodeData |
setNodeData(String name,
Calendar value)
Sets the node data. |
NodeData |
setNodeData(String name,
Content value)
Sets the node data. |
NodeData |
setNodeData(String name,
double value)
Sets the node data. |
NodeData |
setNodeData(String name,
InputStream value)
Sets the node data. |
NodeData |
setNodeData(String name,
long value)
Sets the node data. |
NodeData |
setNodeData(String name,
Object value)
Sets the node data. |
NodeData |
setNodeData(String name,
String value)
Sets the node data. |
NodeData |
setNodeData(String name,
javax.jcr.Value value)
Sets the node data. |
NodeData |
setNodeData(String name,
javax.jcr.Value[] value)
Sets the node data. |
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. |
Method Detail |
---|
Content getContent(String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
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 operationContent createContent(String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
ItemType.CONTENT
will be use as the contents primary type.
name
- of the node to be created as Content
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 operationContent createContent(String name, String contentType) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
name
- of the node to be created as Content
contentType
- JCR node type as configured
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 operationContent createContent(String name, ItemType contentType) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
name
- of the node to be created as Content
contentType
- ItemType
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 operationString getTemplate()
String getTitle()
MetaData getMetaData()
Node
NodeData getNodeData(String name)
NodeData
object. If the node data does not exist (respectively if it has no
value) an empty representation is returned whose NodeData.isExist()
will return
false.
NodeData
objectString getName()
Node
NodeData createNodeData(String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
setNodeData(String, Object)
instead.
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData createNodeData(String name, int type) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
setNodeData(String, Object)
instead.
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData createNodeData(String name, javax.jcr.Value value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
setNodeData(String, Value)
instead.
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
NodeData createNodeData(String name, javax.jcr.Value[] value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
setNodeData(String, Value[])
instead.
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
NodeData createNodeData(String name, Object obj) throws javax.jcr.RepositoryException
setNodeData(String, Object)
instead.
javax.jcr.RepositoryException
NodeData setNodeData(String name, javax.jcr.Value value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, javax.jcr.Value[] value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, String value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, long value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, InputStream value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, double value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, boolean value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, Calendar value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, Content value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
NodeData setNodeData(String name, Object value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
void deleteNodeData(String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
- if an error occursvoid updateMetaData() throws javax.jcr.RepositoryException, AccessDeniedException
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.RepositoryException
- if an error occursCollection<Content> getChildren()
Collection<Content> getChildren(Content.ContentFilter filter)
filter
-
Collection<Content> getChildren(Content.ContentFilter filter, Comparator<Content> orderCriteria)
filter
- filter for the child nodesorderCriteria
- ordering for the selected child nodes; if null than no
particular order of the child nodes
Collection<Content> getChildren(String contentType)
contentType
- JCR node type as configured
Collection<Content> getChildren(ItemType contentType)
contentType
- ItemType
Collection<Content> getChildren(String contentType, String namePattern)
contentType
- JCR node type as configurednamePattern
-
Content getChildByName(String namePattern)
getContent(String)
or getChildren(String)
namePattern
- child node name
null
if not foundCollection<NodeData> getNodeDataCollection()
Collection<NodeData> getNodeDataCollection(String namePattern)
boolean hasChildren()
boolean hasChildren(String contentType)
contentType
- JCR node type as configured
collectionType
existsboolean hasContent(String name) throws javax.jcr.RepositoryException
name
-
javax.jcr.RepositoryException
- if an error occursboolean hasNodeData(String name) throws javax.jcr.RepositoryException
name
-
javax.jcr.RepositoryException
- if an error occursString getHandle()
Content getParent() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
javax.jcr.PathNotFoundException
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.RepositoryException
- if an error occursContent getAncestor(int level) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
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
Collection<Content> getAncestors() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.PathNotFoundException
int getLevel() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
- if an error occursvoid orderBefore(String srcName, String beforeName) throws javax.jcr.RepositoryException
beforename
.
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 occursint getIndex() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursjavax.jcr.Node getJCRNode()
boolean isNodeType(String type)
type
- javax.jcr.nodetype.NodeType getNodeType() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursString getNodeTypeName() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursItemType getItemType() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
void restore(String versionName, boolean removeExisting) throws javax.jcr.version.VersionException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
versionName
- removeExisting
-
javax.jcr.version.VersionException
- if the specified versionName
does not exist in this
node's version history
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.UnsupportedRepositoryOperationException
void restore(javax.jcr.version.Version version, boolean removeExisting) throws javax.jcr.version.VersionException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
version
- removeExisting
-
javax.jcr.version.VersionException
- if the specified version
is not part of this node's
version history
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.UnsupportedRepositoryOperationException
void restore(javax.jcr.version.Version version, String relPath, boolean removeExisting) throws javax.jcr.version.VersionException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
version
- relPath
- removeExisting
-
javax.jcr.version.VersionException
- if the specified version
is not part of this node's
version history
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.UnsupportedRepositoryOperationException
void restoreByLabel(String versionLabel, boolean removeExisting) throws javax.jcr.version.VersionException, javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
versionLabel
- removeExisting
-
javax.jcr.version.VersionException
- if the specified versionLabel
does not exist in this
node's version history
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.Version addVersion() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
- if an error occursjavax.jcr.version.Version addVersion(Rule rule) throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
rule
- to be used to collect content
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
- if an error occursRule
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
.
true
if this item is modified; false
otherwise.javax.jcr.version.VersionHistory getVersionHistory() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionIterator getAllVersions() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occurs
javax.jcr.UnsupportedRepositoryOperationException
ContentVersion getBaseVersion() throws javax.jcr.UnsupportedRepositoryOperationException, javax.jcr.RepositoryException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.RepositoryException
ContentVersion getVersionedContent(javax.jcr.version.Version version) throws javax.jcr.RepositoryException
version
-
javax.jcr.RepositoryException
ContentVersion
ContentVersion getVersionedContent(String versionName) throws javax.jcr.RepositoryException
versionName
-
javax.jcr.RepositoryException
ContentVersion
void removeVersionHistory() throws AccessDeniedException, javax.jcr.RepositoryException
AccessDeniedException
- If not allowed to do write operations on this node
javax.jcr.RepositoryException
- if unable to remove versions from version storevoid save() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursboolean isGranted(long permissions)
permissions
- as defined in javax.jcr.Permission
void delete() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursvoid delete(String path) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursboolean isNodeData(String path) throws AccessDeniedException, javax.jcr.RepositoryException
path
- of the requested NodeData
AccessDeniedException
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.RepositoryException
- if an error occursvoid refresh(boolean keepChanges) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursItem.refresh(boolean)
String getUUID()
void addMixin(String type) throws javax.jcr.RepositoryException
type
- mixin type to be added
javax.jcr.RepositoryException
- if an error occursvoid removeMixin(String type) throws javax.jcr.RepositoryException
type
- , mixin type to be removed
javax.jcr.RepositoryException
- if an error occursjavax.jcr.nodetype.NodeType[] getMixinNodeTypes() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursjavax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
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)
javax.jcr.lock.Lock lock(boolean isDeep, boolean isSessionScoped, long yieldFor) throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
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)
javax.jcr.lock.Lock getLock() throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
javax.jcr.lock.LockException
- If no lock applies to this node, a LockException is thrown.
javax.jcr.RepositoryException
- if an error occursvoid unlock() throws javax.jcr.lock.LockException, javax.jcr.RepositoryException
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 occursboolean holdsLock() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursboolean isLocked() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if an error occursjavax.jcr.Workspace getWorkspace() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
- if unable to get this node sessionAccessManager getAccessManager()
HierarchyManager getHierarchyManager()
boolean hasMetaData()
boolean hasMixin(String mixinName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |