Modifier and Type | Class and Description |
---|---|
static class |
SQLSession.PathComparator |
Modifier and Type | Field and Description |
---|---|
static String |
ALLOW_NEGATIVE_ACL_PROPERTY
Framework property to control whether negative ACLs (deny) are allowed.
|
static String |
APPLICATION_OCTET_STREAM |
static String |
BLOB_DATA |
static String |
BLOB_DIGEST |
static String |
BLOB_ENCODING |
static String |
BLOB_LENGTH |
static String |
BLOB_MIME_TYPE |
static String |
BLOB_NAME |
static String |
DC_ISSUED |
static String |
RELATED_TEXT |
static String |
RELATED_TEXT_ID |
static String |
RELATED_TEXT_RESOURCES |
Constructor and Description |
---|
SQLSession(Session session,
Repository repository,
String sessionId) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this session.
|
Document |
copy(Document source,
Document parent,
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.
|
Document |
getLastVersion(String versionSeriesId) |
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 document,
Document parent)
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 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.
|
Map<String,Serializable> |
readPrefetch(Node node,
ComplexType complexType,
Set<String> xpaths,
SQLDocument doc)
Recursively reads prefetched properties.
|
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 static final String ALLOW_NEGATIVE_ACL_PROPERTY
public static final String BLOB_NAME
public static final String BLOB_MIME_TYPE
public static final String BLOB_ENCODING
public static final String BLOB_DIGEST
public static final String BLOB_LENGTH
public static final String BLOB_DATA
public static final String APPLICATION_OCTET_STREAM
public static final String DC_ISSUED
public static final String RELATED_TEXT_RESOURCES
public static final String RELATED_TEXT_ID
public static final String RELATED_TEXT
public SQLSession(Session session, Repository repository, String sessionId) throws DocumentException
DocumentException
public Document getRootDocument()
Session
getRootDocument
in interface Session
public Document getNullDocument()
Session
getNullDocument
in interface Session
public void close()
Session
public void save() throws DocumentException
Session
save
in interface Session
DocumentException
- if any error occurspublic boolean isLive()
Session
public boolean isStateSharedByAllThreadSessions()
Session
true
if all sessions in the current thread share the same state.isStateSharedByAllThreadSessions
in interface Session
public String getSessionId()
Session
getSessionId
in interface Session
public String getRepositoryName()
Session
getRepositoryName
in interface Session
public Document getDocumentByUUID(String uuid) throws DocumentException
Session
getDocumentByUUID
in interface Session
uuid
- the document idDocumentException
- if any error occurspublic Document resolvePath(String path) throws DocumentException
Session
resolvePath
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 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 getVersion(String versionableId, 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
versionableId
- the versionable idversionModel
- the version modelnull
if not foundDocumentException
public 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 document, Document parent) throws DocumentException
Session
If the document is a version, then only proxies to that version will be looked up.
getProxies
in interface Session
document
- the document or versionparent
- 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 uuid, 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
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
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 Document getLastVersion(String versionSeriesId) throws DocumentException
DocumentException
public Map<String,Serializable> readPrefetch(Node node, ComplexType complexType, Set<String> xpaths, SQLDocument doc) throws PropertyException
PropertyException
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 void setACP(Document doc, ACP acp, boolean overwrite) throws SecurityException
setACP
in interface Session
SecurityException
public ACP getMergedACP(Document doc) throws SecurityException
getMergedACP
in interface Session
SecurityException
public Map<String,String> getBinaryFulltext(String id) throws DocumentException
Session
getBinaryFulltext
in interface Session
DocumentException
Copyright © 2015 Nuxeo SA. All rights reserved.