Package org.exoplatform.onlyoffice
Class Config
java.lang.Object
org.exoplatform.onlyoffice.Config
- All Implemented Interfaces:
Externalizable,Serializable
Onlyoffice editor config for its JS API.
This class implements
This class implements
Externalizable for serialization in eXo cache
(actual in cluster). Created by The eXo Platform SAS.- Version:
- $Id: Editor.java 00000 Feb 12, 2016 pnedonosko $
- Author:
- Peter Nedonosko
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe Class Builder.static classThe Onlyoffice Document.static classThe Onlyoffice Editor. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Longprotected static final SimpleDateFormatThe Constant DATETIME_FORMAT.protected static final StringThe Constant EMPTY.protected static final StringThe Constant NO_LANG. -
Constructor Summary
ConstructorsModifierConstructorDescriptionConfig()Instantiates a new config for use withExternalizablemethods.protectedConfig(String documentserverUrl, String platformRestUrl, String editorUrl, URI explorerUri, String documentType, String workspace, String path, String downloadUrl, EditorPage editorPage, Boolean isActivity, String docId, Config.Document document, Config.Editor editor) Editor config constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringcallbackUrl(CharSequence baseUrl, String userId, String key) Callback url.voidclosed()Mark this config as closed: the editor closed, if it was last user in the editor, then its document should be saved in the storage.voidclosing()Mark this config as closing: user already closed this editor but document not yet saved in the storage.static Config.BuilderEditor.booleanprotected static StringfileUrl(CharSequence baseUrl, String userId, String key) File url.Create a copy of this editor but for another given user.Gets the closedTime.getDocId()Gets the document ID in storage.Gets the document.Gets the documentserver js url.Gets the documentserver url.Gets the document type.Gets the download url.Gets the editor config.Gets the editor page.Gets the editor absolute URL.getError()Gets the error.Gets the explorer page URI.Gets the explorer absolute URL.Gets the openedTime.getPath()Gets the path in storage.Gets the previous modified.Gets the same modifier.getToken()Gets the token.Gets a workspace of the storage.booleanhasError()Checks for error.Is activity.booleanisClosed()Checks if is editor closed (including closing state).booleanChecks if is editor currently closing (saving the document).booleanChecks if is created.booleanisOpen()Checks if is editor open.voidopen()Mark this config as open: user opened this editor.voidvoidsetClosedTime(Long closedTime) Sets the closedTime.voidsetClosing(boolean closing) voidsetDatabaseId(Long databaseId) protected voidsetEditorPage(EditorPage editorPage) Sets the editorPage.protected voidsetEditorUrl(String url) Sets the editor url.voidSets the error.voidsetOpen(boolean open) voidsetOpenedTime(Long openedTime) Sets the openedTime.voidsetPreviousModified(Calendar previousModified) Sets the previous modified.voidsetSameModifier(Boolean samemodifier) Sets the same modifier.voidSets the token.toJSON()Return this config as JSON string.toString()void
-
Field Details
-
DATETIME_FORMAT
The Constant DATETIME_FORMAT. -
NO_LANG
The Constant NO_LANG. -
EMPTY
The Constant EMPTY. -
databaseId
-
-
Constructor Details
-
Config
public Config()Instantiates a new config for use withExternalizablemethods. User by serialization. -
Config
protected Config(String documentserverUrl, String platformRestUrl, String editorUrl, URI explorerUri, String documentType, String workspace, String path, String downloadUrl, EditorPage editorPage, Boolean isActivity, String docId, Config.Document document, Config.Editor editor) Editor config constructor.- Parameters:
documentserverUrl- the documentserver URLplatformRestUrl- the platform urleditorUrl- the editor urlexplorerUri- the explorer uridocumentType- the document typeworkspace- the workspacepath- the pathdownloadUrl- the download urleditorPage- the editor pageisActivity- the isActivitydocId- the document IDdocument- the documenteditor- the editor
-
-
Method Details
-
getDatabaseId
-
setDatabaseId
-
editor
public static Config.Builder editor(String documentserverUrl, String documentType, String workspace, String path, String docId) Editor.- Parameters:
documentserverUrl- the documentserver urldocumentType- the document typeworkspace- the workspacepath- the pathdocId- the document ID- Returns:
- the builder
-
fileUrl
File url.- Parameters:
baseUrl- the platform urluserId- the user idkey- the key- Returns:
- the string
-
callbackUrl
Callback url.- Parameters:
baseUrl- the platform urluserId- the user idkey- the key- Returns:
- the string
-
getPlatformRestUrl
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
getDocumentserverJsUrl
Gets the documentserver js url.- Returns:
- the documentserverJsUrl
-
getDocumentserverUrl
Gets the documentserver url.- Returns:
- the documentserverUrl
-
getToken
Gets the token.- Returns:
- the token
-
setToken
Sets the token.- Parameters:
token- the token
-
getWorkspace
Gets a workspace of the storage.- Returns:
- the workspace
-
getPath
Gets the path in storage.- Returns:
- the path
-
isActivity
Is activity.- Returns:
- the isActivity
-
getEditorPage
Gets the editor page.- Returns:
- the editorPage
-
getDocId
Gets the document ID in storage.- Returns:
- the docId
-
getEditorUrl
Gets the editor absolute URL.- Returns:
- the editorUrl
-
getExplorerUrl
Gets the explorer absolute URL.- Returns:
- the explorerUrl
-
getExplorerUri
Gets the explorer page URI.- Returns:
- the explorer URI
-
getDownloadUrl
Gets the download url.- Returns:
- the download url
-
getDocumentType
Gets the document type.- Returns:
- the documentType
-
getDocument
Gets the document.- Returns:
- the config
-
getOpenedTime
Gets the openedTime.- Returns:
- the openedTime
-
getClosedTime
Gets the closedTime.- Returns:
- the closedTime
-
setOpenedTime
Sets the openedTime.- Parameters:
openedTime- the openedTime
-
setClosedTime
Sets the closedTime.- Parameters:
closedTime- the closedTime
-
setEditorPage
Sets the editorPage.- Parameters:
editorPage- the editorPage
-
setEditorUrl
Sets the editor url.- Parameters:
url- the new editor url
-
getEditorConfig
Gets the editor config.- Returns:
- the editor
-
setPreviousModified
Sets the previous modified.- Parameters:
previousModified- the new previous modified
-
getPreviousModified
Gets the previous modified.- Returns:
- the previous modified
-
setSameModifier
Sets the same modifier.- Parameters:
samemodifier- the new same modifier
-
getSameModifier
Gets the same modifier.- Returns:
- the same modifier
-
forUser
Create a copy of this editor but for another given user. -
isCreated
public boolean isCreated()Checks if is created.- Returns:
- true, if is created
-
isOpen
public boolean isOpen()Checks if is editor open.- Returns:
- true, if is open
-
isClosed
public boolean isClosed()Checks if is editor closed (including closing state).- Returns:
- true, if is in closed or closing state
-
isClosing
public boolean isClosing()Checks if is editor currently closing (saving the document). A closing state is a sub-form of closed state.- Returns:
- true of document in closing (saving) state
-
open
public void open()Mark this config as open: user opened this editor. -
setOpen
public void setOpen(boolean open) -
closing
public void closing()Mark this config as closing: user already closed this editor but document not yet saved in the storage. This state is actual for last user who will save the document submitted by the DS. Note that only already open editor can be set to closing state, otherwise this method will have not effect. -
setClosing
public void setClosing(boolean closing) -
closed
public void closed()Mark this config as closed: the editor closed, if it was last user in the editor, then its document should be saved in the storage. -
setError
Sets the error.- Parameters:
error- the new error
-
hasError
public boolean hasError()Checks for error.- Returns:
- true, if successful
-
getError
Gets the error.- Returns:
- the error
-
equals
-
toString
-
toJSON
Return this config as JSON string.- Returns:
- the string
- Throws:
org.exoplatform.ws.frameworks.json.impl.JsonException- the json exception
-