- Home
- Connectors
- Plone
Plone
About the ONLYOFFICE and Plone integration
ONLYOFFICE offers an official connector to integrate ONLYOFFICE Docs with Plone and edit documents within the content management system. You can download the ONLYOFFICE connector from PyPi.org and the ONLYOFFICE GitHub page.
Main features
- Creating, editing, and viewing text documents, spreadsheets, and presentations.
- Co-editing documents in real-time: two co-editing modes (Fast and Strict), the Track Changes mode, 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 editing and viewing: DOCX, PPTX, XLSX, DOCXF
- For viewing only: PDF, ODT, ODS, ODP, DOC, XLS, PPT
- For filling forms: DOCXF (Saved as PDF)
- For converting to Office Open XML formats using the ONLYOFFICE Conversion option: ODT, ODS, ODP, DOC, XLS, PPT
Connecting ONLYOFFICE Docs to Plone
Requirements
-
ONLYOFFICE Document Server v6.1 (server or cloud version) or later
You need an instance of ONLYOFFICE Docs that is resolvable and connectable both from Plone and any end clients. It must be able to POST to Plone directly.
Please refer to the official documentation page to learn more about installing ONLYOFFICE Docs. - Python 3.4 and later
- ONLYOFFICE integration plugin 3.0.1 or later for Plone
Installing the ONLYOFFICE integration plugin for Plone
onlyoffice.connector
), please remove it before installing the new version. If
you want to install an earlier version, use onlyoffice.connector
instead of
onlyoffice.plone
when following installation instructions.
Add the
onlyoffice.plone
line to the eggs section of the~/plone/zinstance/buildout.cfg
file, so it should look the following way:[buildout] ... eggs = onlyoffice.plone
For the changes to take effect, re-run
buildout
from your console as a non superuser:sudo -u plone_buildout /plone/zinstance/bin/buildout
Restart your instance:
sudo /plone/zinstance/bin/instance restart
Open your browser, go to your Plone page, log in as Admin and open Site Setup > Add-ons section. Find the onlyoffice.plone among the available add-ons and press the Install button to enable it.
Configuring the ONLYOFFICE integration plugin for Plone
To configure plugin:
- Go to Site Setup.
- Scroll down to the Add-ons Configuration section.
- Press the ONLYOFFICE Configuration button.
-
In the Document Editing service field, specify the URL address where the ONLYOFFICE
Docs is
located.
The address of must be accessible from Plone, as well as the address of Plone must be accessible from ONLYOFFICE Docs.
-
In the Secret key field, 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 Plone 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 Plone integration section of this article.
- In the Server address for internal requests from the Document Editing Service field, specify the address that is used to access Plone from Document Editing Service.
- In the Document Editing Service address for internal requests from the server field, specify the address that is used to access Document Editing Service from Plone.


Developing Plone ONLYOFFICE plugin
-
Clone repository and change directory:
git clone --branch deploy git@github.com:ONLYOFFICE/onlyoffice-plone.git cd onlyoffice-plone
- Create a virtualenv in the package.
- Install requirements with pip.
-
Run buildout:
virtualenv . ./bin/pip install -r requirements.txt ./bin/buildout
- Start Plone in foreground:
./bin/instance fg
If you have a working Plone instance, you can install the plugin by adding the project files to the scr directory:
- In the scr directory, create the onlyoffice.plone directory.
- Put your project files received by Git into the onlyoffice.plone directory.
-
Edit the buildout.cfg file:
[buildout] ... eggs = onlyoffice.plone develop = src/onlyoffice.plone
-
Rerun buildout for the changes to take effect:
.bin/buildout
- Then start or restart your Plone instance.
Plone is based on Zope server and will not run as root user. If you intend to run it as root user, you must supply an effective-user directive. In order to do so, add effective-user
< username >
line to
./parts/instance/etc/zope.conf.Upgrade Plone ONLYOFFICE integration plugin
-
If you specified a concrete plugin version in your buildout.cfg file (so-called
pinning, and a recommended practice), like onlyoffice.plone = 1.0.0, update this
reference to lead to the newer version. If the plugin version is not specified, then the latest version
will be automatically loaded:
[versions] ... onlyoffice.plone = 1.0.1
- Run bin/buildout. Wait until a new version is downloaded and installed.
- Your site may appear distorted or even become inaccessible until you complete the next step.
- Navigate to the Add-on screen (add /prefs_install_products_form to your site URL) and in the Upgrades list select onlyoffice.plone and click Upgrade onlyoffice.plone.
How it works
The ONLYOFFICE integration follows the API documented here.
- User navigates to a document within Plone and selects the ONLYOFFICE Edit action.
- Plone 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 UUID+Modified Timestamp to instruct ONLYOFFICE Docs whether to download the document again or not;
- title: the document title (name).
- Plone constructs a page from the .pt template, filling in all of those values so that the client browser can load up the editor.
- The client browser makes a request to the JavaScript library from ONLYOFFICE Docs and sends ONLYOFFICE Docs the DocEditor configuration with the above properties.
- Then ONLYOFFICE Docs downloads the document from Plone and the user begins editing.
- ONLYOFFICE Docs sends a POST request to callbackUrl to inform Plone that a user is editing the document.
- 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 callbackUrl letting Plone know that the clients have finished editing the document and closed it.
- Plone downloads a new version of the document, replacing the old one.
Enabling JWT for the ONLYOFFICE and Plone 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
-
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"}}}}}
- For Linux -
-
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
-
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
-
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.
Connecting to the demo ONLYOFFICE Docs
Starting from ONLYOFFICE connector version 3.0.0, you can try the ONLYOFFICE online editors within Plone without installing ONLYOFFICE Docs.
To turn the connection on, click the Connect to demo ONLYOFFICE Document Server checkbox and click the Save button.
Start using ONLYOFFICE Docs within Plone
To create a document:
- On the Contents tab, click the Create in ONLYOFFICE menu option on the left.
-
Choose the needed file type: Document, Spreadsheet, or Presentation.
- A new document will be opened for editing.
To edit a document:
-
Find the needed document in the Contents tab.
- Click the document.
-
On the opened page, click the ONLYOFFICE Edit menu option to open the document for editing and/or
viewing.
To convert a document to the Office Open XML format:
- Find the needed document in the Contents tab.
- Click the document.
-
On the opened page, click the Conversion in ONLYOFFICE menu option.
See the full list of the formats which can be converted into OOXML.
-
Click the Convert button.
To create a form template:
- On the Contents tab, click the Create in ONLYOFFICE menu option on the left.
- Choose the Form template option.
- A new empty form template will be opened for editing.
To fill in a form:
- Find the needed form on the Contents tab.
- Click the form.
-
On the opened page, click the Fill in form in ONLYOFFICE menu option.
To download a document in a different format:
- Find the needed document in the Contents tab.
- Click the document.
-
On the opened page, click the Actions menu option and choose the Download as menu item.
- Select the necessary format from the list.
-
Click the Download button.