Class OnlyofficeDocumentEditorPlugin

  • All Implemented Interfaces:
    org.exoplatform.container.component.ComponentPlugin, org.exoplatform.services.cms.documents.DocumentEditor

    public class OnlyofficeDocumentEditorPlugin
    extends org.exoplatform.container.component.BaseComponentPlugin
    implements org.exoplatform.services.cms.documents.DocumentEditor
    The Class OnlyOfficeNewDocumentEditorPlugin.
    • Field Detail

      • EDITING_FINISHED_DELAY

        protected static final long EDITING_FINISHED_DELAY
        The Constant EDITING_FINISHED_DELAY.
        See Also:
        Constant Field Values
      • PROVIDER_CONFIGURATION_PARAM

        protected static final String PROVIDER_CONFIGURATION_PARAM
        The Constant PROVIDER_CONFIGURATION_PARAM.
        See Also:
        Constant Field Values
      • EDITOR_LINK_NOT_FOUND_ERROR

        protected static final String EDITOR_LINK_NOT_FOUND_ERROR
        The Constant EDITOR_LINK_NOT_FOUND_ERROR.
        See Also:
        Constant Field Values
      • EDITOR_LINK_NOT_FOUND_ERROR_MESSAGE

        protected static final String EDITOR_LINK_NOT_FOUND_ERROR_MESSAGE
        The Constant EDITOR_LINK_NOT_FOUND_ERROR_MESSAGE.
        See Also:
        Constant Field Values
      • STORAGE_ERROR_MESSAGE

        protected static final String STORAGE_ERROR_MESSAGE
        The Constant STORAGE_ERROR_MESSAGE.
        See Also:
        Constant Field Values
      • INTERNAL_EDITOR_ERROR

        protected static final String INTERNAL_EDITOR_ERROR
        The Constant INTERNAL_EDITOR_ERROR.
        See Also:
        Constant Field Values
      • INTERNAL_EDITOR_ERROR_MESSAGE

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

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

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

        protected final org.exoplatform.services.resources.ResourceBundleService i18nService
        The i 18 n service.
      • linkManager

        protected final org.exoplatform.services.cms.link.LinkManager linkManager
        The link manager.
      • editorLinks

        protected final Map<javax.jcr.Node,​String> editorLinks
        The editor links.
      • updateHandler

        protected final org.exoplatform.services.cms.documents.DocumentUpdateActivityHandler updateHandler
        The update handler.
    • Constructor Detail

      • OnlyofficeDocumentEditorPlugin

        public OnlyofficeDocumentEditorPlugin​(OnlyofficeEditorService editorService,
                                              org.exoplatform.services.resources.ResourceBundleService i18nService,
                                              CometdOnlyofficeService cometdService,
                                              org.exoplatform.services.cms.link.LinkManager linkManager)
        Instantiates a new OnlyOffice new document editor plugin.
        Parameters:
        editorService - the editor service
        i18nService - the i18nService
        cometdService - the cometdService
        linkManager - the link manager
    • Method Detail

      • getProviderName

        public String getProviderName()
        Gets the provider name.
        Specified by:
        getProviderName in interface org.exoplatform.services.cms.documents.DocumentEditor
        Returns:
        the provider name
      • onDocumentCreated

        public void onDocumentCreated​(String workspace,
                                      String path)
                               throws Exception
        On document created.
        Specified by:
        onDocumentCreated in interface org.exoplatform.services.cms.documents.DocumentEditor
        Parameters:
        workspace - the workspace
        path - the path
        Throws:
        Exception - the exception
      • beforeDocumentCreate

        public void beforeDocumentCreate​(org.exoplatform.services.cms.documents.NewDocumentTemplate template,
                                         String parentPath,
                                         String title)
                                  throws Exception
        On document create.
        Specified by:
        beforeDocumentCreate in interface org.exoplatform.services.cms.documents.DocumentEditor
        Parameters:
        template - the template
        parentPath - the parent path
        title - the title
        Throws:
        Exception - the exception
      • initActivity

        public void initActivity​(String uuid,
                                 String workspace,
                                 String activityId)
                          throws Exception
        Inits the activity.
        Specified by:
        initActivity in interface org.exoplatform.services.cms.documents.DocumentEditor
        Parameters:
        uuid - the uuid
        workspace - the workspace
        activityId - the activity id
        Throws:
        Exception - the exception
      • initPreview

        public OnlyofficeDocumentEditorPlugin.EditorSetting initPreview​(String fileId,
                                                                        String workspace,
                                                                        URI requestUri,
                                                                        Locale locale)
        Inits the preview.
        Specified by:
        initPreview in interface org.exoplatform.services.cms.documents.DocumentEditor
        Parameters:
        fileId - the uuid
        workspace - the workspace
        requestUri - the requestUri
        locale - the locale
        Returns:
        editor settings
      • initExplorer

        public OnlyofficeDocumentEditorPlugin.EditorSetting initExplorer​(String fileId,
                                                                         String workspace,
                                                                         org.exoplatform.webui.application.WebuiRequestContext context)
        Inits the explorer.
        Specified by:
        initExplorer in interface org.exoplatform.services.cms.documents.DocumentEditor
        Parameters:
        fileId - the file id
        workspace - the workspace
        context - the context
        Returns:
        the editor setting
      • isDocumentSupported

        public boolean isDocumentSupported​(String fileId,
                                           String workspace)
        Checks if is document supported.
        Specified by:
        isDocumentSupported in interface org.exoplatform.services.cms.documents.DocumentEditor
        Parameters:
        fileId - the file id
        workspace - the workspace
        Returns:
        true, if is document supported
      • getDocumentUpdateHandler

        public org.exoplatform.services.cms.documents.DocumentUpdateActivityHandler getDocumentUpdateHandler()
        Gets the document update handler.
        Specified by:
        getDocumentUpdateHandler in interface org.exoplatform.services.cms.documents.DocumentEditor
        Returns:
        the document update handler
      • onLastEditorClosed

        public void onLastEditorClosed​(String fileId,
                                       String workspace)
        On last editor closed.
        Specified by:
        onLastEditorClosed in interface org.exoplatform.services.cms.documents.DocumentEditor
        Parameters:
        fileId - the file id
        workspace - the workspace
      • getEditingFinishedDelay

        public long getEditingFinishedDelay()
        Specified by:
        getEditingFinishedDelay in interface org.exoplatform.services.cms.documents.DocumentEditor