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

About the ONLYOFFICE and Nuxeo integration

ONLYOFFICE offers an official connector to integrate ONLYOFFICE Docs with Nuxeo and edit office documents within the content management system. You can install the ONLYOFFICE connector from the official Nuxeo Marketplace or download it from the GitHub page. The application is distributed under the Apache license.

To learn more about how it works and how to compile the ONLYOFFICE connector for Nuxeo, please visit our API documentation.

Main features

  • Editing text documents, spreadsheets, presentations, and forms.
  • Co-editing documents in real-time: two co-editing modes (Fast and Strict), Track Changes, comments, and a built-in chat.
  • JWT support to secure your traffic so no one, besides the users with proper rights, can have access to your documents.

Supported Formats

  • For editing: DOCX, PPTX, XLSX, DOCXF
  • For filling forms: OFORM
  • For viewing only: PDF, ODT, ODS, ODP, DOC, XLS, PPT, CSV, RTF

Connecting ONLYOFFICE Docs to Nuxeo

Requirements

  • ONLYOFFICE Docs 5.9.4 or later

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

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

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

  • Nuxeo LTS 2019

Installing the ONLYOFFICE addon for Nuxeo

You can connect ONLYOFFICE to a Nuxeo Online Services registered instance with internet access, an unregistered instance, or an offline instance.

The provided instructions use the nuxeoctl script. Visit the official Nuxeo documentation page to find more available options on how to install the packages.

For a Nuxeo Online Services registered instance with internet access please follow these steps:

  1. Stop your server
    ./nuxeoctl stop
  2. Run the following command to install the connector:
    ./nuxeo/bin/nuxeoctl mp-install onlyoffice-nuxeo-x.x.x
    Where onlyoffice-nuxeo-x-x-x is the latest available version of the ONLYOFFICE connector for Nuxeo.
    To find the connector version:
    1. Go to the Nuxeo Marketplace and find the official ONLYOFFICE connector.
    2. Click the Install button
    3. Find the connector version in the For a Nuxeo Online Sevices registered instance with internet access section.
  3. After the package is downloaded and installed, start your server
    ./nuxeoctl start

For an unregistered instance, or an offline instance please follow these steps:

  1. Stop your server
    ./nuxeoctl stop
  2. Download the connector
    wget https://connect.nuxeo.com/nuxeo/site/marketplace/package/onlyoffice-nuxeo/download?version=x.x.x 
    Where version=x.x.x is the latest available version of the ONLYOFFICE connector for Nuxeo. Otherwise, visit the Nuxeo Marketplace and find the link manualy.
  3. Install the package by providing the path to the downloaded .zip file
    ./nuxeoctl mp-install /Path/to/file/onlyoffice-nuxeo-x.x.x.zip
  4. After the package is downloaded and installed, start your server
    ./nuxeoctl start

Configuring the ONLYOFFICE addon for Nuxeo

Open the nuxeo/bin/nuxeo.conf file via any available text editor and add the following lines into it:

onlyoffice.docserv.url=http://documentserver/
onlyoffice.jwt.secret=yoursecret

Where docserv.url is the URL of an installed and running ONLYOFFICE Docs instance, and jwt.secret is the secret to validate the JSON web token upon the request to ONLYOFFICE Docs.

ImportantThe address of ONLYOFFICE Docs must be accessible from Nuxeo, as well as the address of Nuxeo must be accessible from ONLYOFFICE Docs.
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 Nuxeo 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 Nuxeo integration section of this article.

Enabling JWT for the ONLYOFFICE and Nuxeo 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

Step2: Specify the same secret key in the connector settings

In the nuxeo/bin/nuxeo.conf file, specify the same secret in the onlyoffice.jwt.secret=yoursecret string and save the settings.

Start using ONLYOFFICE Docs within Nuxeo

To edit or view a document or a form:

  1. Open the needed file.
  2. Click the View in ONLYOFFICE button.

    The document or form will be opened for viewing and editing.

ONLYOFFICE_viewfile ONLYOFFICE_viewfile
To co-edit a document, the following is required: users need to have the permissions to edit the document and the document format has to be supported by the connector.
To learn more about forms please read the corresponding articles for creating and filling out forms.

To co-edit a document:

  1. Open the summary page of the document.
  2. Click the Collaborative Edition With ONLYOFFICE icon in the bottom right corner of the window.

    The document will be opened for co-editing.

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