Class Config

    • Field Detail

      • DATETIME_FORMAT

        protected static final SimpleDateFormat DATETIME_FORMAT
        The Constant DATETIME_FORMAT.
      • NO_LANG

        protected static final String NO_LANG
        The Constant NO_LANG.
      • EMPTY

        protected static final String EMPTY
        The Constant EMPTY.
    • Constructor Detail

      • Config

        public Config()
        Instantiates a new config for use with Externalizable methods. 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 URL
        platformRestUrl - the platform url
        editorUrl - the editor url
        explorerUri - the explorer uri
        documentType - the document type
        workspace - the workspace
        path - the path
        downloadUrl - the download url
        editorPage - the editor page
        isActivity - the isActivity
        docId - the document ID
        document - the document
        editor - the editor
    • Method Detail

      • editor

        protected static Config.Builder editor​(String documentserverUrl,
                                               String documentType,
                                               String workspace,
                                               String path,
                                               String docId)
        Editor.
        Parameters:
        documentserverUrl - the documentserver url
        documentType - the document type
        workspace - the workspace
        path - the path
        docId - the document ID
        Returns:
        the builder
      • fileUrl

        protected static String fileUrl​(CharSequence baseUrl,
                                        String userId,
                                        String key)
        File url.
        Parameters:
        baseUrl - the platform url
        userId - the user id
        key - the key
        Returns:
        the string
      • callbackUrl

        protected static String callbackUrl​(CharSequence baseUrl,
                                            String userId,
                                            String key)
        Callback url.
        Parameters:
        baseUrl - the platform url
        userId - the user id
        key - the key
        Returns:
        the string
      • getDocumentserverJsUrl

        public String getDocumentserverJsUrl()
        Gets the documentserver js url.
        Returns:
        the documentserverJsUrl
      • getDocumentserverUrl

        public String getDocumentserverUrl()
        Gets the documentserver url.
        Returns:
        the documentserverUrl
      • getToken

        public String getToken()
        Gets the token.
        Returns:
        the token
      • setToken

        public void setToken​(String token)
        Sets the token.
        Parameters:
        token - the token
      • getWorkspace

        public String getWorkspace()
        Gets a workspace of the storage.
        Returns:
        the workspace
      • getPath

        public String getPath()
        Gets the path in storage.
        Returns:
        the path
      • isActivity

        public Boolean isActivity()
        Is activity.
        Returns:
        the isActivity
      • getEditorPage

        public EditorPage getEditorPage()
        Gets the editor page.
        Returns:
        the editorPage
      • getDocId

        public String getDocId()
        Gets the document ID in storage.
        Returns:
        the docId
      • getEditorUrl

        public String getEditorUrl()
        Gets the editor absolute URL.
        Returns:
        the editorUrl
      • getExplorerUrl

        public String getExplorerUrl()
        Gets the explorer absolute URL.
        Returns:
        the explorerUrl
      • getExplorerUri

        public URI getExplorerUri()
        Gets the explorer page URI.
        Returns:
        the explorer URI
      • getDownloadUrl

        public String getDownloadUrl()
        Gets the download url.
        Returns:
        the download url
      • getDocumentType

        public String getDocumentType()
        Gets the document type.
        Returns:
        the documentType
      • getDocument

        public Config.Document getDocument()
        Gets the document.
        Returns:
        the config
      • getOpenedTime

        public Long getOpenedTime()
        Gets the openedTime.
        Returns:
        the openedTime
      • getClosedTime

        public Long getClosedTime()
        Gets the closedTime.
        Returns:
        the closedTime
      • setOpenedTime

        protected void setOpenedTime​(Long openedTime)
        Sets the openedTime.
        Parameters:
        openedTime - the openedTime
      • setClosedTime

        protected void setClosedTime​(Long closedTime)
        Sets the closedTime.
        Parameters:
        closedTime - the closedTime
      • setEditorPage

        protected void setEditorPage​(EditorPage editorPage)
        Sets the editorPage.
        Parameters:
        editorPage - the editorPage
      • setEditorUrl

        protected void setEditorUrl​(String url)
        Sets the editor url.
        Parameters:
        url - the new editor url
      • getEditorConfig

        public Config.Editor getEditorConfig()
        Gets the editor config.
        Returns:
        the editor
      • setPreviousModified

        public void setPreviousModified​(Calendar previousModified)
        Sets the previous modified.
        Parameters:
        previousModified - the new previous modified
      • getPreviousModified

        public Calendar getPreviousModified()
        Gets the previous modified.
        Returns:
        the previous modified
      • setSameModifier

        public void setSameModifier​(Boolean samemodifier)
        Sets the same modifier.
        Parameters:
        samemodifier - the new same modifier
      • getSameModifier

        public Boolean getSameModifier()
        Gets the same modifier.
        Returns:
        the same modifier
      • forUser

        public Config forUser​(String id,
                              String name,
                              String lang,
                              String documentserverSecret)
        Create a copy of this editor but for another given user.
        Parameters:
        id - String
        name - String
        lang - String
        documentserverSecret - the documentserverSecret
        Returns:
        Config an instance of config similar to this but with another user in the editor
      • 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.
      • 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.
      • 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

        protected void setError​(String error)
        Sets the error.
        Parameters:
        error - the new error
      • hasError

        public boolean hasError()
        Checks for error.
        Returns:
        true, if successful
      • getError

        public String getError()
        Gets the error.
        Returns:
        the error
      • toJSON

        public String toJSON()
                      throws org.exoplatform.ws.frameworks.json.impl.JsonException
        Return this config as JSON string.
        Returns:
        the string
        Throws:
        org.exoplatform.ws.frameworks.json.impl.JsonException - the json exception