public class Document extends Object implements Serializable
Constructor and Description |
---|
Document()
Constructor that should be considered to have a protected signature rather than public and may be used for extending classes to
create a new Document.
|
Document(Document document)
Copy constructor which allows to pass on a lightweight Document using its internal backing Node
|
Document(javax.jcr.Node node)
Extended classes must honor this constructor!
|
Document(String identity)
Lightweight constructor of a Document only providing a identity.
|
Modifier and Type | Method and Description |
---|---|
protected Boolean |
getBooleanProperty(String relPath) |
protected javax.jcr.Node |
getCheckedOutNode() |
javax.jcr.Node |
getCheckedOutNode(javax.jcr.Session session)
Returns the ensured to be checked out backing Node of this Document, either directly if available and already
tied to the provided Session or else retrieved from the provided Session based on its
getIdentity() . |
protected Date |
getDateProperty(String relPath) |
String |
getIdentity()
Obtain the identity, if known at this point, of a document.
|
protected Long |
getLongProperty(String relPath) |
protected javax.jcr.Node |
getNode() |
javax.jcr.Node |
getNode(javax.jcr.Session session)
Returns the backing Node of this Document, either directly if available and already tied to the provided Session
or else retrieved from the provided Session based on its
getIdentity() . |
protected javax.jcr.Node |
getNodeProperty(String relPath) |
protected String |
getStringProperty(String relPath) |
protected String[] |
getStringsProperty(String relPath) |
boolean |
hasNode() |
protected void |
initialize(javax.jcr.Node node)
Extended classes which need custom/extra initialization based on the backing Node should
use the
initialized() method to get wired into the initialization chain. |
protected void |
initialized()
Extended classes which need custom/extra initialization based on the backing Node can
use this method which will get called after
initialize(javax.jcr.Node) has been called. |
protected void |
setBooleanProperty(String relPath,
Boolean newValue) |
protected void |
setDateProperty(String relPath,
Date date) |
protected void |
setLongProperty(String relPath,
Long newValue) |
protected void |
setNodeProperty(String relPath,
javax.jcr.Node nodeValue) |
protected void |
setStringProperty(String relPath,
String value) |
protected void |
setStringsProperty(String relPath,
String[] values) |
String |
toString() |
public Document()
public Document(String identity)
identity
- the identifier of a backing Node
in the repository that this document instance represents.public Document(Document document)
document
- source document to copy the identity and possible the internal backing Node frompublic Document(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
- the backing Node
in the repository that this document instance represents.javax.jcr.RepositoryException
public javax.jcr.Node getNode(javax.jcr.Session session) throws javax.jcr.RepositoryException
getIdentity()
.session
- The session for which to return the backing Nodejavax.jcr.RepositoryException
public javax.jcr.Node getCheckedOutNode(javax.jcr.Session session) throws javax.jcr.RepositoryException
getIdentity()
.session
- The session for which to return the backing Nodejavax.jcr.RepositoryException
public boolean hasNode()
public final String getIdentity()
Node
used in persisting the data of the document.
A Document returned for example by a workflow step can be accessed
using:
Node node = session.getNodeByIdentifier(document.getIdentity());or even easier and possibly more efficient:
Node node = document.getNode(session);
null
if not available.protected javax.jcr.Node getNode()
protected javax.jcr.Node getCheckedOutNode() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected final void initialize(javax.jcr.Node node) throws javax.jcr.RepositoryException
initialized()
method to get wired into the initialization chain.node
- the backing Node
in the repository that this document instance represents.javax.jcr.RepositoryException
protected void initialized()
initialize(javax.jcr.Node)
has been called.protected String getStringProperty(String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void setStringProperty(String relPath, String value) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected String[] getStringsProperty(String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void setStringsProperty(String relPath, String[] values) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected javax.jcr.Node getNodeProperty(String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void setNodeProperty(String relPath, javax.jcr.Node nodeValue) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected Date getDateProperty(String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void setDateProperty(String relPath, Date date) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected Long getLongProperty(String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void setLongProperty(String relPath, Long newValue) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected Boolean getBooleanProperty(String relPath) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected void setBooleanProperty(String relPath, Boolean newValue) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Copyright © 2007–2019 Hippo B.V. (http://www.onehippo.com). All rights reserved.