Class OnlyofficeContext


  • public class OnlyofficeContext
    extends Object
    Created by The eXo Platform SAS.
    Version:
    $Id: OnlyofficeClientContext.java 00000 Mar 18, 2019 pnedonosko $
    Author:
    Peter Nedonosko
    • Field Detail

      • DOCUMENT_WORKSPACE_ATTRIBUTE

        public static final String DOCUMENT_WORKSPACE_ATTRIBUTE
        The Constant DOCUMENT_WORKSPACE_ATTRIBUTE.
        See Also:
        Constant Field Values
      • DOCUMENT_PATH_ATTRIBUTE

        public static final String DOCUMENT_PATH_ATTRIBUTE
        The Constant DOCUMENT_PATH_ATTRIBUTE.
        See Also:
        Constant Field Values
      • JAVASCRIPT

        protected static final String JAVASCRIPT
        The Constant JAVASCRIPT.
      • CLIENT_RESOURCE_PREFIX

        protected static final String CLIENT_RESOURCE_PREFIX
        The Constant CLIENT_RESOURCE_PREFIX.
        See Also:
        Constant Field Values
      • LOG

        protected static final org.exoplatform.services.log.Log LOG
        The Constant LOG.
    • Method Detail

      • init

        public static void init()
                         throws Exception
        Inits the context (current user, CometD settings, etc). on Platform app request start.
        Throws:
        Exception - the exception
      • callModule

        public static void callModule​(String code)
                               throws Exception
        Adds the script to be called on onlyoffice module. Finally it will appear as onlyoffice.myMethod(...), where myMethod(...) it's what given as code parameter.
        Parameters:
        code - the code of a method to invoke on onlyoffice module
        Throws:
        Exception - the exception
      • requireJS

        public static org.exoplatform.web.application.RequireJS requireJS()
                                                                   throws Exception
        Return Web UI app's RequireJS instance.
        Returns:
        the require JS
        Throws:
        Exception - the exception
      • showError

        public static void showError​(String title,
                                     String message)
        Show error message to an user.
        Parameters:
        title - the title
        message - the message