Class OnlyofficeDocumentEditorPlugin

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.onlyoffice.documents.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 Details

    • PROVIDER_NAME

      protected static final String PROVIDER_NAME
      The Constant PROVIDER_NAME.
      See Also:
    • EDITING_FINISHED_DELAY

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

      protected static final String PROVIDER_CONFIGURATION_PARAM
      The Constant PROVIDER_CONFIGURATION_PARAM.
      See Also:
    • STORAGE_ERROR

      protected static final String STORAGE_ERROR
      The Constant STORAGE_ERROR.
      See Also:
    • STORAGE_ERROR_MESSAGE

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

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

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

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

      protected static final String STREAM
      The Constant STREAM.
      See Also:
    • PREVIEW

      protected static final String PREVIEW
      The Constant PREVIEW.
      See Also:
    • DRIVES

      protected static final String DRIVES
      The Constant DRIVES.
      See Also:
    • CLIENT_RESOURCE_PREFIX

      protected static final String CLIENT_RESOURCE_PREFIX
      The Constant CLIENT_RESOURCE_PREFIX.
      See Also:
    • editorService

      protected final OnlyofficeEditorService editorService
      The editor service.
    • i18nService

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

      protected final CometdOnlyofficeService cometdService
      The cometd service.
    • linkManager

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

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

    • 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 Details

    • 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
    • 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