Interface Session<T extends QueryFilter>
- All Known Implementing Classes:
BaseSession
,DBSSession
,SQLSession
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
commit()
Commit the transaction.Copies the source document to the given folder.createProxy
(Document doc, Document folder) Creates a generic proxy to the given document inside the given folder.void
destroy()
Destroys this session.void
end()
Called just before the transaction is committed or rolled back.Gets the fulltext extracted from the binary fields.getDocumentByUUID
(String uuid) Gets a document given its ID.Gets the lock manager for this session.getMergedACP
(Document doc) Gets the null document, to be used as a fake parent to add placeless children.getProxies
(Document doc) Finds the proxies for a document.getProxies
(Document doc, Document folder) Finds the proxies for a document.Gets the repository that created this session.Gets the root document in this repository.getVersion
(String versionableId, VersionModel versionModel) Gets a version of a document, given its versionable id and label.importDocument
(String uuid, Document parent, String name, String typeName, Map<String, Serializable> properties) Imports a document with a given id and parent.boolean
Checks if fulltext extracted from the binary fields is internally stored as a blob.boolean
Returnstrue
if negative ACLs are allowed.Moves the source document to the given folder.Does a query.queryAndFetch
(String query, String queryType, T queryFilter, boolean distinctDocuments, Object[] params) Does a query and fetch the individual results as maps.queryProjection
(String query, String queryType, T queryFilter, boolean distinctDocuments, long countUpTo, Object[] params) Does a query and fetch the individual results as maps.void
removeDocument
(String id) Removes a document.resolvePath
(String path) Gets the document at the given path, if any.void
rollback()
Rollback the transaction.void
save()
Saves this session.Get the next batch of result containing id of documents.Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.void
void
setProxyTarget
(Document proxy, Document target) Sets a proxies' target.void
start()
Start the transaction.void
updateReadACLs
(Collection<String> docIds) Updates the Read ACLs for some documents.
-
Field Details
-
USER_NAME
- See Also:
-
PROP_ALLOW_DELETE_UNDELETABLE_DOCUMENTS
INTERNAL framework property allowing deletion of undeletable documents. Should only be used in tests.Note that even when this is set, a low-level blob provider may still disallow blob removal.
- Since:
- 11.1
- See Also:
-
PROP_RETENTION_COMPLIANCE_MODE_ENABLED
Deprecated.since 2023.1, usePROP_RETENTION_STRICT_MODE_ENABLED
instead.Property to enable retention compliance mode. By default, retention runs in governance mode.Compliance mode is the strictest where nobody can delete documents under retention or legal hold.
Governance (or standard) mode is less strict and allows users member of the
SecurityConstants.RECORDS_CLEANER_GROUP
group to delete records.See Nuxeo Retention Documentation for further details.
- Since:
- 11.5
- See Also:
-
PROP_RETENTION_STRICT_MODE_ENABLED
Property to enable retention strict mode. False by default.In strict mode, nobody can delete documents under retention or legal hold.
Otherwise users member of the
SecurityConstants.RECORDS_CLEANER_GROUP
group can delete records.- Since:
- 2023.1
- See Also:
-
-
Method Details
-
getRepositoryName
String getRepositoryName()Gets the repository that created this session.- Returns:
- the repository
-
query
Does a query.- Since:
- 5.9.4
-
queryAndFetch
IterableQueryResult queryAndFetch(String query, String queryType, T queryFilter, boolean distinctDocuments, Object[] params) Does a query and fetch the individual results as maps. -
queryProjection
PartialList<Map<String,Serializable>> queryProjection(String query, String queryType, T queryFilter, boolean distinctDocuments, long countUpTo, Object[] params) Does a query and fetch the individual results as maps.- Since:
- 7.10-HF25, 8.10-HF06, 9.2
-
scroll
Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.- Since:
- 8.4
-
scroll
Executes the given query and returns the first batch of results containing id of documents, next batch must be requested within the keepAliveSeconds delay.- Since:
- 10.3
-
scroll
Get the next batch of result containing id of documents.- Since:
- 8.4
-
getLockManager
LockManager getLockManager()Gets the lock manager for this session.- Returns:
- the lock manager
- Since:
- 7.4
-
save
void save()Saves this session. -
destroy
void destroy()Destroys this session. -
resolvePath
Gets the document at the given path, if any.- Throws:
DocumentNotFoundException
- if the document doesn't exist
-
getDocumentByUUID
Gets a document given its ID.- Parameters:
uuid
- the document id- Returns:
- the document
- Throws:
DocumentNotFoundException
- if the document doesn't exist
-
getRootDocument
Document getRootDocument()Gets the root document in this repository.- Returns:
- the root document
-
getNullDocument
Document getNullDocument()Gets the null document, to be used as a fake parent to add placeless children.- Returns:
- the null document
-
copy
Copies the source document to the given folder.If the destination document is not a folder, an exception is thrown.
-
move
Moves the source document to the given folder.If the destination document is not a folder an exception is thrown.
- Parameters:
src
- the source document to movedst
- the destination foldername
- the new name of the document or null if the original name should be preserved
-
createProxy
Creates a generic proxy to the given document inside the given folder.- Parameters:
doc
- the documentfolder
- the folder- Returns:
- the proxy
-
getProxies
Finds the proxies for a document. If the folder is not null, the search will be limited to its children.If the document is a version, then only proxies to that version will be looked up.
- Parameters:
doc
- the document or versionfolder
- the folder, or null- Returns:
- the list of proxies if any is found otherwise an empty list
- Since:
- 1.4.1 for the case where doc is a proxy
-
getProxies
Finds the proxies for a document. (The document may be a version or a live document)- Parameters:
doc
- the document or version- Returns:
- the list of proxies if any is found otherwise an empty list
- Since:
- 10.2
-
setProxyTarget
Sets a proxies' target.The target must have the same version series as the proxy.
- Parameters:
proxy
- the proxytarget
- the new target- Since:
- 5.5
-
importDocument
Document importDocument(String uuid, Document parent, String name, String typeName, Map<String, Serializable> properties) Imports a document with a given id and parent.The document can then be filled with the normal imported properties.
- Parameters:
uuid
- the document uuidparent
- the document parent, ornull
for a versionname
- the document name in its parenttypeName
- the document type, orecm: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 variousIMPORT_*
constants ofCoreSession
)- Returns:
- a writable
Document
, even for proxies and versions
-
getVersion
Gets a version of a document, given its versionable id and label.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.
- Parameters:
versionableId
- the versionable idversionModel
- the version model- Returns:
- the version, or
null
if not found
-
isNegativeAclAllowed
boolean isNegativeAclAllowed()Returnstrue
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.
- Returns:
true
if negative ACLs are allowed- Since:
- 6.0
-
getMergedACP
-
setACP
-
updateReadACLs
Updates the Read ACLs for some documents.- Parameters:
docIds
- the document ids- Since:
- 9.10
-
isFulltextStoredInBlob
boolean isFulltextStoredInBlob()Checks if fulltext extracted from the binary fields is internally stored as a blob.- Returns:
true
if fulltext from binaries is store as a blob- Since:
- 11.1
-
getBinaryFulltext
Gets the fulltext extracted from the binary fields.- Since:
- 5.9.3
-
removeDocument
Removes a document. In DBS, this removal is done without checking if proxies are targeting the document, or if it has any children.- Parameters:
id
- the document id- Since:
- 11.1
-
start
void start()Start the transaction.- Since:
- 11.1
-
end
void end()Called just before the transaction is committed or rolled back.- Since:
- 11.1
-
commit
void commit()Commit the transaction.- Since:
- 11.1
-
rollback
void rollback()Rollback the transaction.- Since:
- 11.1
-
PROP_RETENTION_STRICT_MODE_ENABLED
instead.