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.
|
ACP |
getMergedACP(Document doc) |
Document |
getNullDocument()
Gets the null document, to be used as a fake parent to add placeless children.
|
Collection<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.
|
String |
getSessionId()
Gets the session id.
|
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.
|
DocumentModelList |
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 getSessionId()
String getRepositoryName()
DocumentModelList query(String query, String queryType, QueryFilter queryFilter, long countUpTo) throws QueryException
QueryException
IterableQueryResult queryAndFetch(String query, String queryType, QueryFilter queryFilter, Object[] params) throws QueryException
QueryException
void save() throws DocumentException
DocumentException
- if any error occursboolean isLive()
boolean isStateSharedByAllThreadSessions()
true
if all sessions in the current thread share the same state.void close()
DocumentException
- if any error occursDocument resolvePath(String path) throws DocumentException
path
- DocumentException
- if any error occursDocument getDocumentByUUID(String uuid) throws DocumentException
uuid
- the document idDocumentException
- if any error occursDocument getRootDocument() throws DocumentException
DocumentException
- if any error occursDocument getNullDocument() throws DocumentException
DocumentException
Document copy(Document src, Document dst, String name) throws DocumentException
If the destination document is not a folder, an exception is thrown.
src
- dst
- name
- DocumentException
- if any error occursDocument move(Document src, Document dst, String name) throws DocumentException
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 preservedDocumentException
- if any error occursDocument createProxy(Document doc, Document folder) throws DocumentException
doc
- the documentfolder
- the folderDocumentException
- if any error occursCollection<Document> getProxies(Document doc, Document folder) throws DocumentException
If the document is a version, then only proxies to that version will be looked up.
doc
- the document or versionfolder
- the folder, or nullDocumentException
- if any error occursvoid setProxyTarget(Document proxy, Document target) throws DocumentException
The target must have the same version series as the proxy.
proxy
- the proxytarget
- the new targetDocumentException
Document importDocument(String uuid, Document parent, String name, String typeName, Map<String,Serializable> properties) throws DocumentException
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 versionsDocumentException
Document getVersion(String versionableId, VersionModel versionModel) throws DocumentException
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 foundDocumentException
boolean 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) throws SecurityException
SecurityException
void setACP(Document doc, ACP acp, boolean overwrite) throws DocumentException
DocumentException
Map<String,String> getBinaryFulltext(String id) throws DocumentException
DocumentException
Copyright © 2015 Nuxeo SA. All rights reserved.