Modifier and Type | Class and Description |
---|---|
static class |
DBSSession.DBSDocumentListIterator |
Constructor and Description |
---|
DBSSession(DBSRepository repository,
String sessionId) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this session.
|
void |
commit() |
static String |
convToInternal(String name) |
static String |
convToNXQL(String name) |
Document |
copy(Document source,
Document parent,
String name)
Copies the source document to the given folder.
|
Document |
createChild(String id,
String parentId,
String name,
Long pos,
String typeName) |
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 id)
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 versionSeriesId,
VersionModel versionModel)
Gets a version of a document, given its versionable id and label.
|
Document |
importDocument(String id,
Document parent,
String name,
String typeName,
Map<String,Serializable> properties)
Imports a document with a given id and parent.
|
static boolean |
isArray(String name) |
static boolean |
isBoolean(String name) |
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 source,
Document parent,
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.
|
public DBSSession(DBSRepository repository, String sessionId)
public String getSessionId()
Session
getSessionId
in interface Session
public String getRepositoryName()
Session
getRepositoryName
in interface Session
public void close()
Session
public boolean isLive()
Session
public void save() throws DocumentException
Session
save
in interface Session
DocumentException
- if any error occurspublic void commit() throws DocumentException
DocumentException
public boolean isStateSharedByAllThreadSessions()
Session
true
if all sessions in the current thread share the same state.isStateSharedByAllThreadSessions
in interface Session
public Document resolvePath(String path) throws DocumentException
Session
resolvePath
in interface Session
DocumentException
- if any error occurspublic Document getDocumentByUUID(String id) throws DocumentException
Session
getDocumentByUUID
in interface Session
id
- the document idDocumentException
- if any error occurspublic Document getRootDocument() throws DocumentException
Session
getRootDocument
in interface Session
DocumentException
- if any error occurspublic Document getNullDocument() throws DocumentException
Session
getNullDocument
in interface Session
DocumentException
public Document createChild(String id, String parentId, String name, Long pos, String typeName) throws DocumentException
DocumentException
public Document copy(Document source, Document parent, String name) throws DocumentException
Session
If the destination document is not a folder, an exception is thrown.
copy
in interface Session
DocumentException
- if any error occurspublic Document move(Document source, Document parent, String name) throws DocumentException
Session
If the destination document is not a folder an exception is thrown.
move
in interface Session
source
- the source document to moveparent
- the destination foldername
- the new name of the document or null if the original name should be preservedDocumentException
- if any error occurspublic Document createProxy(Document doc, Document folder) throws DocumentException
Session
createProxy
in interface Session
doc
- the documentfolder
- the folderDocumentException
- if any error occurspublic Collection<Document> getProxies(Document doc, Document folder) throws DocumentException
Session
If the document is a version, then only proxies to that version will be looked up.
getProxies
in interface Session
doc
- the document or versionfolder
- the folder, or nullDocumentException
- if any error occurspublic void setProxyTarget(Document proxy, Document target) throws DocumentException
Session
The target must have the same version series as the proxy.
setProxyTarget
in interface Session
proxy
- the proxytarget
- the new targetDocumentException
public Document importDocument(String id, Document parent, String name, String typeName, Map<String,Serializable> properties) throws DocumentException
Session
The document can then be filled with the normal imported properties.
importDocument
in interface Session
id
- 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
public Document getVersion(String versionSeriesId, VersionModel versionModel) throws DocumentException
Session
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.
getVersion
in interface Session
versionSeriesId
- the versionable idversionModel
- the version modelnull
if not foundDocumentException
public boolean isNegativeAclAllowed()
Session
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.
isNegativeAclAllowed
in interface Session
true
if negative ACLs are allowedpublic ACP getMergedACP(Document doc) throws SecurityException
getMergedACP
in interface Session
SecurityException
public void setACP(Document doc, ACP acp, boolean overwrite) throws DocumentException
setACP
in interface Session
DocumentException
public Map<String,String> getBinaryFulltext(String id) throws DocumentException
Session
getBinaryFulltext
in interface Session
DocumentException
public DocumentModelList query(String query, String queryType, QueryFilter queryFilter, long countUpTo) throws QueryException
Session
query
in interface Session
QueryException
public IterableQueryResult queryAndFetch(String query, String queryType, QueryFilter queryFilter, Object[] params) throws QueryException
Session
queryAndFetch
in interface Session
QueryException
public static boolean isArray(String name)
public static boolean isBoolean(String name)
Copyright © 2015 Nuxeo SA. All rights reserved.