Plone ONLYOFFICE integration plugin
This plugin allows users to edit office documents within Plone using ONLYOFFICE Document Server - Community or Integration Edition.
The plugin allows to:
- Create and edit text documents, spreadsheets, and presentations.
- Share documents with other users.
- Co-edit documents in real-time: use two co-editing modes (Fast and Strict), Track Changes, comments, and built-in chat.
- For viewing and editing: DOCX, XLSX, PPTX.
- For viewing only: PDF, ODT, ODS, ODP, DOC, XLS, PPT.
Installing ONLYOFFICE Document Server
You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from Plone and any end-clients.
ONLYOFFICE Document Server must also be able to POST to Plone directly.
You can install free Community version of ONLYOFFICE Document Server or scalable enterprise-level Integration Edition.
To install free Community version, use Docker (recommended) or follow these instructions for Debian, Ubuntu, or derivatives.
To install Integration Edition, follow instructions here.
Installing Plone ONLYOFFICE integration plugin
- Install plugin by adding it to your buildout.cfg:
- Run bin/buildout.
- Go to Site Setup -> Add-ons and press the Install button to enable plugin.
You could also install plugin via Docker:
docker run --rm -p 8080:8080 -e ADDONS="onlyoffice.connector" plone
Both options will automatically install plugin from PyPi.
Configuring Plone ONLYOFFICE integration plugin
To configure plugin go to Site Setup.
Scroll down to Add-ons Configuration section and press the ONLYOFFICE Configuration button.
Developing Plone ONLYOFFICE plugin
- Clone repository and change directory:
git clone --branch deploy firstname.lastname@example.org:ONLYOFFICE/onlyoffice-plone.git
- Create a virtualenv in the package.
- Install requirements with pip.
- Run buildout:
./bin/pip install -r requirements.txt
- Start Plone in foreground:
If you have a working Plone instance, you can install plugin by adding the project files to the scr directory:
- In the scr directory create the onlyoffice.connector directory.
- Put your project files received by git into the onlyoffice.connector directory.
- Edit the buildout.cfg file:
- Rerun buildout for the changes to take effect:
- Then start or restart your Plone instance.
Note that 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 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.connector = 1.0.0, update this reference to point to the newer version.
If the plugin version is not specified, then the latest version will be automatically loaded:
onlyoffice.connector = 1.0.1
- Run bin/buildout. Wait until the new version is downloaded and installed.
- Restart Plone - your site may look weird, or even be inaccessible until you have performed 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.connector and click Upgrade onlyoffice.connector.
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 Document Server uses to download the document;
- callbackUrl: the URL that ONLYOFFICE Document Server informs about status of the document editing;
- key: the UUID+Modified Timestamp to instruct ONLYOFFICE Document Server whether to download the document again or not;
- title: the document Title (name).
- Plone constructs a page from a .pt template, filling in all of those values so that the client browser can load up the editor.
- Then ONLYOFFICE Document Server downloads the document from Plone and the user begins editing.
- ONLYOFFICE Document Server sends a POST request to the callback URL 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 Document Server sends a POST to the callback URL letting Plone know that the clients have finished editing the document and closed it.
- Plone downloads the new version of the document, replacing the old one.