Liferay ONLYOFFICE connector
This plugin enables users to edit office documents from Liferay using ONLYOFFICE Docs.
- Currently the following document formats can be opened and edited with this plugin: DOCX, XLSX, PPTX, DOCXF, OFORM.
- The following formats are available for viewing only: ODT, ODS, ODP, DOC, XLS, PPT.
- The plugin will create a new ONLYOFFICE Edit/View menu option within the Documents and Media section for Office documents.
This allows multiple users to collaborate in real time and to save back those changes to Liferay.
Installing ONLYOFFICE Docs
You will need an instance of ONLYOFFICE Docs (Document Server) that is resolvable and connectable both from Liferay and any end clients.
If that is not the case, use the official ONLYOFFICE Docs documentation page.
ONLYOFFICE Docs must also be able to POST to Liferay directly.
The easiest way to start an instance of ONLYOFFICE Docs is to use Docker.
Installing Liferay ONLYOFFICE connector
Either install it from Liferay Marketplace
or if you are building the connector by yourself simply put compiled .jar file from build\libs folder to /opt/liferay/deploy.
Liferay will install it automatically.
Configuring Liferay ONLYOFFICE connector
In order to configure connector you must navigate to System Settings (Control Panel -> Configuration -> System Settings).
In Platform section click the Connectors category and select ONLYOFFICE.
Compiling Liferay ONLYOFFICE connector
Simply run gradle build.
Output .jar will be placed inside the build/libs directory.
How it works
- User navigates to the Documents and Media section within Liferay and selects the Edit in ONLYOFFICE action.
Liferay prepares a JSON object for the Document Server with the following properties:
- url: the URL that ONLYOFFICE Docs uses to download the document,
- callbackUrl: the URL that ONLYOFFICE Docs informs about status of the document editing;
- key: the fileVersionId to instruct ONLYOFFICE Docs whether to download the document again or not;
- title: the document title (name).
- Then ONLYOFFICE Docs downloads the document from Liferay and the user begins editing.
- ONLYOFFICE Docs sends a POST request to the callback URL to inform Liferay that a user is editing the document.
- Liferay locks the document, but still allows other users with write access to collaborate in real time with ONLYOFFICE Docs by leaving the Action present.
- When all users and client browsers are done with editing, they close the editing window.
- After 10 seconds of inactivity, ONLYOFFICE Docs sends a POST to the callback URL letting Liferay know that the clients have finished editing the document and closed it.
- Liferay downloads a new version of the document, replacing the old one.
Download the Liferay ONLYOFFICE connector here.