Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/4.0.0 #42

Merged
merged 19 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 4.0.0
## Added
- support for plone 6

## 3.0.0
## Added
- download as
Expand Down
90 changes: 19 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ The plugin allows to:

Supported formats:

* For viewing and editing: DOCX, XLSX, PPTX, DOCXF, OFORM.
* For viewing only: PDF, ODT, ODS, ODP, DOC, XLS, PPT.
* For editing: DOCX, XLSX, PPTX, DOCXF, OFORM.
* For viewing: DJVU, DOC, DOCM, DOCX, DOCXF, DOT, DOTM, DOTX, EPUB, FB2, FODT, HTML, MHT, ODT, OTT, OXPS, PDF, RTF, TXT, XPS, XML, OFORM, CSV, FODS, ODS, OTS, XLS, XLSB, XLSM, XLSX, XLT, XLTM, XLTX, FODP, ODP, OTP, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM, PPTX.
* For converting (download as): DOC, DOCM, DOCX, DOCXF, DOT, DOTM, DOTX, EPUB, FB2, FODT, HTML, MHT, ODT, OTT, OXPS, PDF, RTF, XPS, XML, OFORM, FODS, ODS, OTS, XLS, XLSB, XLSM, XLSX, XLT, XLTM, XLTX, FODP, ODP, OTP, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM, PPTX.
* For converting to Office Open XML: DOC, DOCM, DOCXF, DOT, DOTM, DOTX, EPUB, FB2, FODT, HTML, MHT, ODT, OTT, OXPS, PDF, RTF, XPS, XML, FODS, ODS, OTS, XLS, XLSB, XLSM, XLT, XLTM, XLTX, FODP, ODP, OTP, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM.

## Installing ONLYOFFICE Docs

Expand All @@ -29,90 +31,36 @@ Community Edition vs Enterprise Edition comparison can be found [here](#onlyoffi

## Installing Plone ONLYOFFICE integration plugin

1. Install plugin by adding it to your `buildout.cfg`:
```
[buildout]
1. Installation instructions can be found under [Manage add-ons and packages](https://6.docs.plone.org/install/manage-add-ons-packages.html).
2. To activate, go to `Site Setup` -> `Add-ons` and press the `Install` button to enable the plugin.

...

eggs =
onlyoffice.plone
```
2. Run `bin/buildout`.
3. Go to `Site Setup` -> `Add-ons`and press the `Install` button to enable plugin.

You could also install plugin via Docker
You can also install the plugin via Docker:
```
docker run --rm -p 8080:8080 -e ADDONS="onlyoffice.plone" plone
docker run -p 8080:8080 -e ADDONS="onlyoffice.plone" plone/plone-backend:6.0 start
```
Both options will automatically install plugin from [PyPi](https://pypi.org/project/onlyoffice.plone/).

**Please note:** if you have the previous plugin version installed (earlier plugin versions with the previous name onlyoffice.connector), please remove it before installing the new version.
**Please note:** If you have the previous plugin version installed (earlier plugin versions with the previous name *onlyoffice.connector*), please remove it before installing the new version.

## 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.
To configure the plugin, go to `Site Setup`. Scroll down to the `Add-ons Configuration` section and press the `ONLYOFFICE Configuration` button.

Starting from version 7.2, JWT is enabled by default and the secret key is generated automatically to restrict the access to ONLYOFFICE Docs and for security reasons and data integrity.
Specify your own **Secret key** on the Plone configuration page.
In the ONLYOFFICE Docs [config file](https://api.onlyoffice.com/editors/signature/), specify the same secret key and enable the validation.

## Developing Plone ONLYOFFICE plugin

1. Clone repository and change directory:
```
git clone --branch deploy [email protected]:ONLYOFFICE/onlyoffice-plone.git
cd onlyoffice-plone
```
2. Create a virtualenv in the package.
3. Install requirements with pip.
4. Run buildout:
```
virtualenv .
./bin/pip install -r requirements.txt
./bin/buildout
```
5. Start Plone in foreground:
```
./bin/instance fg
```
If you have a working Plone instance, you can install plugin by adding the project files to the src directory:
1. In the src directory create the onlyoffice.plone directory.
2. Put your project files received by git into the onlyoffice.plone directory.
3. Edit the buildout.cfg file:
```
[buildout]

...

eggs =
onlyoffice.plone

develop =
src/onlyoffice.plone
```
4. Rerun buildout for the changes to take effect:
```
./bin/buildout
```
5. 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](https://zope.readthedocs.io/en/2.12/SETUID.html). In order to do so add `effective-user <username>` line to `./parts/instance/etc/zope.conf`.

## Upgrade Plone ONLYOFFICE integration plugin
1. 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 point to the newer version. If the plugin version is not
specified, then the latest version will be automatically loaded:
```
[versions]
Run this command to install the addon from the local repository:
```
docker run -p 8080:8080 -e DEVELOP="/app/src/onlyoffice.plone" -v /path/to/onlyoffice.plone:/app/src/onlyoffice.plone plone/plone-backend:6.0 start
```

...
For more information, check [Developing packages variable](https://6.dev-docs.plone.org/install/containers/images/backend.html#developing-packages-variable).

onlyoffice.plone = 1.0.1
```
2. Run bin/buildout. Wait until the new version is downloaded and installed.
3. Restart Plone - your site may look weird, or even be inaccessible until you have performed the next step.
4. 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".
## Upgrade Plone ONLYOFFICE integration plugin
1. Update instructions can be found under [Manage add-ons and packages](https://6.docs.plone.org/install/manage-add-ons-packages.html).
2. 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

Expand Down Expand Up @@ -204,4 +152,4 @@ The table below will help you make the right choice.
| Saving as PDF | + | + |
| | [Get it now](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone#docs-community) | [Start Free Trial](https://www.onlyoffice.com/download-docs.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone#docs-enterprise) |

\* If supported by DMS.
\* If supported by DMS.
21 changes: 8 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

setup(
name='onlyoffice.plone',
version='3.0.0',
version='4.0.0',
description="Plone ONLYOFFICE integration plugin",
long_description=long_description,
long_description_content_type="text/markdown",
Expand All @@ -23,13 +23,12 @@
"Environment :: Web Environment",
"Framework :: Plone",
"Framework :: Plone :: Addon",
"Framework :: Plone :: 5.1",
"Framework :: Plone :: 5.2",
"Framework :: Plone :: 6.0",
"Programming Language :: Python",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
"License :: OSI Approved :: Apache Software License",
],
Expand All @@ -49,22 +48,18 @@
package_dir={'': 'src'},
include_package_data=True,
zip_safe=False,
python_requires=">=3.4",
install_requires=[
'setuptools',
# -*- Extra requirements: -*-
'z3c.jbot',
'plone.api>=1.8.4',
'plone.api',
'plone.restapi',
'plone.app.dexterity',
],
extras_require={
'test': [
'plone.app.testing',
# Plone KGS does not use this version, because it would break
# Remove if your package shall be part of coredev.
# plone_coredev tests as of 2016-04-01.
'plone.testing>=5.0.0',
'plone.testing',
'plone.app.contenttypes',
'plone.app.robotframework[debug]',
],
Expand Down
4 changes: 2 additions & 2 deletions src/onlyoffice/plone/browser/actions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2022
# (c) Copyright Ascensio System SIA 2023
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -88,7 +88,7 @@ def handle_cancel(self, action):
def updateActions(self):
super().updateActions()
if self.actions and "Convert" in self.actions:
self.actions["Convert"].addClass("context")
self.actions["Convert"].addClass("btn-primary")

class DownloadAsForm(form.Form):
fields = field.Fields(IDownloadAsForm)
Expand Down
2 changes: 1 addition & 1 deletion src/onlyoffice/plone/browser/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2022
# (c) Copyright Ascensio System SIA 2023
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
14 changes: 14 additions & 0 deletions src/onlyoffice/plone/browser/configure.zcml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
name="onlyoffice-static"
directory="static" />

<plone:static
directory="static/icons"
type="plone"
name="onlyoffice-icons"
/>

<browser:page
name="onlyoffice-controlpanel"
for="Products.CMFPlone.interfaces.IPloneSiteRoot"
Expand All @@ -31,6 +37,7 @@
class=".actions.View"
permission="zope2.View"
template="templates/view.pt"
allowed_attributes="isAvailable"
/>

<browser:page
Expand All @@ -39,6 +46,7 @@
class=".actions.View"
permission="zope2.View"
template="templates/view.pt"
allowed_attributes="isAvailable"
/>

<browser:page
Expand All @@ -47,6 +55,7 @@
class=".actions.Edit"
permission="cmf.ModifyPortalContent"
template="templates/view.pt"
allowed_attributes="isAvailable"
/>

<browser:page
Expand All @@ -55,6 +64,7 @@
class=".actions.FillForm"
permission="cmf.ModifyPortalContent"
template="templates/view.pt"
allowed_attributes="isAvailable"
/>

<browser:page
Expand Down Expand Up @@ -147,13 +157,15 @@
for="plone.app.contenttypes.interfaces.IFile"
class=".actions.ConversionForm"
permission="zope2.View"
allowed_attributes="isAvailable"
/>

<browser:page
name="onlyoffice-convert-document"
for="plone.app.contenttypes.interfaces.IDocument"
class=".actions.ConversionForm"
permission="zope2.View"
allowed_attributes="isAvailable"
/>

<adapter factory=".interfaces.convert_title" name="default" />
Expand All @@ -165,13 +177,15 @@
name="onlyoffice-download-as-file"
class=".actions.DownloadAsForm"
permission="zope2.View"
allowed_attributes="isAvailable"
/>

<browser:page
for="plone.app.contenttypes.interfaces.IDocument"
name="onlyoffice-download-as-document"
class=".actions.DownloadAsForm"
permission="zope2.View"
allowed_attributes="isAvailable"
/>

<utility
Expand Down
4 changes: 2 additions & 2 deletions src/onlyoffice/plone/browser/controlpanel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2022
# (c) Copyright Ascensio System SIA 2023
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,7 +51,7 @@ class IOnlyofficeControlPanel(Interface):
)

docUrlPublicValidation = schema.Bool(
required=True,
required=False,
default=True
)

Expand Down
2 changes: 1 addition & 1 deletion src/onlyoffice/plone/browser/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2022
# (c) Copyright Ascensio System SIA 2023
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions src/onlyoffice/plone/browser/menu.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2022
# (c) Copyright Ascensio System SIA 2023
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,6 +28,7 @@
class OnlyofficeCreateSubMenuItem(BrowserSubMenuItem):

title = _(u'Create in ONLYOFFICE')
icon = "onlyoffice-logo"
submenuId = 'plone_contentmenu_onlyoffice_create'

def __init__(self, context, request):
Expand Down Expand Up @@ -71,11 +72,10 @@ def getMenuItems(self, context, request):
'description': '',
'action': addTokenToUrl('{0}/onlyoffice-create?documentType={1}'.format(currentUrl, documentType), request),
'selected': False,
'icon': None,
'icon': 'onlyoffice-file-' + documentType,
'extra': {
'id': 'document',
'separator': None,
'class': 'contenttype-onlyoffice icon-onlyoffice-file-' + documentType
'separator': None
},
'submenu': None
})
Expand Down
Loading