public interface Session
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this session.
|
Document |
copy(Document src,
Document dst,
String name)
Copies the source document to the given folder.
|
Document |
createProxy(Document doc,
Document folder)
Creates a generic proxy to the given document inside the given folder.
|
Map<String,String> |
getBinaryFulltext(String id)
Gets the fulltext extracted from the binary fields.
|
Document |
getDocumentByUUID(String uuid)
Gets a document given its ID.
|
LockManager |
getLockManager()
Gets the lock manager for this session.
|
ACP |
getMergedACP(Document doc) |
Document |
getNullDocument()
Gets the null document, to be used as a fake parent to add placeless children.
|
List<Document> |
getProxies(Document doc,
Document folder)
Finds the proxies for a document.
|
String |
getRepositoryName()
Gets the repository that created this session.
|
Document |
getRootDocument()
Gets the root document in this repository.
|
Document |
getVersion(String versionableId,
VersionModel versionModel)
Gets a version of a document, given its versionable id and label.
|
Document |
importDocument(String uuid,
Document parent,
String name,
String typeName,
Map<String,Serializable> properties)
Imports a document with a given id and parent.
|
boolean |
isLive()
Checks whether the session is alive.
|
boolean |
isNegativeAclAllowed()
Returns
true if negative ACLs are allowed. |
boolean |
isStateSharedByAllThreadSessions()
Returns
true if all sessions in the current thread share the same state. |
Document |
move(Document src,
Document dst,
String name)
Moves the source document to the given folder.
|
PartialList<Document> |
query(String query,
String queryType,
QueryFilter queryFilter,
long countUpTo)
Does a query.
|
IterableQueryResult |
queryAndFetch(String query,
String queryType,
QueryFilter queryFilter,
Object[] params)
Does a query and fetch the individual results as maps.
|
Document |
resolvePath(String path)
Gets the document at the given path, if any.
|
void |
save()
Saves this session.
|
void |
setACP(Document doc,
ACP acp,
boolean overwrite) |
void |
setProxyTarget(Document proxy,
Document target)
Sets a proxies' target.
|
static final String USER_NAME
String getRepositoryName()
PartialList<Document> query(String query, String queryType, QueryFilter queryFilter, long countUpTo)
IterableQueryResult queryAndFetch(String query, String queryType, QueryFilter queryFilter, Object[] params)
LockManager getLockManager()
void save()
boolean isLive()
boolean isStateSharedByAllThreadSessions()
true
if all sessions in the current thread share the same state.void close()
Document resolvePath(String path) throws DocumentNotFoundException
path
- DocumentNotFoundException
- if the document doesn't existDocument getDocumentByUUID(String uuid) throws DocumentNotFoundException
uuid
- the document idDocumentNotFoundException
- if the document doesn't existDocument getRootDocument()
Document getNullDocument()
Document copy(Document src, Document dst, String name)
If the destination document is not a folder, an exception is thrown.
src
- dst
- name
- Document move(Document src, Document dst, String name)
If the destination document is not a folder an exception is thrown.
src
- the source document to movedst
- the destination foldername
- the new name of the document or null if the original name should be preservedDocument createProxy(Document doc, Document folder)
doc
- the documentfolder
- the folderList<Document> getProxies(Document doc, Document folder)
If the document is a version, then only proxies to that version will be looked up.
doc
- the document or versionfolder
- the folder, or nullvoid setProxyTarget(Document proxy, Document target)
The target must have the same version series as the proxy.
proxy
- the proxytarget
- the new targetDocument importDocument(String uuid, Document parent, String name, String typeName, Map<String,Serializable> properties)
The document can then be filled with the normal imported properties.
uuid
- the document uuidparent
- the document parent, or null
for a versionname
- the document name in its parenttypeName
- the document type, or ecm:proxy
for a proxyproperties
- system properties of the document, which will vary depending whether it's a live document, a
version or a proxy (see the various IMPORT_*
constants of CoreSession
)Document
, even for proxies and versionsDocument getVersion(String versionableId, VersionModel versionModel)
The version model contains the label of the version to look for. On return, it is filled with the version's description and creation date.
versionableId
- the versionable idversionModel
- the version modelnull
if not foundboolean isNegativeAclAllowed()
true
if negative ACLs are allowed.
Negative ACLs are ACLs that include an ACE with a deny (isGranted=false). This does not include the full-blocking ACE for Everyone/Everything, which is always allowed.
true
if negative ACLs are allowedACP getMergedACP(Document doc)
Map<String,String> getBinaryFulltext(String id)
Copyright © 2015 Nuxeo SA. All rights reserved.