public class WSIndexingGatewayBean extends AbstractNuxeoWebService implements WSIndexingGateway
Modifier and Type | Field and Description |
---|---|
protected IndexingAdapter |
adapter |
protected WSAudit |
auditBean |
protected static boolean |
DEPRECATION_DONE |
protected static String |
ENFORCE_SYNC_PROP_NAME |
protected Boolean |
enforceSync |
protected static org.apache.commons.logging.Log |
log |
protected NuxeoRemoting |
platformRemoting |
protected ConcurrentHashMap<String,ReentrantLock> |
sessionIdLocks |
Constructor and Description |
---|
WSIndexingGatewayBean() |
Modifier and Type | Method and Description |
---|---|
String |
connect(String username,
String password)
Connects to the default nuxeo core repository.
|
void |
disconnect(String sid)
Disconnect the Nuxeo core given the session id.
|
protected boolean |
forceSync() |
protected IndexingAdapter |
getAdapter() |
DocumentDescriptor[] |
getChildren(String sessionId,
String uuid)
Gets the children of the given document.
|
DocumentDescriptor |
getCurrentVersion(String sid,
String uid)
Gets the current version of the given document.
|
DocumentDescriptor |
getDocument(String sessionId,
String uuid)
Gets the doc descriptor given the doc UUID.
|
WsACE[] |
getDocumentACL(String sid,
String uuid)
Returns the merged ACL of the document (contains all ACEs defined on the document and its parents).
|
DocumentBlob[] |
getDocumentBlobs(String sid,
String uuid)
Returns the document blobs only using byte[] format
|
DocumentBlob[] |
getDocumentBlobsExt(String sid,
String uuid,
boolean useDownloadUrl)
Returns the document blobs only.
|
DocumentDescriptor |
getDocumentFromPath(String sessionId,
String path) |
WsACE[] |
getDocumentLocalACL(String sid,
String uuid)
Returns the merged ACL of the document (contains all ACEs defined on the document, filtering the inherited ones).
|
DocumentProperty[] |
getDocumentNoBlobProperties(String sid,
String uuid)
Same as
NuxeoRemoting.getDocumentProperties(String, String) but skips blobs. |
DocumentProperty[] |
getDocumentProperties(String sid,
String uuid)
Returns the document properties.
|
DocumentSnapshot |
getDocumentSnapshot(String sessionId,
String uuid)
Gets all properties and ACLs from a document uses byte[] format to export blob
|
DocumentSnapshot |
getDocumentSnapshotExt(String sessionId,
String uuid,
boolean useDownloadUrl)
Gets all properties and ACLs from a document
|
String[] |
getGroups(String sid,
String parentGroup)
Gets all sub-groups inside the given group.
|
String[] |
getRecursiveChildrenUUIDs(String sid,
String uuid) |
UUIDPage |
getRecursiveChildrenUUIDsByPage(String sid,
String uuid,
int page,
int pageSize) |
String |
getRelativePathAsString(String sessionId,
String uuid)
Returns the relative path as a displayable path with parent titles.
|
String |
getRepositoryName(String sid)
Gets the current repository name.
|
DocumentDescriptor |
getRootDocument(String sessionId)
Gets the root document descriptor.
|
DocumentDescriptor |
getSourceDocument(String sid,
String uid)
Gets the document that created the version specified by the given uid.
|
DocumentTypeDescriptor[] |
getTypeDefinitions() |
String[] |
getUserGroups(String sessionId,
String username) |
String[] |
getUsers(String sid,
String parentGroup)
Get all users inside the given group.
|
DocumentDescriptor[] |
getVersions(String sid,
String uid)
Gets the versions of the given document.
|
protected WSAudit |
getWSAudit() |
protected NuxeoRemoting |
getWSNuxeoRemoting() |
boolean |
hasPermission(String sid,
String uuid,
String permission)
Checks the given permission for the current user on the given document.
|
ModifiedDocumentDescriptorPage |
listDeletedDocumentsByPage(String sessionId,
String dateRangeQuery,
String path,
int page,
int pageSize)
Returns the list of deleted documents within a timestamp.
|
EventDescriptorPage |
listDocumentEventsByPage(String sessionId,
String dateRangeQuery,
String startDate,
String path,
int page,
int pageSize)
Gets a filtered list of document events.
|
EventDescriptorPage |
listEventsByPage(String sessionId,
String dateRangeQuery,
int page,
int pageSize) |
String[] |
listGroups(String sid,
int from,
int to)
Return the list of all groups.
|
ModifiedDocumentDescriptor[] |
listModifiedDocuments(String sessionId,
String dateRangeQuery)
Returns the list of modified document within a timestamp.
|
ModifiedDocumentDescriptorPage |
listModifiedDocumentsByPage(String sessionId,
String dateRangeQuery,
String path,
int page,
int pageSize) |
String[] |
listUsers(String sid,
int from,
int to)
Returns the list of all users.
|
protected void |
lockSession(String sid) |
protected static void |
logDeprecation() |
protected DocumentDescriptor |
missingDocumentDescriptor(String uuid)
Utility method to build descriptor for a document that is non longer to be found in the repository.
|
EventDescriptorPage |
queryEventsByPage(String sessionId,
String whereClause,
int page,
int pageSize) |
protected void |
releaseSession(String sid) |
String |
resolvePathToUUID(String sessionId,
String path) |
String |
uploadDocument(String sid,
String path,
String type,
String[] properties) |
boolean |
validateUserPassword(String sessionId,
String username,
String password) |
connectOnRepository, getSessionsManager, initSession, login
protected static final String ENFORCE_SYNC_PROP_NAME
protected static org.apache.commons.logging.Log log
protected transient NuxeoRemoting platformRemoting
protected IndexingAdapter adapter
protected ConcurrentHashMap<String,ReentrantLock> sessionIdLocks
protected Boolean enforceSync
protected static boolean DEPRECATION_DONE
public WSIndexingGatewayBean()
protected static void logDeprecation()
protected boolean forceSync()
protected void lockSession(String sid)
protected void releaseSession(String sid)
protected WSAudit getWSAudit()
protected NuxeoRemoting getWSNuxeoRemoting()
protected IndexingAdapter getAdapter()
public DocumentDescriptor[] getChildren(String sessionId, String uuid)
NuxeoRemoting
getChildren
in interface NuxeoRemoting
sessionId
- the session iduuid
- the doc uuidpublic DocumentDescriptor getCurrentVersion(String sid, String uid)
NuxeoRemoting
getCurrentVersion
in interface NuxeoRemoting
public DocumentDescriptor getDocument(String sessionId, String uuid)
NuxeoRemoting
getDocument
in interface NuxeoRemoting
sessionId
- the session iduuid
- the doc uuidpublic WsACE[] getDocumentACL(String sid, String uuid)
NuxeoRemoting
It includes all ACLs for each ACP.
getDocumentACL
in interface NuxeoRemoting
uuid
- the uuid of the documentpublic WsACE[] getDocumentLocalACL(String sid, String uuid)
NuxeoRemoting
It includes all ACLs for each ACP.
getDocumentLocalACL
in interface NuxeoRemoting
uuid
- the uuid of the documentpublic DocumentBlob[] getDocumentBlobsExt(String sid, String uuid, boolean useDownloadUrl)
NuxeoRemoting
getDocumentBlobsExt
in interface NuxeoRemoting
uuid
- the uuid of the document.useDownloadUrl
- defines if blob are exported as download url or as byte|[]public DocumentBlob[] getDocumentBlobs(String sid, String uuid)
NuxeoRemoting
getDocumentBlobs
in interface NuxeoRemoting
uuid
- the uuid of the document.public DocumentProperty[] getDocumentNoBlobProperties(String sid, String uuid)
NuxeoRemoting
NuxeoRemoting.getDocumentProperties(String, String)
but skips blobs.getDocumentNoBlobProperties
in interface NuxeoRemoting
public DocumentProperty[] getDocumentProperties(String sid, String uuid)
NuxeoRemoting
All property are returned even blobs. All values are converted to strings.
It includes the perm link of the document.
No need to includes blobs here. See the dedicated API.
getDocumentProperties
in interface NuxeoRemoting
uuid
- uuid of the document.public String[] getGroups(String sid, String parentGroup)
NuxeoRemoting
getGroups
in interface NuxeoRemoting
sid
- the session idparentGroup
- the parent grouppublic String getRepositoryName(String sid)
NuxeoRemoting
getRepositoryName
in interface NuxeoRemoting
sid
- the session idpublic DocumentDescriptor getRootDocument(String sessionId)
NuxeoRemoting
getRootDocument
in interface NuxeoRemoting
public String resolvePathToUUID(String sessionId, String path)
resolvePathToUUID
in interface WSIndexingGateway
public UUIDPage getRecursiveChildrenUUIDsByPage(String sid, String uuid, int page, int pageSize)
getRecursiveChildrenUUIDsByPage
in interface WSIndexingGateway
public String[] getRecursiveChildrenUUIDs(String sid, String uuid)
getRecursiveChildrenUUIDs
in interface WSIndexingGateway
public DocumentTypeDescriptor[] getTypeDefinitions()
getTypeDefinitions
in interface WSIndexingGateway
public DocumentDescriptor getDocumentFromPath(String sessionId, String path)
getDocumentFromPath
in interface WSIndexingGateway
public DocumentDescriptor getSourceDocument(String sid, String uid)
NuxeoRemoting
getSourceDocument
in interface NuxeoRemoting
public String[] getUsers(String sid, String parentGroup)
NuxeoRemoting
getUsers
in interface NuxeoRemoting
sid
- the session idparentGroup
- the parent grouppublic DocumentDescriptor[] getVersions(String sid, String uid)
NuxeoRemoting
getVersions
in interface NuxeoRemoting
public String[] listGroups(String sid, int from, int to)
NuxeoRemoting
This method supports pagination in case of large user dbs
Pagination is not yet working!
listGroups
in interface NuxeoRemoting
from
- pagination startto
- pagination stoppublic String[] listUsers(String sid, int from, int to)
NuxeoRemoting
This method supports pagination in case of large user dbs.
Pagination is not yet working!
listUsers
in interface NuxeoRemoting
from
- pagination startto
- pagination stoppublic ModifiedDocumentDescriptor[] listModifiedDocuments(String sessionId, String dateRangeQuery)
WSAudit
listModifiedDocuments
in interface WSAudit
sessionId
- the Nuxeo core session id.dateRangeQuery
- the date range query.public ModifiedDocumentDescriptorPage listModifiedDocumentsByPage(String sessionId, String dateRangeQuery, String path, int page, int pageSize)
listModifiedDocumentsByPage
in interface WSAudit
public EventDescriptorPage listEventsByPage(String sessionId, String dateRangeQuery, int page, int pageSize)
listEventsByPage
in interface WSAudit
public EventDescriptorPage listDocumentEventsByPage(String sessionId, String dateRangeQuery, String startDate, String path, int page, int pageSize)
WSAudit
Expecting either a dateRangeQuery or a startDate.
listDocumentEventsByPage
in interface WSAudit
sessionId
- the Nuxeo core session id.dateRangeQuery
- the date range query like "24h" for the last 24 hours, may be null
if
startDate is set.startDate
- return events that occurs after startDate, expecting W3C date time format. May be
null
if dateRangeQuery is set. Will be ignored if dateRangeQuery is set.path
- filter events for documents starting with this path.page
- page number starting with page 1.pageSize
- number of items in a page.public String getRelativePathAsString(String sessionId, String uuid)
NuxeoRemoting
Example: /Workspaces/My Workspaces/Nice Document
getRelativePathAsString
in interface NuxeoRemoting
sessionId
- : the session iduuid
- : the document uuidpublic boolean hasPermission(String sid, String uuid, String permission)
NuxeoRemoting
hasPermission
in interface NuxeoRemoting
public String uploadDocument(String sid, String path, String type, String[] properties)
uploadDocument
in interface NuxeoRemoting
public String connect(String username, String password)
BaseNuxeoWebService
connect
in interface BaseNuxeoWebService
connect
in class AbstractNuxeoWebService
username
- the user namepassword
- the user passwordpublic void disconnect(String sid)
BaseNuxeoWebService
disconnect
in interface BaseNuxeoWebService
disconnect
in class AbstractNuxeoWebService
sid
- the Nuxeo core session id.public EventDescriptorPage queryEventsByPage(String sessionId, String whereClause, int page, int pageSize)
queryEventsByPage
in interface WSAudit
public boolean validateUserPassword(String sessionId, String username, String password)
validateUserPassword
in interface WSIndexingGateway
public String[] getUserGroups(String sessionId, String username)
getUserGroups
in interface WSIndexingGateway
public DocumentSnapshot getDocumentSnapshotExt(String sessionId, String uuid, boolean useDownloadUrl)
NuxeoRemoting
getDocumentSnapshotExt
in interface NuxeoRemoting
sessionId
- the session iduuid
- the doc uuiduseDownloadUrl
- define blob export formatpublic DocumentSnapshot getDocumentSnapshot(String sessionId, String uuid)
NuxeoRemoting
getDocumentSnapshot
in interface NuxeoRemoting
sessionId
- the session iduuid
- the doc uuidpublic ModifiedDocumentDescriptorPage listDeletedDocumentsByPage(String sessionId, String dateRangeQuery, String path, int page, int pageSize)
WSAudit
listDeletedDocumentsByPage
in interface WSAudit
protected DocumentDescriptor missingDocumentDescriptor(String uuid)
uuid
- Copyright © 2018 Nuxeo. All rights reserved.