public interface OnlyofficeEditorService
| Modifier and Type | Field and Description |
|---|---|
static String |
EDITOR_CLOSED_EVENT
The editor closed event.
|
static String |
EDITOR_ERROR_EVENT
The editor error event.
|
static String |
EDITOR_OPENED_EVENT
The editor opened event.
|
static String |
EDITOR_SAVED_EVENT
The editor saved event.
|
static String |
EDITOR_VERSION_EVENT
The editor version event.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(OnlyofficeEditorListener listener)
Add listener to the service.
|
void |
addTypePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
Adds DocumentTypePlugin to the service to check mimetypes of documents.
|
boolean |
canDownloadBy(String hostName)
Check does given host can download document content by this service.
|
boolean |
canEditDocument(javax.jcr.Node node)
Checks if the node isn't locked and can be edited by the current user.
|
Config |
createEditor(String userSchema,
String userHost,
int userPost,
String userId,
String workspace,
String docId)
Create an editor configuration for given user and node.
|
void |
downloadVersion(String userId,
String key,
boolean coEdited,
String comment,
String contentUrl)
Creates a new version of a document.
|
void |
forceSave(String userId,
String key,
boolean download,
boolean coEdit,
String comment)
Forces saving a document on document server.
|
DocumentContent |
getContent(String userId,
String fileKey)
Get file content.
|
javax.jcr.Node |
getDocument(String workspace,
String path)
Gets the document node by its path and optionally a repository workspace.
|
javax.jcr.Node |
getDocumentById(String workspace,
String uuid)
Gets the document node by its id and optionally a repository workspace.
|
String |
getDocumentId(javax.jcr.Node node)
Gets the document ID for given node.
|
Config |
getEditor(String userId,
String workspace,
String path)
Return existing editor configuration for given user and node.
|
Config |
getEditorByKey(String userId,
String key)
Return existing editor for given temporal key.
|
String |
getEditorLink(javax.jcr.Node node)
Gets the editor page URL for opening at Platform server relatively to the
current PortalRequest.
|
String |
getEditorLink(String schema,
String host,
int port,
String workspace,
String docId)
Gets the editor page URL for opening at Platform server.
|
Config.Editor.User |
getLastModifier(String key)
Gets the last modifier userId.
|
ChangeState |
getState(String userId,
String fileKey)
Local state of editing document.
|
Config.Editor.User |
getUser(String key,
String userId)
Gets a user.
|
String |
initDocument(javax.jcr.Node node)
Inits the document and returns an ID for use within editors.
|
String |
initDocument(String workspace,
String path)
Inits the document and returns an ID for use within editors.
|
boolean |
isDocumentMimeSupported(javax.jcr.Node node)
Checks if the node has compatible mime-types.
|
void |
removeListener(OnlyofficeEditorListener listener)
Remove listener from the service.
|
void |
setLastModifier(String key,
String userId)
Sets the last modifier userId.
|
void |
updateDocument(DocumentStatus status)
Update a configuration associated with given DocumentStatus
instance.
|
boolean |
validateToken(String token,
String key)
Validates the JWT token received from the document server.
|
static final String EDITOR_OPENED_EVENT
static final String EDITOR_CLOSED_EVENT
static final String EDITOR_SAVED_EVENT
static final String EDITOR_VERSION_EVENT
static final String EDITOR_ERROR_EVENT
Config getEditor(String userId, String workspace, String path) throws OnlyofficeEditorException, javax.jcr.RepositoryException
null will be returned. If
user not valid then OnlyofficeEditorException will be thrown.userId - Stringworkspace - Stringpath - StringConfig or nullOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionConfig getEditorByKey(String userId, String key) throws OnlyofficeEditorException, javax.jcr.RepositoryException
null will be returned. If user not valid then
OnlyofficeEditorException will be thrown.userId - the user idkey - the key, see getEditor(String, String, String)OnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionConfig createEditor(String userSchema, String userHost, int userPost, String userId, String workspace, String docId) throws OnlyofficeEditorException, javax.jcr.RepositoryException
userSchema - the schemauserHost - the hostuserPost - the user postuserId - Stringworkspace - StringdocId - String a document reference in the workspace, see
initDocument(String, String)Config instance in case of successful creation or
null if local file type not supported.OnlyofficeEditorException - if editor exception happenedjavax.jcr.RepositoryException - if storage exception happenedvoid updateDocument(DocumentStatus status) throws OnlyofficeEditorException, javax.jcr.RepositoryException
status - DocumentStatusOnlyofficeEditorException - if editor exception happenedjavax.jcr.RepositoryException - if storage exception happenedString initDocument(javax.jcr.Node node) throws OnlyofficeEditorException, javax.jcr.RepositoryException
node - the node of the documentOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionString initDocument(String workspace, String path) throws OnlyofficeEditorException, javax.jcr.RepositoryException
workspace - the workspacepath - the pathOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionString getEditorLink(javax.jcr.Node node) throws OnlyofficeEditorException, javax.jcr.RepositoryException
node - the nodeOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionString getEditorLink(String schema, String host, int port, String workspace, String docId)
schema - the schemahost - the hostport - the portworkspace - the workspacedocId - the doc IDjavax.jcr.Node getDocument(String workspace, String path) throws javax.jcr.RepositoryException, BadParameterException
workspace - the workspace, can be null, then a default
one will be usedpath - the path of a documentnull if nothing foundjavax.jcr.RepositoryException - the repository exceptionBadParameterException - the bad parameter exeptionDocumentContent getContent(String userId, String fileKey) throws OnlyofficeEditorException, javax.jcr.RepositoryException
userId - StringfileKey - StringDocumentContentOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionboolean canDownloadBy(String hostName)
hostName - Stringtrue if client host with given name can download
document content, false otherwise.ChangeState getState(String userId, String fileKey) throws OnlyofficeEditorException
userId - StringfileKey - StringChangeStateOnlyofficeEditorException - the onlyoffice editor exceptionvoid addListener(OnlyofficeEditorListener listener)
listener - the listenervoid removeListener(OnlyofficeEditorListener listener)
listener - the listenervoid addTypePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
plugin - - the plugin to be addedboolean canEditDocument(javax.jcr.Node node)
throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exeptionString getDocumentId(javax.jcr.Node node) throws OnlyofficeEditorException, javax.jcr.RepositoryException
null will be returned.node - the nodenullOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptioninitDocument(String, String),
canEditDocument(Node)boolean isDocumentMimeSupported(javax.jcr.Node node)
throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exeptionjavax.jcr.Node getDocumentById(String workspace, String uuid) throws javax.jcr.RepositoryException
workspace - the workspace, can be null, then a default
one will be useduuid - the id of a documentnull if nothing foundjavax.jcr.RepositoryException - the repository exceptionvoid downloadVersion(String userId, String key, boolean coEdited, String comment, String contentUrl)
userId - the userIdkey - the keycoEdited - the coEditedcomment - the commentcontentUrl - the contentUrlConfig.Editor.User getLastModifier(String key)
key - the keyvoid setLastModifier(String key, String userId)
key - the keyuserId - the userIdvoid forceSave(String userId, String key, boolean download, boolean coEdit, String comment)
userId - the userIdkey - the keydownload - the downloadcoEdit - the coeditcomment - the commentConfig.Editor.User getUser(String key, String userId)
key - the keyuserId - the userIdCopyright © 2003–2019 eXo Platform SAS. All rights reserved.