|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Session
The session is the main high level access point to data from the underlying database.
Nested Class Summary | |
---|---|
static interface |
Session.PathResolver
Interface for a class that knows how to resolve a node path into a node id. |
Method Summary | |
---|---|
Node |
addChildNode(Node parent,
java.lang.String name,
java.lang.Long pos,
java.lang.String typeName,
boolean complexProp)
Creates a new child node. |
Node |
addChildNode(java.io.Serializable id,
Node parent,
java.lang.String name,
java.lang.Long pos,
java.lang.String typeName,
boolean complexProp)
Creates a new child node with given id (used for import). |
Node |
addProxy(java.io.Serializable targetId,
java.io.Serializable versionSeriesId,
Node parent,
java.lang.String name,
java.lang.Long pos)
Creates a proxy for a version node. |
Node |
checkIn(Node node,
java.lang.String label,
java.lang.String checkinComment)
Checks in a checked-out node: creates a new version with a copy of its information. |
void |
checkOut(Node node)
Checks out a checked-in node. |
Node |
copy(Node source,
Node parent,
java.lang.String name)
Copies a node to a new location with a new name. |
Binary |
getBinary(java.io.InputStream in)
Creates a binary value given an input stream. |
Node |
getChildNode(Node parent,
java.lang.String name,
boolean complexProp)
Gets a child node given its parent and name. |
java.util.List<Node> |
getChildren(Node parent,
java.lang.String name,
boolean complexProp)
Gets the children of a node. |
Node |
getLastVersion(java.io.Serializable versionSeriesId)
Gets the last version for a given version series id. |
Mapper |
getMapper()
Gets the low-level Mapper for this session. |
Model |
getModel()
Gets the Model associated to this session. |
Node |
getNodeById(java.io.Serializable id)
Gets a node given its id. |
Node |
getNodeByPath(java.lang.String path,
Node node)
Gets a node given its absolute path, or given an existing node and a relative path. |
java.util.List<Node> |
getNodesByIds(java.util.List<java.io.Serializable> ids)
Gets several nodes given their ids. |
Node |
getParentNode(Node node)
Gets the parent of a node. |
java.lang.String |
getPath(Node node)
Gets the absolute path of a node. |
java.util.List<Node> |
getProxies(Node document,
Node parent)
Finds the proxies for a document. |
java.lang.String |
getRepositoryName()
Gets the session repository name. |
Node |
getRootNode()
Gets the root node of the repository. |
Node |
getVersionByLabel(java.io.Serializable versionSeriesId,
java.lang.String label)
Gets a version given its version series id and label. |
java.util.List<Node> |
getVersions(java.io.Serializable versionSeriesId)
Gets all the versions for a given version series id. |
boolean |
hasChildNode(Node parent,
java.lang.String name,
boolean complexProp)
Checks if a child node with the given name exists. |
boolean |
hasChildren(Node parent,
boolean complexProp)
Checks it a node has children. |
boolean |
isLive()
Checks if the session is live (not closed). |
Node |
move(Node source,
Node parent,
java.lang.String name)
Moves a node to a new location with a new name. |
void |
orderBefore(Node parent,
Node source,
Node dest)
Order the given source child node before the destination child node. |
PartialList<java.io.Serializable> |
query(java.lang.String query,
QueryFilter queryFilter,
boolean countTotal)
Makes a NXQL query to the database. |
IterableQueryResult |
queryAndFetch(java.lang.String query,
java.lang.String queryType,
QueryFilter queryFilter,
java.lang.Object... params)
Makes a query to the database and returns an iterable (which must be closed when done). |
void |
rebuildReadAcls()
Rebuild the read ACLs for the whole repository. |
void |
removeNode(Node node)
Removes a node from the storage. |
void |
requireReadAclsUpdate()
Read ACLs are optimized ACLs for the read permission, they need to be updated after document creation or ACL change. |
void |
restore(Node node,
Node version)
Restores a node to a given version. |
void |
save()
Saves the modifications to persistent storage. |
void |
updateReadAcls()
Update only the read ACLs that have changed. |
Methods inherited from interface javax.resource.cci.Connection |
---|
close, createInteraction, getLocalTransaction, getMetaData, getResultSetInfo |
Method Detail |
---|
Mapper getMapper() throws StorageException
StorageException
boolean isLive()
true
if the session is livejava.lang.String getRepositoryName() throws StorageException
StorageException
Model getModel() throws StorageException
Model
associated to this session.
StorageException
void save() throws StorageException
Modifications will be actually written only upon transaction commit.
StorageException
Node getRootNode() throws StorageException
StorageException
Node getNodeById(java.io.Serializable id) throws StorageException
id
- the id
null
if not found
StorageException
java.util.List<Node> getNodesByIds(java.util.List<java.io.Serializable> ids) throws StorageException
ids
- the ids
null
if not found
StorageException
Node getNodeByPath(java.lang.String path, Node node) throws StorageException
path
- the pathnode
- the node (ignored for absolute paths)
null
if not found
StorageException
Node getParentNode(Node node) throws StorageException
The root has a null
parent.
node
- the node
null
for the root's parent
StorageException
java.lang.String getPath(Node node) throws StorageException
node
- the node
StorageException
boolean hasChildNode(Node parent, java.lang.String name, boolean complexProp) throws StorageException
There are two kinds of children, the regular children documents and the
complex properties. The boolean
allows a
choice between those.
parent
- the parent nodename
- the child namecomplexProp
- whether to check complex properties or regular
children
true
if a child node with that name exists
StorageException
Node getChildNode(Node parent, java.lang.String name, boolean complexProp) throws StorageException
parent
- the parent nodename
- the child namecomplexProp
- whether to check complex properties or regular
children
null
is not found
StorageException
boolean hasChildren(Node parent, boolean complexProp) throws StorageException
parent
- the parent nodecomplexProp
- whether to check complex properties or regular
children
true
if the parent has children
StorageException
java.util.List<Node> getChildren(Node parent, java.lang.String name, boolean complexProp) throws StorageException
parent
- the parent nodename
- the children name to get (for lists of complex properties),
or null
for allcomplexProp
- whether to check complex properties or regular
children
StorageException
Node addChildNode(Node parent, java.lang.String name, java.lang.Long pos, java.lang.String typeName, boolean complexProp) throws StorageException
parent
- the parent to which the child is addedname
- the child namepos
- the child position, or null
typeName
- the child typecomplexProp
- whether this is a complex property (true
) or a
regular child (false
)
StorageException
Node addChildNode(java.io.Serializable id, Node parent, java.lang.String name, java.lang.Long pos, java.lang.String typeName, boolean complexProp) throws StorageException
id
- the idparent
- the parent to which the child is addedname
- the child namepos
- the child position, or null
typeName
- the child typecomplexProp
- whether this is a complex property (true
) or a
regular child (false
)
StorageException
Node addProxy(java.io.Serializable targetId, java.io.Serializable versionSeriesId, Node parent, java.lang.String name, java.lang.Long pos) throws StorageException
targetId
- the target idversionSeriesId
- the version series idparent
- the parent to which the proxy is addedname
- the proxy namepos
- the proxy position
StorageException
void removeNode(Node node) throws StorageException
node
- the node to remove
StorageException
void orderBefore(Node parent, Node source, Node dest) throws StorageException
null
, the source node will be appended at the end of the children
list.
parent
- the parent nodesource
- the child node to movedest
- the child node before which to place the source node, or
null
to move at the end
StorageException
Node move(Node source, Node parent, java.lang.String name) throws StorageException
A save()
is automatically done first.
source
- the node to moveparent
- the new parent to which the node is movedname
- the new node name
StorageException
Node copy(Node source, Node parent, java.lang.String name) throws StorageException
A save()
is automatically done first.
source
- the node to copyparent
- the new parent to which the node is copiedname
- the new node name
StorageException
Node checkIn(Node node, java.lang.String label, java.lang.String checkinComment) throws StorageException
A save()
is automatically done first.
node
- the node to check inlabel
- the label for the versioncheckinComment
- the description for the version
StorageException
void checkOut(Node node) throws StorageException
node
- the node to check out
StorageException
void restore(Node node, Node version) throws StorageException
The restored node is checked in.
node
- the node to restoreversion
- the version to restore from
StorageException
Node getVersionByLabel(java.io.Serializable versionSeriesId, java.lang.String label) throws StorageException
versionSeriesId
- the version series idlabel
- the label
null
if not found
StorageException
java.util.List<Node> getVersions(java.io.Serializable versionSeriesId) throws StorageException
A save()
is automatically done first.
versionSeriesId
- the version series id
StorageException
Node getLastVersion(java.io.Serializable versionSeriesId) throws StorageException
A save()
is automatically done first.
versionSeriesId
- the version series id
null
if no versions exist
StorageException
Binary getBinary(java.io.InputStream in) throws StorageException
in
- the input stream
StorageException
java.util.List<Node> getProxies(Node document, Node parent) throws StorageException
If the document is a version, then only proxies to that version will be looked up.
Otherwise all proxies to the same version series than the document are retrieved.
A save()
is automatically done first.
document
- the documentparent
- the parent, or null
StorageException
PartialList<java.io.Serializable> query(java.lang.String query, QueryFilter queryFilter, boolean countTotal) throws StorageException
query
- the queryqueryFilter
- the query filtercountTotal
- if true
, also count the total size without
offset/limit
StorageException
IterableQueryResult queryAndFetch(java.lang.String query, java.lang.String queryType, QueryFilter queryFilter, java.lang.Object... params) throws StorageException
query
- the queryqueryType
- the query typequeryFilter
- the query filterparams
- optional query-type-dependent parameters
StorageException
void requireReadAclsUpdate()
This method flag the current session, the read ACLs update will be done automatically at save time.
void updateReadAcls() throws StorageException
StorageException
void rebuildReadAcls() throws StorageException
StorageException
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |