Articles with the tag:
Close
Changelog
Close
Try in the cloud
Try in the cloud
Help Center
Integration

About the ONLYOFFICE and Liferay integration

ONLYOFFICE offers an official connector to integrate ONLYOFFICE Docs with Liferay and edit office documents inside Liferay Document and Media Library. You can download the ONLYOFFICE connector from the Liferay Marketplace or from the GitHub page. The connector is distributed under the Apache license.

To learn more about how the ONLYOFFICE connector for Liferay works , please visit our API documentation page.

Main features

  • Creating files using the Create with ONLYOFFICE menu option.
  • Creating and filling out online forms.
  • Viewing and editing existing text documents, spreadsheets, or presentations using the ONLYOFFICE Edit/View menu option within the Documents and Media section.
  • Co-editing documents in real-time: two co-editing modes (Fast and Strict), Track Changes, comments, and the built-in chat.
  • JWT support to secure your traffic so that no one can have access to your documents with the exception of the users with proper rights

Supported formats

  • For creating, editing and viewing: DOCX, PPTX, XLSX, DOCXF
  • For filling out forms: OFORM
  • For conversion to Office Open XML: ODT, DOC, RTF, TXT, ODP, PPT, ODS, XLS, CSV
  • For viewing only: PDF

What's new in version 2.2.0

Added

  • Preview of the documents
  • Keep intermediate versions when editing (forcesave)
  • Galician empty file templates

Changed

  • Checkin/checkout instead of lock/unlock
  • Fixed deployment error for portal-7.4

The full change log is available here.

Connecting ONLYOFFICE Docs to Liferay

Requirements

  • ONLYOFFICE Docs (Document Server) 6.1.0 or later

    You need an instance of ONLYOFFICE Docs that is resolvable and connectable both from Liferay and any end clients. It must be able to POST to Liferay directly.

    Please refer to the official documentation page to learn more about installing ONLYOFFICE Docs.

    You can also use ONLYOFFICE Docs Cloud (SaaS version).

  • Liferay CE Portal 7.2 GA1+, Liferay DXP 7.2 GA1+, Liferay CE Portal 7.3 GA1+, Liferay DXP 7.3 GA1+, Liferay CE Portal 7.4 GA1+
  • ONLYOFFICE Connector v2.2.0 for Liferay

Installing the ONLYOFFICE Connector for Liferay

You can install the ONLYOFFICE connector using the App Manager or from the official Liferay App Store.

To install it using the App Manager:

  1. Navigate to Control Panel -> Apps -> App Manager.
  2. Click the Liferay options icon Options button.
  3. Click the Upload button.
  4. In the opened window, choose the ONLYOFFICE application file.

To install the connector from the App Store:

  1. Navigate to Control Panel -> Apps -> Store.
  2. Sign in with your Liferay account.
  3. Search the ONLYOFFICE Connector for Liferay.
  4. Purchase the application (it is free).

When the installation is completed, the application is ready for use.

Configuring the ONLYOFFICE connector for Liferay

Go to Control Panel -> Configuration -> System Settings. In the Platform section, choose the Connectors category and select ONLYOFFICE.

ONLYOFFICE_configure ONLYOFFICE_configure

Here you can configure the following settings:

  • ONLYOFFICE Docs address - specify the URL address where Document Editing Service is installed.
    ImportantThe address of ONLYOFFICE Docs must be accessible from Liferay, as well as the address of Liferay must be accessible from ONLYOFFICE Docs.
  • ONLYOFFICE Docs address for internal requests from the server - specify the address that is used to access Document Editing Service from Liferay.
  • Server address for internal requests from ONLYOFFICE Docs - specify the address that is used to access Liferay from Document Editing Service.
  • Secret key - specify the secret used to sign the data.
    Starting from ONLYOFFICE Docs v7.2, JWT is enabled by default and the secret key is generated automatically. You need to enable it on the Liferay side as well: find your secret key in the ONLYOFFICE Docs configuration file, then specify the same secret key in the connector settings. For more details, see the Enabling JWT for the ONLYOFFICE and Liferay integration section of this article.
  • Enable Force Save - activate the checkbox to keep intermediate document versions when editing.
  • Enable ONLYOFFICE Web Preview - activate the checkbox to enable file preview.

After configuring the integration application, click the Save button to apply the changes.

Enabling JWT for the ONLYOFFICE and Liferay integration

To protect documents from unauthorized access, ONLYOFFICE editors use the JSON Web Token (JWT). The token is added in the configuration when the Document Editor is initialized and during the exchange of commands between inner ONLYOFFICE Docs services. The secret key is used to sign the JSON web token and validate the token upon the request to ONLYOFFICE Docs.

Starting from ONLYOFFICE Docs v7.2, JWT is enabled by default and the secret key is generated automatically. You need to find your secret key in the ONLYOFFICE Docs configuration file, then specify the same secret key in the connector settings.

Step 1: Find your secret key in the ONLYOFFICE Docs configuration file

  1. Open the local.json file with any available text editor.
    • For Linux - /etc/onlyoffice/documentserver/local.json
    • For Windows - %ProgramFiles%\ONLYOFFICE\DocumentServer\config\local.json
    • For Docker – enter the ONLYOFFICE Docs container using the docker exec -it <containerID> bash command and open /etc/onlyoffice/documentserver/local.json

      Alternatively, you can use the following command to find the default secret key without opening local.json:

      sudo docker exec <containerID> /var/www/onlyoffice/documentserver/npm/json -f /etc/onlyoffice/documentserver/local.json 'services.CoAuthoring.secret.session.string'

    The local.json file should look like this:

    {
      "services": {
        "CoAuthoring": {
          "token": {
            "enable": {
              "request": {
                "inbox": true,
                "outbox": true
              },
              "browser": true
            }
          },
          "secret": {
            "inbox": {
              "string": "yoursecret"
            },
            "outbox": {
              "string": "yoursecret"
            },
            "session": {
              "string": "yoursecret"
            }
          }
        }
      }
    }
    
  2. The true value is specified in three sections. It means that token validation is enabled.
    • services.CoAuthoring.token.enable.browser
    • services.CoAuthoring.token.enable.request.inbox
    • services.CoAuthoring.token.enable.request.outbox
  3. The automatically generated secret key is specified in three sections. You can replace the default secret value with your own secret key. The secret key must be the same in three sections.
    • services.CoAuthoring.secret.inbox.string
    • services.CoAuthoring.secret.outbox.string
    • services.CoAuthoring.secret.session.string
  4. If you make changes, save them and restart the services for the config changes to take effect.
    supervisorctl restart all

Step 2: Specify the same secret key in the connector settings

In the connector settings, specify the same secret in the Secret key field and save the settings.

Start using ONLYOFFICE Docs within Liferay

To create a file:

  1. Go to the Documents and Media section.
  2. Click the Liferay create icon Add File button.
  3. In the opened menu, click the Create with ONLYOFFICE button.
    ONLYOFFICE_create ONLYOFFICE_create
  4. On the opened page, choose the file type, specify its title and description (optionally).
  5. Click the Save button.
ONLYOFFICE_create2 ONLYOFFICE_create2

To edit a file:

  1. Find the needed file in the Documents and Media section.
  2. Click the document.
  3. In the opened menu, click the Edit in ONLYOFFFICE button.
ONLYOFFICE_edit ONLYOFFICE_edit

To create a form:

  1. Go to the Documents and Media section.
  2. Click the Liferay create icon Add File button.
  3. In the opened menu, click the Create with ONLYOFFICE button.
  4. Choose the Form option, specify the file’s title and description (optionally).
    ONLYOFFICE_createform ONLYOFFICE_createform
  5. Click the Save button.
  6. Save the form as .docxf to have future access to editing, revising or collaborating.

To create a fillable form and restrict file editing by other users:

  1. Click the More icon to the right of the .docxf file.
  2. Choose the Create form using ONLYOFFICE option.
    ONLYOFFICE_createoform ONLYOFFICE_createoform

To fill in a form:

  1. Click the More icon to the right of the .docxf file.
  2. Choose the Fill in form in ONLYOFFICE option.
    ONLYOFFICE_fillform ONLYOFFICE_fillform
To learn more about forms please read the corresponding articles for creating and filling out forms.
Download Best editors on your website Let your site users view, edit and collaborate
on all types of text, spreadsheet and presentation files
You Might Also Like This:
Close