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.DocumentEditorThe Class OnlyOfficeNewDocumentEditorPlugin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOnlyofficeDocumentEditorPlugin.EditorErrorThe Class Error.protected static classOnlyofficeDocumentEditorPlugin.EditorSettingThe Class EditorSetting.
-
Field Summary
Fields Modifier and Type Field Description protected static StringCLIENT_RESOURCE_PREFIXThe Constant CLIENT_RESOURCE_PREFIX.protected CometdOnlyofficeServicecometdServiceThe cometd service.protected static StringDRIVESThe Constant DRIVES.protected static longEDITING_FINISHED_DELAYThe Constant EDITING_FINISHED_DELAY.protected static StringEDITOR_LINK_NOT_FOUND_ERRORThe Constant EDITOR_LINK_NOT_FOUND_ERROR.protected static StringEDITOR_LINK_NOT_FOUND_ERROR_MESSAGEThe Constant EDITOR_LINK_NOT_FOUND_ERROR_MESSAGE.protected Map<javax.jcr.Node,String>editorLinksThe editor links.protected OnlyofficeEditorServiceeditorServiceThe editor service.protected org.exoplatform.services.resources.ResourceBundleServicei18nServiceThe i 18 n service.protected static StringINTERNAL_EDITOR_ERRORThe Constant INTERNAL_EDITOR_ERROR.protected static StringINTERNAL_EDITOR_ERROR_MESSAGEThe Constant INTERNAL_EDITOR_ERROR_MESSAGE.protected org.exoplatform.services.cms.link.LinkManagerlinkManagerThe link manager.protected static org.exoplatform.services.log.LogLOGThe Constant LOG.protected static StringPREVIEWThe Constant PREVIEW.protected static StringPROVIDER_CONFIGURATION_PARAMThe Constant PROVIDER_CONFIGURATION_PARAM.protected static StringPROVIDER_NAMEThe Constant PROVIDER_NAME.protected static StringSTORAGE_ERRORThe Constant STORAGE_ERROR.protected static StringSTORAGE_ERROR_MESSAGEThe Constant STORAGE_ERROR_MESSAGE.protected static StringSTREAMThe Constant STREAM.protected org.exoplatform.services.cms.documents.DocumentUpdateActivityHandlerupdateHandlerThe update handler.
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeDocumentCreate(org.exoplatform.services.cms.documents.NewDocumentTemplate template, String parentPath, String title)On document create.org.exoplatform.services.cms.documents.DocumentUpdateActivityHandlergetDocumentUpdateHandler()Gets the document update handler.longgetEditingFinishedDelay()StringgetProviderName()Gets the provider name.voidinitActivity(String uuid, String workspace, String activityId)Inits the activity.OnlyofficeDocumentEditorPlugin.EditorSettinginitExplorer(String fileId, String workspace, org.exoplatform.webui.application.WebuiRequestContext context)Inits the explorer.OnlyofficeDocumentEditorPlugin.EditorSettinginitPreview(String fileId, String workspace, URI requestUri, Locale locale)Inits the preview.booleanisDocumentSupported(String fileId, String workspace)Checks if is document supported.voidonDocumentCreated(String workspace, String path)On document created.voidonLastEditorClosed(String fileId, String workspace)On last editor closed.-
Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
-
-
-
Field Detail
-
PROVIDER_NAME
protected static final String PROVIDER_NAME
The Constant PROVIDER_NAME.- See Also:
- Constant Field Values
-
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
protected static final String STORAGE_ERROR
The Constant STORAGE_ERROR.- 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.
-
STREAM
protected static final String STREAM
The Constant STREAM.- See Also:
- Constant Field Values
-
PREVIEW
protected static final String PREVIEW
The Constant PREVIEW.- See Also:
- Constant Field Values
-
DRIVES
protected static final String DRIVES
The Constant DRIVES.- See Also:
- Constant Field Values
-
CLIENT_RESOURCE_PREFIX
protected static final String CLIENT_RESOURCE_PREFIX
The Constant CLIENT_RESOURCE_PREFIX.- See Also:
- Constant Field Values
-
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 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 servicei18nService- the i18nServicecometdService- the cometdServicelinkManager- the link manager
-
-
Method Detail
-
getProviderName
public String getProviderName()
Gets the provider name.- Specified by:
getProviderNamein interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Returns:
- the provider name
-
onDocumentCreated
public void onDocumentCreated(String workspace, String path) throws Exception
On document created.- Specified by:
onDocumentCreatedin interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Parameters:
workspace- the workspacepath- the path- Throws:
Exception- the exception
-
beforeDocumentCreate
public void beforeDocumentCreate(org.exoplatform.services.cms.documents.NewDocumentTemplate template, String parentPath, String title) throws ExceptionOn document create.- Specified by:
beforeDocumentCreatein interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Parameters:
template- the templateparentPath- the parent pathtitle- the title- Throws:
Exception- the exception
-
initActivity
public void initActivity(String uuid, String workspace, String activityId) throws Exception
Inits the activity.- Specified by:
initActivityin interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Parameters:
uuid- the uuidworkspace- the workspaceactivityId- 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:
initPreviewin interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Parameters:
fileId- the uuidworkspace- the workspacerequestUri- the requestUrilocale- 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:
initExplorerin interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Parameters:
fileId- the file idworkspace- the workspacecontext- the context- Returns:
- the editor setting
-
isDocumentSupported
public boolean isDocumentSupported(String fileId, String workspace)
Checks if is document supported.- Specified by:
isDocumentSupportedin interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Parameters:
fileId- the file idworkspace- the workspace- Returns:
- true, if is document supported
-
getDocumentUpdateHandler
public org.exoplatform.services.cms.documents.DocumentUpdateActivityHandler getDocumentUpdateHandler()
Gets the document update handler.- Specified by:
getDocumentUpdateHandlerin interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Returns:
- the document update handler
-
onLastEditorClosed
public void onLastEditorClosed(String fileId, String workspace)
On last editor closed.- Specified by:
onLastEditorClosedin interfaceorg.exoplatform.services.cms.documents.DocumentEditor- Parameters:
fileId- the file idworkspace- the workspace
-
getEditingFinishedDelay
public long getEditingFinishedDelay()
- Specified by:
getEditingFinishedDelayin interfaceorg.exoplatform.services.cms.documents.DocumentEditor
-
-