public class OnlyofficeEditorServiceImpl extends Object implements OnlyofficeEditorService, org.picocontainer.Startable
OnlyofficeEditorService and Startable.
This component handles interactions with Onlyoffice Document Server and
related eXo user states.| Modifier and Type | Class and Description |
|---|---|
static class |
OnlyofficeEditorServiceImpl.DocumentTypesConfig
NewDocumentTypesConfig.
|
| Modifier and Type | Field and Description |
|---|---|
protected org.exoplatform.services.cache.ExoCache<String,ConcurrentMap<String,Config>> |
activeCache
Cache of Editing documents.
|
protected ReentrantLock |
activeLock
Lock for updating Editing documents cache.
|
protected org.exoplatform.social.core.manager.ActivityManager |
activityManager
The activity manager.
|
protected org.exoplatform.services.security.Authenticator |
authenticator
The authenticator.
|
static String |
CACHE_NAME
The Constant CACHE_NAME.
|
protected String |
commandServiceUrl
The document command service url.
|
static String |
COMMONS_RESOUCE_BUNDLE_NAME |
protected Map<String,String> |
config
The config.
|
static String |
CONFIG_DS_ACCESS_ONLY
The Constant CONFIG_DS_ACCESS_ONLY.
|
static String |
CONFIG_DS_ALLOWEDHOSTS
Configuration key for Document Server's allowed hosts in requests from a DS
to eXo side.
|
static String |
CONFIG_DS_HOST
The Constant CONFIG_DS_HOST.
|
static String |
CONFIG_DS_SCHEMA
The Constant CONFIG_DS_SCHEMA.
|
static String |
CONFIG_DS_SECRET
The Constant CONFIG_DS_SECRET.
|
protected static String |
DEFAULT_NAME
The Constant DEFAULT_NAME.
|
protected boolean |
documentserverAccessOnly
The documentserver access only.
|
protected Set<String> |
documentserverAllowedhosts
The documentserver allowed hosts (can be empty if not configured).
|
protected String |
documentserverHostName
The documentserver host name.
|
protected String |
documentserverSecret
The document server secret.
|
protected String |
documentserverUrl
The documentserver url.
|
protected org.exoplatform.services.cms.documents.DocumentService |
documentService
The document service.
|
protected DocumentTypePlugin |
documentTypePlugin
The document type plugin.
|
protected static String |
EMPTY_TEXT
The Constant EMPTY_TEXT.
|
protected static Pattern |
FILE_EXPLORER_URL_SYNTAX
The Consant FILE_EXPLORER_URL_SYNTAX.
|
protected Map<String,String> |
fileTypes
The file types.
|
protected NodeFinder |
finder
The finder.
|
protected String |
groupsPath
The group drives path in JCR.
|
protected static String |
HIDDEN_FOLDER
The hidden folder
|
protected org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator |
hierarchyCreator
The node hierarchy creator.
|
protected static char |
HTTP_PORT_DELIMITER
The Constant HTTP_PORT_DELIMITER.
|
protected org.exoplatform.services.security.IdentityRegistry |
identityRegistry
The identity registry.
|
protected org.exoplatform.services.jcr.RepositoryService |
jcrService
The jcr service.
|
protected static String |
LAST_EDITED_DATE_FORMAT
The date format for Last Edited in editor bar
|
protected ConcurrentLinkedQueue<OnlyofficeEditorListener> |
listeners
The listeners.
|
protected org.exoplatform.services.listener.ListenerService |
listenerService
The listener service.
|
protected static int |
LOCK_WAIT_ATTEMTS
The Constant LOCK_WAIT_ATTEMTS.
|
protected static long |
LOCK_WAIT_TIMEOUT
The Constant LOCK_WAIT_TIMEOUT.
|
protected org.exoplatform.services.cms.lock.LockService |
lockService
The lock service.
|
protected static org.exoplatform.services.log.Log |
LOG
The Constant LOG.
|
protected org.exoplatform.services.cms.drives.ManageDriveService |
manageDriveService
The manage drive service
|
protected org.exoplatform.services.organization.OrganizationService |
organization
The organization.
|
protected static Random |
RANDOM
The Constant RANDOM.
|
protected static String |
RELATION_PROP
The Constant RELATION_PROP.
|
protected org.exoplatform.services.jcr.ext.app.SessionProviderService |
sessionProviders
The session providers.
|
protected org.exoplatform.social.core.space.spi.SpaceService |
spaceService
The space service.
|
protected org.exoplatform.services.cms.documents.TrashService |
trashService
The trash service.
|
protected static String |
TYPE_PRESENTATION
The Constant TYPE_PRESENTATION.
|
protected static String |
TYPE_SPREADSHEET
The Constant TYPE_SPREADSHEET.
|
protected static String |
TYPE_TEXT
The Constant TYPE_TEXT.
|
protected String |
uploadUrl
The upload url.
|
protected String |
usersPath
The user drives paths in JCR.
|
EDITOR_CLOSED_EVENT, EDITOR_ERROR_EVENT, EDITOR_OPENED_EVENT, EDITOR_SAVED_EVENT, EDITOR_VERSION_EVENT| Constructor and Description |
|---|
OnlyofficeEditorServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.security.IdentityRegistry identityRegistry,
NodeFinder finder,
org.exoplatform.services.organization.OrganizationService organization,
org.exoplatform.services.security.Authenticator authenticator,
org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.services.cms.documents.DocumentService documentService,
org.exoplatform.services.cms.lock.LockService lockService,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.services.cms.documents.TrashService trashService,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.social.core.manager.ActivityManager activityManager,
org.exoplatform.services.cms.drives.ManageDriveService manageDriveService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator,
org.exoplatform.container.xml.InitParams params)
Cloud Drive service with storage in JCR and with managed features.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
addComment(String activityId,
String commentText,
String userId) |
protected void |
addDebugCacheListener()
Adds debug listener to active cache
|
void |
addFilePreferences(javax.jcr.Node node,
String userId,
String path)
Addds file preferences to the node (path for opening shared doc for particular user).
|
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.
|
protected void |
broadcastEvent(DocumentStatus status,
String eventType)
Broadcasts an event using the listenerService.
|
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.
|
protected boolean |
canRenameDocument(javax.jcr.Node node)
Checks if current user can rename the document.
|
protected boolean |
checkout(javax.jcr.Node node)
Checkout.
|
Config |
createEditor(String schema,
String host,
int port,
String userId,
String workspace,
String docId)
Create an editor configuration for given user and node.
|
protected void |
createVersionOfDraft(javax.jcr.Node node)
Creates a version of draft.
|
protected javax.jcr.Property |
data(javax.jcr.Node content)
Data.
|
protected String |
documentType(String fileType)
Document type.
|
protected void |
download(DocumentStatus status)
Downloads document's content to the JCR node.
|
protected void |
downloadClosed(DocumentStatus status)
Downloads document's content to the JCR node when the editor is closed.
|
protected void |
downloadVersion(DocumentStatus status)
Downloads document's content to the JCR node creating a new version.
|
void |
downloadVersion(String userId,
String key,
boolean coEdited,
boolean forcesaved,
String comment,
String contentUrl)
Builds status object based on params.
|
protected String |
editorURLPath(String docId)
Editor URL path.
|
protected String |
explorerLink(String jcrPath)
ECMS explorer page relative URL (within the Platform).
|
protected URI |
explorerUri(String schema,
String host,
int port,
String ecmsLink)
Explorer uri.
|
protected StringBuilder |
explorerUrl(String schema,
String host,
int port,
String ecmsURL)
Deprecated.
|
protected String |
fileType(javax.jcr.Node node)
File type.
|
protected void |
fireCreated(DocumentStatus status)
Fire created.
|
protected void |
fireError(DocumentStatus status)
Fire error.
|
protected void |
fireGet(DocumentStatus status)
Fire get.
|
protected void |
fireJoined(DocumentStatus status)
Fire joined.
|
protected void |
fireLeaved(DocumentStatus status)
Fire leaved.
|
protected void |
fireSaved(DocumentStatus status)
Fire saved.
|
void |
forceSave(String userId,
String key,
boolean download,
boolean coEdit,
boolean forcesaved,
String comment)
Forces saving a document on document server.
|
protected UUID |
generateId(String workspace,
String path)
Generate id.
|
protected String[] |
getActiveUsers(ConcurrentMap<String,Config> configs)
Gets the current users.
|
DocumentContent |
getContent(String userId,
String key)
Get file content.
|
protected String |
getDisplayPath(javax.jcr.Node node,
String userId)
Gets display path.
|
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.
|
protected Set<String> |
getDocumentserverAllowedHosts(String dsAllowedHost)
Gets allowed hosts.
|
protected String |
getDocumentserverHost(String dsSchema,
String dsHost)
Gets documentserver host name.
|
protected Config |
getEditor(String userId,
String docId,
boolean createCoEditing)
Gets the editor.
|
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.
|
protected String |
getLastModified(javax.jcr.Node node)
Gets lastmodified from node.
|
protected String |
getLastModifier(javax.jcr.Node node)
Gets last modifier display name from node.
|
Config.Editor.User |
getLastModifier(String key)
Gets the last modifier userId.
|
ChangeState |
getState(String userId,
String key)
Local state of editing document.
|
protected javax.jcr.Node |
getSymlink(javax.jcr.Node node,
String userId)
Gets parent folder of the file based on file preferences
|
org.exoplatform.services.organization.User |
getUser(String username)
Gets the user.
|
Config.Editor.User |
getUser(String key,
String userId)
Gets a user.
|
protected String |
getUserId(String path)
Gets userId from node path.
|
protected String |
getUserLang(String userId)
Gets the user lang.
|
List<Version> |
getVersions(String workspace,
String docId)
get the list of versions of the document with the given id.
|
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.
|
protected void |
initFileTypes()
Initializes fileTypes map
|
boolean |
isDocumentMimeSupported(javax.jcr.Node node)
Checks if the node has compatible mime-types.
|
protected org.exoplatform.onlyoffice.OnlyofficeEditorServiceImpl.LockState |
lock(javax.jcr.Node node,
Config config)
Lock the node by current user.
|
protected void |
logError(String userId,
String path,
String docId,
String key,
String reason)
Logs editor errors.
|
protected String |
lowerCase(String str)
Get lower case copy of the given string.
|
protected String |
mimeType(javax.jcr.Node content)
Mime type.
|
protected javax.jcr.Node |
node(String workspace,
String path)
Node.
|
protected javax.jcr.Node |
nodeByUUID(String workspace,
String uuid)
Node by UUID.
|
protected String |
nodeComment(javax.jcr.Node node)
Gets comment of last version of node
|
protected javax.jcr.Node |
nodeContent(javax.jcr.Node node)
Node content.
|
protected Calendar |
nodeCreated(javax.jcr.Node node)
Node created.
|
protected String |
nodePath(Config config)
Node path with the pattern workspace:path/to/node.
|
protected String |
nodePath(String workspace,
String path)
Node path with the pattern workspace:path/to/node.
|
protected String |
nodeTitle(javax.jcr.Node node)
Node title.
|
protected StringBuilder |
platformRestUrl(CharSequence platformUrl)
Platform REST URL.
|
protected StringBuilder |
platformUrl(String schema,
String host,
int port)
Platform url.
|
void |
removeListener(OnlyofficeEditorListener listener)
Remove listener from the service.
|
protected void |
restoreConvoState(org.exoplatform.services.security.ConversationState contextState,
org.exoplatform.services.jcr.ext.common.SessionProvider contextProvider)
Restores the conversation state.
|
protected void |
saveLink(String userId,
String key,
String url)
Save link.
|
void |
setLastModifier(String key,
String userId)
Sets the last modifier userId.
|
protected boolean |
setUserConvoState(String userId)
Sets ConversationState by userId.
|
void |
start()
On-start initializer.
|
void |
stop()
On-stop finalizer.
|
protected boolean |
syncUsers(ConcurrentMap<String,Config> configs,
String[] users)
Sync users.
|
protected javax.jcr.Node |
systemNode(String workspace,
String path)
System node.
|
protected void |
unlock(javax.jcr.Node node,
org.exoplatform.onlyoffice.OnlyofficeEditorServiceImpl.LockState lock)
Unlock given node.
|
protected void |
updateCache(Config config)
Updates config in the activeCache.
|
void |
updateDocument(DocumentStatus status)
Update a configuration associated with given DocumentStatus
instance.
|
void |
updateTitle(String workspace,
String docId,
String newTitle,
String userId)
Updates title of a document.
|
protected org.exoplatform.services.security.Identity |
userIdentity(String userId)
Find or create user identity.
|
boolean |
validateToken(String token,
String key)
Validates the JWT token received from the document server.
|
protected void |
validateUser(String userId,
Config config)
Validate user.
|
protected static final org.exoplatform.services.log.Log LOG
protected static final Random RANDOM
public static final String CONFIG_DS_HOST
public static final String CONFIG_DS_SCHEMA
public static final String CONFIG_DS_ACCESS_ONLY
public static final String CONFIG_DS_SECRET
public static final String CONFIG_DS_ALLOWEDHOSTS
protected static final char HTTP_PORT_DELIMITER
protected static final String HIDDEN_FOLDER
protected static final String LAST_EDITED_DATE_FORMAT
protected static final String TYPE_TEXT
protected static final String TYPE_SPREADSHEET
protected static final String TYPE_PRESENTATION
protected static final String DEFAULT_NAME
protected static final String RELATION_PROP
protected static final Pattern FILE_EXPLORER_URL_SYNTAX
protected static final int LOCK_WAIT_ATTEMTS
protected static final long LOCK_WAIT_TIMEOUT
protected static final String EMPTY_TEXT
public static final String CACHE_NAME
protected final org.exoplatform.services.jcr.RepositoryService jcrService
protected final org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders
protected final org.exoplatform.services.security.IdentityRegistry identityRegistry
protected final NodeFinder finder
protected final org.exoplatform.services.organization.OrganizationService organization
protected final org.exoplatform.services.security.Authenticator authenticator
protected final org.exoplatform.services.cms.documents.DocumentService documentService
protected final org.exoplatform.services.cms.lock.LockService lockService
protected final org.exoplatform.services.listener.ListenerService listenerService
protected final org.exoplatform.services.cms.documents.TrashService trashService
protected final org.exoplatform.social.core.space.spi.SpaceService spaceService
protected final org.exoplatform.social.core.manager.ActivityManager activityManager
protected final org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator
protected final org.exoplatform.services.cms.drives.ManageDriveService manageDriveService
protected final org.exoplatform.services.cache.ExoCache<String,ConcurrentMap<String,Config>> activeCache
protected final ReentrantLock activeLock
protected final String uploadUrl
protected final String documentserverHostName
protected final String documentserverUrl
protected final String commandServiceUrl
protected final String documentserverSecret
protected final boolean documentserverAccessOnly
protected final String groupsPath
protected final String usersPath
protected final Set<String> documentserverAllowedhosts
protected final ConcurrentLinkedQueue<OnlyofficeEditorListener> listeners
protected DocumentTypePlugin documentTypePlugin
public static final String COMMONS_RESOUCE_BUNDLE_NAME
public OnlyofficeEditorServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.app.SessionProviderService sessionProviders,
org.exoplatform.services.security.IdentityRegistry identityRegistry,
NodeFinder finder,
org.exoplatform.services.organization.OrganizationService organization,
org.exoplatform.services.security.Authenticator authenticator,
org.exoplatform.services.cache.CacheService cacheService,
org.exoplatform.services.cms.documents.DocumentService documentService,
org.exoplatform.services.cms.lock.LockService lockService,
org.exoplatform.services.listener.ListenerService listenerService,
org.exoplatform.services.cms.documents.TrashService trashService,
org.exoplatform.social.core.space.spi.SpaceService spaceService,
org.exoplatform.social.core.manager.ActivityManager activityManager,
org.exoplatform.services.cms.drives.ManageDriveService manageDriveService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator hierarchyCreator,
org.exoplatform.container.xml.InitParams params)
throws org.exoplatform.container.configuration.ConfigurationException
jcrService - RepositoryServicesessionProviders - SessionProviderServiceidentityRegistry - the identity registryfinder - the finderorganization - the organizationauthenticator - the authenticatorcacheService - the cache servicedocumentService - the document service (ECMS)lockService - the lock servicelistenerService - the listener servicetrashService - the trashServicespaceService - the spaceServiceactivityManager - the activityManagermanageDriveService - the manageDriveServicehierarchyCreator - the hierarchyCreatorparams - the paramsorg.exoplatform.container.configuration.ConfigurationException - the configuration exceptionpublic void addListener(OnlyofficeEditorListener listener)
addListener in interface OnlyofficeEditorServicelistener - the listenerpublic void removeListener(OnlyofficeEditorListener listener)
removeListener in interface OnlyofficeEditorServicelistener - the listenerpublic 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.getEditor in interface OnlyofficeEditorServiceuserId - Stringworkspace - Stringpath - StringConfig or nullOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionpublic Config getEditorByKey(String userId, String key) throws OnlyofficeEditorException, javax.jcr.RepositoryException
null will be returned. If user not valid then
OnlyofficeEditorException will be thrown.getEditorByKey in interface OnlyofficeEditorServiceuserId - the user idkey - the key, see OnlyofficeEditorService.getEditor(String, String, String)OnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionprotected Config getEditor(String userId, String docId, boolean createCoEditing) throws OnlyofficeEditorException, javax.jcr.RepositoryException
userId - the user iddocId - the node docIdcreateCoEditing - if true and has no editor for given
user, create a copy for co-editing if document already editing by
other usersOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionpublic Config createEditor(String schema, String host, int port, String userId, String workspace, String docId) throws OnlyofficeEditorException, javax.jcr.RepositoryException
createEditor in interface OnlyofficeEditorServiceschema - the schemahost - the hostport - the user postuserId - Stringworkspace - StringdocId - String a document reference in the workspace, see
OnlyofficeEditorService.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 happenedpublic DocumentContent getContent(String userId, String key) throws OnlyofficeEditorException, javax.jcr.RepositoryException
getContent in interface OnlyofficeEditorServiceuserId - Stringkey - StringDocumentContentOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionpublic boolean canDownloadBy(String hostName)
canDownloadBy in interface OnlyofficeEditorServicehostName - Stringtrue if client host with given name can download
document content, false otherwise.public ChangeState getState(String userId, String key) throws OnlyofficeEditorException
getState in interface OnlyofficeEditorServiceuserId - Stringkey - StringChangeStateOnlyofficeEditorException - the onlyoffice editor exceptionpublic void updateDocument(DocumentStatus status) throws OnlyofficeEditorException, javax.jcr.RepositoryException
updateDocument in interface OnlyofficeEditorServicestatus - DocumentStatusOnlyofficeEditorException - if editor exception happenedjavax.jcr.RepositoryException - if storage exception happenedpublic String initDocument(javax.jcr.Node node) throws OnlyofficeEditorException, javax.jcr.RepositoryException
initDocument in interface OnlyofficeEditorServicenode - the node of the documentOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionpublic String initDocument(String workspace, String path) throws OnlyofficeEditorException, javax.jcr.RepositoryException
initDocument in interface OnlyofficeEditorServiceworkspace - the workspacepath - the pathOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionpublic String getDocumentId(javax.jcr.Node node) throws OnlyofficeEditorException, javax.jcr.RepositoryException
null will be returned.getDocumentId in interface OnlyofficeEditorServicenode - the nodenullOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionOnlyofficeEditorService.initDocument(String, String),
OnlyofficeEditorService.canEditDocument(Node)public String getEditorLink(javax.jcr.Node node) throws javax.jcr.RepositoryException, OnlyofficeEditorException
getEditorLink in interface OnlyofficeEditorServicenode - the nodejavax.jcr.RepositoryException - the repository exceptionOnlyofficeEditorException - the onlyoffice editor exceptionpublic String getEditorLink(String schema, String host, int port, String workspace, String docId)
getEditorLink in interface OnlyofficeEditorServiceschema - the schemahost - the hostport - the portworkspace - the workspacedocId - the doc IDpublic javax.jcr.Node getDocumentById(String workspace, String uuid) throws javax.jcr.RepositoryException
getDocumentById in interface OnlyofficeEditorServiceworkspace - the workspace, can be null, then a default
one will be useduuid - the id of a documentnull if nothing foundjavax.jcr.RepositoryException - the repository exceptionpublic List<Version> getVersions(String workspace, String docId) throws Exception
getVersions in interface OnlyofficeEditorServiceworkspace - the workspacedocId - the document idException - the exceptionpublic javax.jcr.Node getDocument(String workspace, String path) throws javax.jcr.RepositoryException, BadParameterException
getDocument in interface OnlyofficeEditorServiceworkspace - 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 exeptionpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startablepublic void addTypePlugin(org.exoplatform.container.component.ComponentPlugin plugin)
addTypePlugin in interface OnlyofficeEditorServiceplugin - - the plugin to be addedpublic boolean canEditDocument(javax.jcr.Node node)
throws javax.jcr.RepositoryException
canEditDocument in interface OnlyofficeEditorServicenode - the nodejavax.jcr.RepositoryException - the repository exeptionpublic boolean isDocumentMimeSupported(javax.jcr.Node node)
throws javax.jcr.RepositoryException
isDocumentMimeSupported in interface OnlyofficeEditorServicenode - the nodejavax.jcr.RepositoryException - the repository exeptionpublic void downloadVersion(String userId, String key, boolean coEdited, boolean forcesaved, String comment, String contentUrl)
downloadVersion in interface OnlyofficeEditorServiceuserId - the userIdkey - the keycoEdited - the coEditedforcesaved - the forceSavedcomment - the commentcontentUrl - the contentUrlpublic Config.Editor.User getLastModifier(String key)
getLastModifier in interface OnlyofficeEditorServicekey - the keypublic void setLastModifier(String key, String userId)
setLastModifier in interface OnlyofficeEditorServicekey - the keyuserId - the userIdpublic Config.Editor.User getUser(String key, String userId)
getUser in interface OnlyofficeEditorServicekey - the keyuserId - the userIdpublic void forceSave(String userId, String key, boolean download, boolean coEdit, boolean forcesaved, String comment)
forceSave in interface OnlyofficeEditorServiceuserId - the userIdkey - the keydownload - the downloadcoEdit - the coeditforcesaved - the forcesavedcomment - the commentpublic boolean validateToken(String token, String key)
OnlyofficeEditorServicevalidateToken in interface OnlyofficeEditorServicetoken - the tokenkey - the document keypublic void updateTitle(String workspace, String docId, String newTitle, String userId)
OnlyofficeEditorServiceupdateTitle in interface OnlyofficeEditorServiceworkspace - the workspacedocId - the docIdnewTitle - the titleuserId - the userIdpublic org.exoplatform.services.organization.User getUser(String username) throws OnlyofficeEditorException
getUser in interface OnlyofficeEditorServiceusername - the usernameOnlyofficeEditorException - the onlyoffice editor exceptionpublic void addFilePreferences(javax.jcr.Node node,
String userId,
String path)
throws javax.jcr.RepositoryException
addFilePreferences in interface OnlyofficeEditorServicenode - the nodeuserId - the userIdpath - the pathjavax.jcr.RepositoryException - the repositoryExceptionprotected void saveLink(String userId, String key, String url)
userId - the userIdkey - the keyurl - the urlprotected void downloadClosed(DocumentStatus status)
status - the statusprotected String nodeTitle(javax.jcr.Node node) throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exceptionprotected String fileType(javax.jcr.Node node) throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exceptionprotected String documentType(String fileType)
fileType - the file typeprotected javax.jcr.Node nodeContent(javax.jcr.Node node)
throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exceptionprotected Calendar nodeCreated(javax.jcr.Node node) throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exceptionprotected String mimeType(javax.jcr.Node content) throws javax.jcr.RepositoryException
content - the contentjavax.jcr.RepositoryException - the repository exceptionprotected javax.jcr.Property data(javax.jcr.Node content)
throws javax.jcr.RepositoryException
content - the contentjavax.jcr.RepositoryException - the repository exceptionprotected UUID generateId(String workspace, String path)
workspace - the workspacepath - the pathprotected String nodePath(String workspace, String path)
workspace - the workspacepath - the pathprotected String nodePath(Config config)
config - the configprotected boolean syncUsers(ConcurrentMap<String,Config> configs, String[] users)
configs - the configsusers - the usersprotected String[] getActiveUsers(ConcurrentMap<String,Config> configs)
configs - the configsprotected void downloadVersion(DocumentStatus status)
status - the statusprotected void download(DocumentStatus status) throws OnlyofficeEditorException, javax.jcr.RepositoryException
status - the statusOnlyofficeEditorException - the OnlyofficeEditorExceptionjavax.jcr.RepositoryException - the RepositoryExceptionprotected void updateCache(Config config)
config - the configprotected void createVersionOfDraft(javax.jcr.Node node)
throws javax.jcr.RepositoryException,
OnlyofficeEditorException
node - the nodejavax.jcr.RepositoryException - the repository exceptionOnlyofficeEditorException - the onlyoffice exceptionprotected javax.jcr.Node node(String workspace, String path) throws BadParameterException, javax.jcr.RepositoryException
workspace - the workspacepath - the pathBadParameterException - the bad parameter exceptionjavax.jcr.RepositoryException - the repository exceptionprotected javax.jcr.Node systemNode(String workspace, String path) throws BadParameterException, javax.jcr.RepositoryException
workspace - the workspacepath - the pathBadParameterException - the bad parameter exceptionjavax.jcr.RepositoryException - the repository exceptionprotected javax.jcr.Node nodeByUUID(String workspace, String uuid) throws javax.jcr.RepositoryException
workspace - the workspaceuuid - the UUIDjavax.jcr.RepositoryException - the repository exceptionprotected boolean checkout(javax.jcr.Node node)
throws javax.jcr.RepositoryException
node - the nodejavax.jcr.RepositoryException - the repository exceptionprotected void unlock(javax.jcr.Node node,
org.exoplatform.onlyoffice.OnlyofficeEditorServiceImpl.LockState lock)
throws OnlyofficeEditorException,
javax.jcr.RepositoryException
node - the nodelock - the lockOnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionprotected org.exoplatform.onlyoffice.OnlyofficeEditorServiceImpl.LockState lock(javax.jcr.Node node,
Config config)
throws OnlyofficeEditorException,
javax.jcr.RepositoryException
OnlyofficeEditorException. If node
isn't mix:lockable it will be added first and node saved.node - Nodeconfig - ConfigLock acquired by current user.OnlyofficeEditorException - the onlyoffice editor exceptionjavax.jcr.RepositoryException - the repository exceptionprotected void validateUser(String userId, Config config) throws BadParameterException, OnlyofficeEditorException
userId - the user idconfig - the configBadParameterException - if user not foundOnlyofficeEditorException - if error searching user in organization
serviceprotected String getUserLang(String userId)
userId - the user idnull if user has no profile or
language in it or user profile errorprotected StringBuilder platformUrl(String schema, String host, int port)
schema - the schemahost - the hostport - the port@Deprecated protected StringBuilder explorerUrl(String schema, String host, int port, String ecmsURL)
schema - the schemahost - the hostport - the portecmsURL - the ECMS URLprotected URI explorerUri(String schema, String host, int port, String ecmsLink)
schema - the schemahost - the hostport - the portecmsLink - the ecms linkprotected String explorerLink(String jcrPath)
jcrPath - the jcr pathprotected StringBuilder platformRestUrl(CharSequence platformUrl)
platformUrl - the platform URLprotected void broadcastEvent(DocumentStatus status, String eventType)
status - the statuseventType - the eventTypeprotected void fireCreated(DocumentStatus status)
status - the statusprotected void fireGet(DocumentStatus status)
status - the statusprotected void fireJoined(DocumentStatus status)
status - the statusprotected void fireLeaved(DocumentStatus status)
status - the statusprotected void fireSaved(DocumentStatus status)
status - the statusprotected void fireError(DocumentStatus status)
status - the statusprotected org.exoplatform.services.security.Identity userIdentity(String userId)
userId - the user idprotected String lowerCase(String str)
str - the strprotected String editorURLPath(String docId)
docId - the doc idprotected void logError(String userId, String path, String docId, String key, String reason)
userId - the userIdpath - the pathdocId - the docIdkey - the keyreason - the reasonprotected boolean setUserConvoState(String userId)
userId - the userIdprotected void restoreConvoState(org.exoplatform.services.security.ConversationState contextState,
org.exoplatform.services.jcr.ext.common.SessionProvider contextProvider)
contextState - the contextStatecontextProvider - the contextProviderprotected void initFileTypes()
protected void addDebugCacheListener()
protected String getDocumentserverHost(String dsSchema, String dsHost) throws org.exoplatform.container.configuration.ConfigurationException
dsSchema - the dsSchemadsHost - the dsHostorg.exoplatform.container.configuration.ConfigurationException - the configurationExceptionprotected Set<String> getDocumentserverAllowedHosts(String dsAllowedHost)
dsAllowedHost - the dsAllowedHostprotected String getDisplayPath(javax.jcr.Node node, String userId)
node - the nodeuserId - the userIdprotected javax.jcr.Node getSymlink(javax.jcr.Node node,
String userId)
throws Exception
node - the nodeuserId - the userIdException - the exceptionprotected String getUserId(String path)
path - the node pathprotected String nodeComment(javax.jcr.Node node)
node - the nodeprotected boolean canRenameDocument(javax.jcr.Node node)
node - the nodeprotected String getLastModified(javax.jcr.Node node) throws javax.jcr.ValueFormatException, javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
node - the nodejavax.jcr.ValueFormatException - the valueFormatExceptionjavax.jcr.PathNotFoundException - the pathNotFoundExceptionjavax.jcr.RepositoryException - the repositoryExceptionprotected String getLastModifier(javax.jcr.Node node) throws javax.jcr.ValueFormatException, javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, OnlyofficeEditorException
node - the node.javax.jcr.ValueFormatException - the valueFormatExceptionjavax.jcr.PathNotFoundException - the pathNotFoundExceptionjavax.jcr.RepositoryException - the repositoryExceptionOnlyofficeEditorException - the onlyofficeEditorExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.