ONLYOFFICE Connector for Liferay

This plugin enables users to edit office documents from Liferay using ONLYOFFICE Document Server.

  • Currently the following document formats can be opened and edited with this plugin: DOCX, XLSX, PPTX.
  • The following formats are available for view 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.

You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from Liferay and any end clients. If that is not the case, use the official ONLYOFFICE Document Server documetnation page: Document Server for Linux. ONLYOFFICE Document Server must also be able to POST to Liferay directly.

The easiest way to start an instance of ONLYOFFICE Document Server is to use Docker.

Simply run gradle build. Output .jar will be placed inside build/libs directory.

Either install it from Liferay Marketplace or if you're building the plugin by yourself simply put compiled .jar file from build/libs folder to /opt/liferay/deploy. Liferay will install the plugin automatically.

In order to configure plugin you must navigate to System Settings (Control Panel -> Configuration -> System Settings). In Platform section click on Connectors category and select ONLYOFFICE.

The ONLYOFFICE integration follows the API documented here:

User navigates to a 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 Document Server uses to download the document,
  • callbackUrl: the URL that ONLYOFFICE Document Server informs about status of the document editing;
  • key: the fileVersionId to instruct ONLYOFFICE Document Server whether to download the document again or not;
  • title: the document Title (name).

The client browser makes a request for the javascript library from ONLYOFFICE Document Server and sends ONLYOFFICE Document Server the docEditor configuration with the above properties.

Then ONLYOFFICE Document Server downloads the document from Liferay and the user begins editing.

ONLYOFFICE Document Server 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 the ability to collaborate in real time with ONLYOFFICE Document Server 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 Document Server sends a POST to the callback URL letting Liferay know that the clients have finished editing the document and closed it.

Liferay downloads the new version of the document, replacing the old one.

Download the ONLYOFFICE Connector for Liferay here.