public class JCRItemWrapperImpl extends Object implements JCRItemWrapper
javax.jcr.Item to be able to inject
Jahia specific actions.| Modifier and Type | Field and Description |
|---|---|
protected javax.jcr.Item |
item |
protected String |
localPath |
protected String |
localPathInProvider |
protected JCRStoreProvider |
provider |
protected JCRSessionWrapper |
session |
| Modifier | Constructor and Description |
|---|---|
protected |
JCRItemWrapperImpl(JCRSessionWrapper session,
JCRStoreProvider provider) |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(javax.jcr.ItemVisitor itemVisitor) |
JCRItemWrapper |
getAncestor(int i)
Item at the specified depth. |
String |
getCanonicalPath() |
int |
getDepth() |
String |
getName() |
JCRNodeWrapper |
getParent() |
String |
getPath() |
JCRSessionWrapper |
getSession() |
boolean |
isModified() |
boolean |
isNew() |
boolean |
isNode() |
boolean |
isSame(javax.jcr.Item otherItem) |
void |
refresh(boolean b) |
void |
remove() |
void |
save()
Deprecated.
As of JCR 2.0,
Session.save() should
be used instead. |
void |
saveSession()
Validates all pending changes currently recorded in this
Session that apply to this Item
or any of its descendants (that is, the subtree rooted at this Item). |
protected void |
setItem(javax.jcr.Item item) |
String |
toString()
Returns the path of this item for use in diagnostic output.
|
protected JCRStoreProvider provider
protected javax.jcr.Item item
protected String localPath
protected String localPathInProvider
protected JCRSessionWrapper session
protected JCRItemWrapperImpl(JCRSessionWrapper session, JCRStoreProvider provider)
protected void setItem(javax.jcr.Item item)
public String getPath()
getPath in interface javax.jcr.Itempublic String getCanonicalPath()
getCanonicalPath in interface JCRItemWrapperpublic String getName() throws javax.jcr.RepositoryException
getName in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic JCRItemWrapper getAncestor(int i) throws javax.jcr.ItemNotFoundException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
Item at the specified depth.getAncestor in interface javax.jcr.ItemgetAncestor in interface JCRItemWrapperItem at the specified depth.javax.jcr.ItemNotFoundExceptionjavax.jcr.AccessDeniedExceptionjavax.jcr.RepositoryExceptionpublic JCRNodeWrapper getParent() throws javax.jcr.ItemNotFoundException, javax.jcr.AccessDeniedException, javax.jcr.RepositoryException
getParent in interface javax.jcr.ItemgetParent in interface JCRItemWrapperItem.javax.jcr.UnsupportedRepositoryOperationException - as long as Jahia doesn't support itjavax.jcr.ItemNotFoundExceptionjavax.jcr.AccessDeniedExceptionjavax.jcr.RepositoryExceptionpublic int getDepth()
throws javax.jcr.RepositoryException
getDepth in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic JCRSessionWrapper getSession()
getSession in interface javax.jcr.ItemgetSession in interface JCRItemWrapperJCRSessionWrapper through which this Item was
acquired.public boolean isNode()
isNode in interface javax.jcr.Itempublic boolean isNew()
isNew in interface javax.jcr.Itempublic boolean isModified()
isModified in interface javax.jcr.Itempublic boolean isSame(javax.jcr.Item otherItem)
throws javax.jcr.RepositoryException
isSame in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic void accept(javax.jcr.ItemVisitor itemVisitor)
throws javax.jcr.RepositoryException
accept in interface javax.jcr.Itemjavax.jcr.RepositoryExceptionpublic void save()
throws javax.jcr.AccessDeniedException,
javax.jcr.ItemExistsException,
javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.InvalidItemStateException,
javax.jcr.ReferentialIntegrityException,
javax.jcr.version.VersionException,
javax.jcr.lock.LockException,
javax.jcr.nodetype.NoSuchNodeTypeException,
javax.jcr.RepositoryException
Session.save() should
be used instead.save in interface javax.jcr.Itemjavax.jcr.AccessDeniedExceptionjavax.jcr.ItemExistsExceptionjavax.jcr.nodetype.ConstraintViolationExceptionjavax.jcr.InvalidItemStateExceptionjavax.jcr.ReferentialIntegrityExceptionjavax.jcr.version.VersionExceptionjavax.jcr.lock.LockExceptionjavax.jcr.nodetype.NoSuchNodeTypeExceptionjavax.jcr.RepositoryExceptionpublic void saveSession()
throws javax.jcr.AccessDeniedException,
javax.jcr.ItemExistsException,
javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.InvalidItemStateException,
javax.jcr.ReferentialIntegrityException,
javax.jcr.version.VersionException,
javax.jcr.lock.LockException,
javax.jcr.nodetype.NoSuchNodeTypeException,
javax.jcr.RepositoryException
Session that apply to this Item
or any of its descendants (that is, the subtree rooted at this Item). If validation of all
pending changes succeeds, then this change information is cleared from the Session.
If the save occurs outside a transaction, the changes are persisted and thus
made visible to other Sessions. If the save occurs within a transaction,
the changes are not persisted until the transaction is committed.
If validation fails, then no pending changes are saved and they remain recorded on the Session.
There is no best-effort or partial save.
The item in persistent storage to which a transient item is saved is
determined by matching identifiers and paths.
An AccessDeniedException will be thrown if any of the changes
to be persisted would violate the access privileges of this
Session.
If any of the changes to be persisted would cause the removal of a node
that is currently the target of a REFERENCE property then a
ReferentialIntegrityException is thrown, provided that this Session has
read access to that REFERENCE property. If, on the other hand, this
Session does not have read access to the REFERENCE property in question,
then an AccessDeniedException is thrown instead.
An ItemExistsException will be thrown if any of the changes
to be persisted would be prevented by the presence of an already existing
item in the workspace.
A ConstraintViolationException will be thrown if any of the
changes to be persisted would violate a node type restriction.
Additionally, a repository may use this exception to enforce
implementation- or configuration-dependant restrictions.
An InvalidItemStateException is thrown if any of the
changes to be persisted conflicts with a change already persisted
through another session and the implementation is such that this
conflict can only be detected at save-time and therefore was not
detected earlier, at change-time.
A VersionException is thrown if the save would make a result in
a change to persistent storage that would violate the read-only status of a
checked-in node.
A LockException is thrown if the save would result
in a change to persistent storage that would violate a lock.
A NoSuchNodeTypeException is thrown if the save would result in the
addition of a node with an unrecognized node type.
A RepositoryException will be thrown if another error
occurs.saveSession in interface JCRItemWrapperjavax.jcr.AccessDeniedException - if any of the changes to be persisted would violate
the access privileges of the this Session. Also thrown if any of the
changes to be persisted would cause the removal of a node that is currently
referenced by a REFERENCE property that this Session
does not have read access to.javax.jcr.ItemExistsException - if any of the changes
to be persisted would be prevented by the presence of an already existing
item in the workspace.javax.jcr.nodetype.ConstraintViolationException - if any of the changes to be persisted would
violate a node type or restriction. Additionally, a repository may use this
exception to enforce implementation- or configuration-dependent restrictions.javax.jcr.InvalidItemStateException - if any of the
changes to be persisted conflicts with a change already persisted
through another session and the implementation is such that this
conflict can only be detected at save-time and therefore was not
detected earlier, at change-time.javax.jcr.ReferentialIntegrityException - if any of the
changes to be persisted would cause the removal of a node that is currently
referenced by a REFERENCE property that this Session
has read access to.javax.jcr.version.VersionException - if the save would make a result in
a change to persistent storage that would violate the read-only status of a
checked-in node.javax.jcr.lock.LockException - if the save would result in a
change to persistent storage that would violate a lock.javax.jcr.nodetype.NoSuchNodeTypeException - if the save would result in the
addition of a node with an unrecognized node type.javax.jcr.RepositoryException - if another error occurs.public void refresh(boolean b)
throws javax.jcr.InvalidItemStateException,
javax.jcr.RepositoryException
refresh in interface javax.jcr.Itemjavax.jcr.InvalidItemStateExceptionjavax.jcr.RepositoryExceptionpublic void remove()
throws javax.jcr.version.VersionException,
javax.jcr.lock.LockException,
javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.RepositoryException
remove in interface javax.jcr.Itemjavax.jcr.version.VersionExceptionjavax.jcr.lock.LockExceptionjavax.jcr.nodetype.ConstraintViolationExceptionjavax.jcr.RepositoryExceptionCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.