diff --git a/.gitmodules b/.gitmodules index 6fac664..d21ae08 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ -[submodule "src/onlyoffice/connector/browser/app_data"] - path = src/onlyoffice/connector/browser/app_data +[submodule "src/onlyoffice/plone/browser/app_data"] + path = src/onlyoffice/plone/browser/app_data url = https://github.com/ONLYOFFICE/document-templates branch = main/new diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa38fc..0316db0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## 3.0.0 +## Added +- download as +- documents conversion +- connection to a demo document server +- settings validation +- mail merge from storage +- compare file from storage +- insert image from storage +- advanced server settings for specifying internal addresses + +## Changed +- parameter document.title for editor from file object title +- document server v6.0 and earlier is no longer supported + ## 2.1.1 ## Fixed - issue with packaging diff --git a/MANIFEST.in b/MANIFEST.in index b0d81ae..1801f7f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -15,6 +15,12 @@ recursive-include src *.sh recursive-include src *.txt recursive-include src *.xml recursive-include src *.zcml +recursive-include src *.eot +recursive-include src *.svg +recursive-include src *.ttf +recursive-include src *.woff +recursive-include src *.woff2 +recursive-include src *.json recursive-include src *.docx recursive-include src *.docxf diff --git a/README.md b/README.md index c695e42..c9e9f65 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ You will need an instance of ONLYOFFICE Docs (Document Server) that is resolvabl You can install free Community version of ONLYOFFICE Docs or scalable Enterprise Edition with pro features. -To install free Community version, use [Docker](https://github.com/onlyoffice/Docker-DocumentServer) (recommended) or follow [these instructions](https://helpcenter.onlyoffice.com/server/linux/document/linux-installation.aspx) for Debian, Ubuntu, or derivatives. +To install free Community version, use [Docker](https://github.com/onlyoffice/Docker-DocumentServer) (recommended) or follow [these instructions](https://helpcenter.onlyoffice.com/installation/docs-community-install-ubuntu.aspx) for Debian, Ubuntu, or derivatives. -To install Enterprise Edition, follow instructions [here](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx). +To install Enterprise Edition, follow instructions [here](https://helpcenter.onlyoffice.com/installation/docs-enterprise-index.aspx). Community Edition vs Enterprise Edition comparison can be found [here](#onlyoffice-docs-editions). @@ -36,16 +36,18 @@ Community Edition vs Enterprise Edition comparison can be found [here](#onlyoffi ... eggs = - onlyoffice.connector + 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 ``` -docker run --rm -p 8080:8080 -e ADDONS="onlyoffice.connector" plone +docker run --rm -p 8080:8080 -e ADDONS="onlyoffice.plone" plone ``` -Both options will automatically install plugin from [PyPi](https://pypi.org/project/onlyoffice.connector/). +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. ## Configuring Plone ONLYOFFICE integration plugin @@ -71,8 +73,8 @@ To configure plugin go to `Site Setup`. Scroll down to `Add-ons Configuration` s ./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.connector directory. -2. Put your project files received by git into the onlyoffice.connector 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] @@ -80,10 +82,10 @@ If you have a working Plone instance, you can install plugin by adding the proje ... eggs = - onlyoffice.connector + onlyoffice.plone develop = - src/onlyoffice.connector + src/onlyoffice.plone ``` 4. Rerun buildout for the changes to take effect: ``` @@ -95,18 +97,18 @@ Note that Plone is based on Zope server and will not run as `root` user. If you ## 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.connector = 1.0.0, update this reference to point to the newer version. If the plugin version is not + 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] ... - onlyoffice.connector = 1.0.1 + 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.connector and click "Upgrade onlyoffice.connector". +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". ## How it works diff --git a/base.cfg b/base.cfg index 89ffef3..b93313f 100644 --- a/base.cfg +++ b/base.cfg @@ -30,7 +30,7 @@ eggs = Plone Pillow plone.app.debugtoolbar - onlyoffice.connector [test] + onlyoffice.plone [test] [code-analysis] @@ -49,7 +49,7 @@ recipe = zc.recipe.testrunner eggs = ${instance:eggs} initialization = os.environ['TZ'] = 'UTC' -defaults = ['-s', 'onlyoffice.connector', '--auto-color', '--auto-progress'] +defaults = ['-s', 'onlyoffice.plone', '--auto-color', '--auto-progress'] [coverage] @@ -103,5 +103,5 @@ scripts = plone-compile-resources [versions] -# Don't use a released version of onlyoffice.connector -onlyoffice.connector = +# Don't use a released version of onlyoffice.plone +onlyoffice.plone = diff --git a/setup.py b/setup.py index ad53e24..c770221 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -"""Installer for the onlyoffice.connector package.""" +"""Installer for the onlyoffice.plone package.""" from setuptools import find_packages from setuptools import setup @@ -13,8 +13,8 @@ setup( - name='onlyoffice.connector', - version='2.1.1', + name='onlyoffice.plone', + version='3.0.0', description="Plone ONLYOFFICE integration plugin", long_description=long_description, long_description_content_type="text/markdown", @@ -31,19 +31,19 @@ "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Operating System :: OS Independent", - "License :: OSI Approved :: GNU Affero General Public License v3", + "License :: OSI Approved :: Apache Software License", ], keywords='Python Plone', author='Ascensio System SIA', author_email='integration@onlyoffice.com', url='https://github.com/ONLYOFFICE/onlyoffice-plone', project_urls={ - 'PyPI': 'https://pypi.python.org/pypi/onlyoffice.connector', + 'PyPI': 'https://pypi.python.org/pypi/onlyoffice.plone', 'Source': 'https://github.com/ONLYOFFICE/onlyoffice-plone', 'Tracker': 'https://github.com/ONLYOFFICE/onlyoffice-plone/issues', - # 'Documentation': 'https://onlyoffice.connector.readthedocs.io/en/latest/', + # 'Documentation': 'https://onlyoffice.plone.readthedocs.io/en/latest/', }, - license='AGPL version 3', + license='Apache-2.0 License', packages=find_packages('src', exclude=['ez_setup']), namespace_packages=['onlyoffice'], package_dir={'': 'src'}, @@ -73,6 +73,6 @@ [z3c.autoinclude.plugin] target = plone [console_scripts] - update_locale = onlyoffice.connector.locales.update:update_locale + update_locale = onlyoffice.plone.locales.update:update_locale """, ) diff --git a/src/onlyoffice/connector/browser/api.py b/src/onlyoffice/connector/browser/api.py deleted file mode 100644 index 808c80d..0000000 --- a/src/onlyoffice/connector/browser/api.py +++ /dev/null @@ -1,323 +0,0 @@ -# -# (c) Copyright Ascensio System SIA 2021 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from Acquisition import aq_inner -from AccessControl import getSecurityManager -from Products.Five.browser import BrowserView -from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile -from plone.namedfile.browser import Download -from plone.namedfile.file import NamedBlobFile -from plone.rfc822.interfaces import IPrimaryFieldInfo -from plone.registry.interfaces import IRegistry -from z3c.form import form -from zope.component import getMultiAdapter -from zope.component import getUtility -from zope.publisher.interfaces import NotFound -from plone.app.uuid.utils import uuidToObject -from plone.protect.utils import addTokenToUrl -from Acquisition import aq_inner -from Acquisition import aq_parent -from plone.app.dexterity.interfaces import IDXFileFactory -from zExceptions import BadRequest -from plone.app.content.utils import json_dumps -from AccessControl import getSecurityManager -from Products.CMFPlone.permissions import AddPortalContent -from Products.CMFCore.utils import getToolByName -from onlyoffice.connector.core.config import Config -from onlyoffice.connector.core import fileUtils -from onlyoffice.connector.core import utils -from onlyoffice.connector.core import featureUtils -from onlyoffice.connector.interfaces import logger -from onlyoffice.connector.interfaces import _ -from urllib.request import urlopen -from onlyoffice.connector.interfaces import _ - -import json -import os -import mimetypes - -class Edit(form.EditForm): - def isAvailable(self): - filename = self.context.file.filename - return fileUtils.canEdit(filename) - - docUrl = None - editorCfg = None - - def __call__(self): - self.docUrl = Config(getUtility(IRegistry)).docUrl - self.saveAs = featureUtils.getSaveAsObject(self.context) - self.editorCfg = get_config(self, True) - self.relatedItemsOptions = json.dumps(fileUtils.getRelatedRtemsOptions(self.context)) - self.token = get_token(self) - if not self.editorCfg: - index = ViewPageTemplateFile("templates/error.pt") - return index(self) - return self.index() - -class FillForm(form.EditForm): - def isAvailable(self): - filename = self.context.file.filename - return fileUtils.canFillForm(filename) - - docUrl = None - editorCfg = None - - def __call__(self): - self.docUrl = Config(getUtility(IRegistry)).docUrl - self.saveAs = featureUtils.getSaveAsObject(self.context) - self.editorCfg = get_config(self, True) - self.relatedItemsOptions = json.dumps(fileUtils.getRelatedRtemsOptions(self.context)) - self.token = get_token(self) - if not self.editorCfg: - index = ViewPageTemplateFile("templates/error.pt") - return index(self) - return self.index() - -class View(BrowserView): - def isAvailable(self): - filename = self.context.file.filename - return fileUtils.canView(filename) - - docUrl = None - editorCfg = None - - def __call__(self): - self.docUrl = Config(getUtility(IRegistry)).docUrl - self.saveAs = featureUtils.getSaveAsObject(self.context) - self.editorCfg = get_config(self, False) - self.relatedItemsOptions = json.dumps(fileUtils.getRelatedRtemsOptions(self.context)) - self.token = get_token(self) - if not self.editorCfg: - index = ViewPageTemplateFile("templates/error.pt") - return index(self) - return self.index() - -def portal_state(self): - context = aq_inner(self.context) - portal_state = getMultiAdapter((context, self.request), name=u'plone_portal_state') - return portal_state - -def get_token(self): - authenticator = getMultiAdapter((self.context, self.request), name="authenticator") - - return authenticator.token() - -def get_config(self, forEdit): - # def viewURLFor(self, item): - # cstate = getMultiAdapter((item, item.REQUEST), name='plone_context_state') - # return cstate.view_url() - - logger.info("getting config for " + self.context.absolute_url()) - canEdit = forEdit and bool(getSecurityManager().checkPermission('Modify portal content', self.context)) - - filename = self.context.file.filename - if not fileUtils.canView(filename) or (forEdit and not fileUtils.canEdit(filename) and not fileUtils.canFillForm(filename)): - # self.request.response.status = 500 - # self.request.response.setHeader('Location', self.viewURLFor(self.context)) - return None - - state = portal_state(self) - user = state.member() - securityToken = utils.createSecurityTokenFromContext(self.context) - config = { - 'type': 'desktop', - 'documentType': fileUtils.getFileType(filename), - 'document': { - 'title': filename, - 'url': self.context.absolute_url() + '/onlyoffice-dl?token=' + securityToken, - 'fileType': fileUtils.getFileExt(filename)[1:], - 'key': utils.getDocumentKey(self.context), - 'info': { - 'author': self.context.creators[0], - 'created': str(self.context.creation_date) - }, - 'permissions': { - 'edit': canEdit - } - }, - 'editorConfig': { - 'mode': 'edit' if canEdit else 'view', - 'lang': state.language(), - 'user': { - 'id': user.getId(), - 'name': user.getUserName() - }, - 'customization': { - 'feedback': True - } - } - } - if canEdit: - config['editorConfig']['callbackUrl'] = self.context.absolute_url() + '/onlyoffice-callback?token=' + securityToken - - if utils.isJwtEnabled(): - config['token'] = utils.createSecurityToken(config) - - return json.dumps(config) - -class Callback(BrowserView): - def __call__(self): - logger.info("got callback request for " + self.context.absolute_url()) - logger.debug(vars(self.request)) - utils.checkSecurityToken(self.context, utils.getTokenFromRequest(self.request)) - self.request.response.setHeader('Content-Type', 'application/json') - - error = None - response = {} - - try: - body = json.loads(self.request.get('BODY')) - logger.debug(body) - - if utils.isJwtEnabled(): - token = body.get('token') - - if (not token): - token = utils.getTokenFromHeader(self.request) - - if (not token): - raise Exception('Expected JWT') - - body = utils.decodeSecurityToken(token) - if (body.get('payload')): - body = body['payload'] - - status = body['status'] - download = body.get('url') - if (status == 2) | (status == 3): # mustsave, corrupted - logger.info("saving file " + self.context.absolute_url()) - self.context.file = NamedBlobFile(urlopen(download).read(), filename=self.context.file.filename) - self.context.reindexObject() - logger.info("saved " + self.context.absolute_url()) - - except Exception as e: - error = str(e) - - if error: - logger.warn("error while saving " + self.context.absolute_url() + ": " + error) - response['error'] = 1 - response['message'] = error - self.request.response.status = 500 - else: - response['error'] = 0 - self.request.response.status = 200 - - return json.dumps(response) - -class ODownload(Download): - def _getFile(self): - logger.info("got download request for " + self.context.absolute_url()) - - if utils.isJwtEnabled(): - token = utils.getTokenFromHeader(self.request) - - if (not token): - raise Exception('Expected JWT') - - utils.decodeSecurityToken(token) - - utils.checkSecurityToken(self.context, utils.getTokenFromRequest(self.request)) - - if not self.fieldname: - info = IPrimaryFieldInfo(self.context, None) - if info is None: - # Ensure that we have at least a fieldname - raise NotFound(self, '', self.request) - self.fieldname = info.fieldname - - file = info.value - - if file is None: - raise NotFound(self, self.fieldname, self.request) - - return file - -class Create(BrowserView): - def __call__( - self, - documentType - ): - fileName = fileUtils.getDefaultNameByType(documentType) - fileExt = fileUtils.getDefaultExtByType(documentType) - - if fileName is None or fileExt is None: - raise NotFound(self, documentType, self.request) - - template = 'new.' + fileExt - - state = portal_state(self) - language = state.language() - - localePath = fileUtils.localePath.get(language) - if localePath is None: - language = language.split('-')[0] - localePath = fileUtils.localePath.get(language) - if localePath is None: - localePath = fileUtils.localePath.get('en') - - file = open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'app_data', localePath, template), 'rb') - - try: - data = file.read() - finally: - file.close() - - factory = IDXFileFactory(self.context) - contentType = mimetypes.guess_type(template)[0] or '' - - file = factory(fileName + '.' + fileExt, contentType, data) - - self.request.response.redirect(addTokenToUrl('{0}/onlyoffice-edit'.format(file.absolute_url()))) - -class SaveAs(BrowserView): - def __call__(self): - body = json.loads(self.request.get('BODY')) - url = body.get('url') - fileType = body.get('fileType') - fileTitle = body.get('fileTitle') - folderUID = body.get('folderUID') - - if not url or not fileType or not fileTitle: - raise BadRequest(u'Required url or fileType or fileTitle parameters not found.') - - if not folderUID: - portal_url = getToolByName(self.context, "portal_url") - folder = portal_url.getPortalObject() - else: - folder = uuidToObject(folderUID) - - if not getSecurityManager().checkPermission(AddPortalContent, folder): - response = self.request.RESPONSE - response.setStatus(403) - return "You are not authorized to add content to this folder." - - fileName = fileUtils.getCorrectFileName(fileTitle + "." + fileType) - contentType = mimetypes.guess_type(fileName)[0] or '' - - data = urlopen(url).read() - - factory = IDXFileFactory(folder) - file = factory(fileName, contentType, data) - - self.request.response.setHeader( - "Content-Type", "application/json; charset=utf-8" - ) - - return json_dumps({ - "status": "success", - "fileName": fileName - }) diff --git a/src/onlyoffice/connector/browser/app_data b/src/onlyoffice/connector/browser/app_data deleted file mode 160000 index 47e28a8..0000000 --- a/src/onlyoffice/connector/browser/app_data +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 47e28a87f5eb0fd90739ff8a6f959e7807d47b0b diff --git a/src/onlyoffice/connector/browser/configure.zcml b/src/onlyoffice/connector/browser/configure.zcml deleted file mode 100644 index 242bf94..0000000 --- a/src/onlyoffice/connector/browser/configure.zcml +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/onlyoffice/connector/browser/controlpanel.py b/src/onlyoffice/connector/browser/controlpanel.py deleted file mode 100644 index 7784661..0000000 --- a/src/onlyoffice/connector/browser/controlpanel.py +++ /dev/null @@ -1,45 +0,0 @@ -# -# (c) Copyright Ascensio System SIA 2021 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper -from plone.app.registry.browser.controlpanel import RegistryEditForm -from plone.z3cform import layout -from zope import schema -from zope.interface import Interface -from onlyoffice.connector.interfaces import _ - - -class IOnlyofficeControlPanel(Interface): - - docUrl = schema.TextLine( - title=_(u'Document Editing service'), - required=True, - default=u'https://documentserver/', - ) - - jwtSecret = schema.TextLine( - title=_(u'Secret key (leave blank to disable)'), - required=False, - ) - -class OnlyofficeControlPanelForm(RegistryEditForm): - schema = IOnlyofficeControlPanel - schema_prefix = "onlyoffice.connector" - label = _(u'ONLYOFFICE Configuration') - - -OnlyofficeControlPanelView = layout.wrap_form( - OnlyofficeControlPanelForm, ControlPanelFormWrapper) \ No newline at end of file diff --git a/src/onlyoffice/connector/core/featureUtils.py b/src/onlyoffice/connector/core/featureUtils.py deleted file mode 100644 index 9632f6d..0000000 --- a/src/onlyoffice/connector/core/featureUtils.py +++ /dev/null @@ -1,32 +0,0 @@ -# -# (c) Copyright Ascensio System SIA 2021 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from Products.CMFCore.utils import getToolByName -from onlyoffice.connector.interfaces import _ - -import json - -def getSaveAsObject(context): - return json.dumps({ - 'available': not getToolByName(context, 'portal_membership').isAnonymousUser(), - 'title': _(u'Save copy file as'), - 'helpTitle': _(u'Leave the field blank to save to the root of the site'), - 'messages': { - 'success': _(u'The file was successfully saved as '), - 'errorNotAuthorized': _(u'You are not authorized to add content to this folder'), - 'errorUnknown': _(u'Unknown error while saving file') - } - }) \ No newline at end of file diff --git a/src/onlyoffice/connector/core/fileUtils.py b/src/onlyoffice/connector/core/fileUtils.py deleted file mode 100644 index 4ff5322..0000000 --- a/src/onlyoffice/connector/core/fileUtils.py +++ /dev/null @@ -1,128 +0,0 @@ -# -# (c) Copyright Ascensio System SIA 2021 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from plone.app.widgets.utils import get_relateditems_options -from onlyoffice.connector.interfaces import _ -import re - -localePath = { - 'az': 'az-Latn-AZ', - 'bg': 'bg-BG', - 'cs': 'cs-CZ', - 'de': 'de-DE', - 'el': 'el-GR', - 'en-gb': 'en-GB', - 'en': 'en-US', - 'es': 'es-ES', - 'fr': 'fr-FR', - 'it': 'it-IT', - 'ja': 'ja-JP', - 'ko': 'ko-KR', - 'lv': 'lv-LV', - 'nl': 'nl-NL', - 'pl': 'pl-PL', - 'pt-br': 'pt-BR', - 'pt': 'pt-PT', - 'ru': 'ru-RU', - 'sk': 'sk-SK', - 'sv': 'sv-SE', - 'uk': 'uk-UA', - 'vi': 'vi-VN', - 'zh': 'zh-CN' - } - -def getFileName(str): - ind = str.rfind('/') - return str[ind+1:] - -def getFileNameWithoutExt(str): - fn = getFileName(str) - ind = fn.rfind('.') - return fn[:ind] - -def getCorrectFileName(str): - return re.sub(r'[*?:\"<>/|\\\\]', '_', str) - -def getFileExt(str): - fn = getFileName(str) - ind = fn.rfind('.') - return fn[ind:].lower() - -def getFileType(str): - ext = getFileExt(str) - if ext in [ ".doc", ".docx", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".fodt", ".ott", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps", ".docxf", ".oform" ]: - return 'text' - if ext in [ ".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".fods", ".ots", ".csv" ]: - return 'spreadsheet' - if ext in [ ".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp", ".fodp", ".otp"]: - return 'presentation' - - return 'text' - -def canView(str): - ext = getFileExt(str) - if ext in [ ".doc", ".docx", ".docm", ".dot", ".dotx", ".dotm", ".odt", ".fodt", ".ott", ".rtf", ".txt", ".html", ".htm", ".mht", ".pdf", ".djvu", ".fb2", ".epub", ".xps", ".xls", ".xlsx", ".xlsm", ".xlt", ".xltx", ".xltm", ".ods", ".fods", ".ots", ".csv", ".pps", ".ppsx", ".ppsm", ".ppt", ".pptx", ".pptm", ".pot", ".potx", ".potm", ".odp", ".fodp", ".otp", ".docxf", ".oform" ]: - return True - - return False - -def canEdit(str): - ext = getFileExt(str) - if ext in [ ".docx", ".xlsx", ".pptx", ".docxf" ]: - return True - - return False - -def canFillForm(str): - ext = getFileExt(str) - if ext in [ ".oform" ]: - return True - - return False - -def getDefaultExtByType(str): - if (str == 'word'): - return 'docx' - if (str == 'cell'): - return 'xlsx' - if (str == 'slide'): - return 'pptx' - if (str == 'form'): - return 'docxf' - - return None - -def getDefaultNameByType(str): - if (str == 'word'): - return _(u'Document') - if (str == 'cell'): - return _(u'Spreadsheet') - if (str == 'slide'): - return _(u'Presentation') - if (str == 'form'): - return _(u'Form template') - - return None - -def getRelatedRtemsOptions(context): - return get_relateditems_options( - context=context, - value=None, - separator=";", - vocabulary_name="plone.app.vocabularies.Catalog", - vocabulary_view="@@getVocabulary", - field_name="relatedItems", - ) \ No newline at end of file diff --git a/src/onlyoffice/connector/core/utils.py b/src/onlyoffice/connector/core/utils.py deleted file mode 100644 index c9261b2..0000000 --- a/src/onlyoffice/connector/core/utils.py +++ /dev/null @@ -1,61 +0,0 @@ -# -# (c) Copyright Ascensio System SIA 2021 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from logging import log -from plone.uuid.interfaces import IUUID -from zope.publisher.interfaces import Unauthorized -from urllib.parse import parse_qs -from plone.registry.interfaces import IRegistry -from zope.component import getUtility -from onlyoffice.connector.core.config import Config - -import base64 -import jwt -import os - -def getDocumentKey(obj): - return base64.b64encode((obj.id + '_' + str(obj.modification_date)).encode('utf8')).decode('ascii') - -def isJwtEnabled(): - return bool(Config(getUtility(IRegistry)).jwtSecret) - -def createSecurityToken(payload, jwtSecret = None): - if (jwtSecret is None): - jwtSecret = Config(getUtility(IRegistry)).jwtSecret - return jwt.encode(payload, jwtSecret, algorithm="HS256").decode("utf-8") - -def createSecurityTokenFromContext(obj): - return createSecurityToken({"key": obj.id}, IUUID(obj)) - -def decodeSecurityToken(token): - return jwt.decode(token, Config(getUtility(IRegistry)).jwtSecret, algorithms=['HS256']) - -def checkSecurityToken(obj, token): - if (token != createSecurityTokenFromContext(obj)): - raise Unauthorized - -def getTokenFromRequest(request): - query = parse_qs(request['QUERY_STRING']) - if 'token' in query: - return query['token'][0] - return None - -def getTokenFromHeader(request): - jwtHeader = 'HTTP_' + os.getenv('ONLYOFFICE_JWT_HEADER').upper() if os.getenv('ONLYOFFICE_JWT_HEADER', None) else 'HTTP_AUTHORIZATION' - token = request._orig_env.get(jwtHeader) - if token: - token = token[len('Bearer '):] - return token diff --git a/src/onlyoffice/connector/locales/cs/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/cs/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index d519f1c..0000000 --- a/src/onlyoffice/connector/locales/cs/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,77 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-24 16:11+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: cs\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "Služba Úpravy dokumentů" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "Nainstaluje doplněk konektor ONLYOFFICE" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "Konfigurace ONLYOFFICE" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "Úprava ONLYOFFICE" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "Náhled ONLYOFFICE" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "Stránka náhledu ONLYOFFICE" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "ONLYOFFICE nedokáže otevřít tento soubor." - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "Odinstaluje doplněk konektor ONLYOFFICE" - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (odinstalovat)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "Tajný klíč (pro deaktivaci ponechte prázdné)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "Vytvořit v ONLYOFFICE" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "Dokument" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "Tabulka" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "Prezentace" diff --git a/src/onlyoffice/connector/locales/de/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/de/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index af8da8a..0000000 --- a/src/onlyoffice/connector/locales/de/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,113 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-27 14:21+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "Dienst zur Dokumentenbearbeitung" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "Connector-Add-On von ONLYOFFICE installieren" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "ONLYOFFICE Konfiguration" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "ONLYOFFICE Bearbeiten" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "ONLYOFFICE Anzeigen" - -#: ../browser/configure.zcml -msgid "Fill in form in ONLYOFFICE" -msgstr "Formular in ONLYOFFICE ausfüllen" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE Seite anzeigen" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "ONLYOFFICE kann diese Datei nicht öffnen" - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "Connector-Add-On von ONLYOFFICE deinstallieren" - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (deinstallieren)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "Geheimer Schlüssel (freilassen, um zu deaktivieren)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "In ONLYOFFICE erstellen" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "Dokument" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "Tabelle" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "Präsentation" - -#: ../core/fileUtils.py -msgid "Form template" -msgstr "Formularvorlage" - -#: ../browser/api.py -msgid "Save file copy as" -msgstr "Dateikopie speichern als" - -#: ../browser/api.py -msgid "Leave the field blank to save to the root of the site" -msgstr "Lassen Sie das Feld leer, um im Stammverzeichnis der Site zu speicher" - -#: ../browser/api.py -msgid "The file was successfully saved as" -msgstr "Die Datei wurde gespeichert als" - -#: ../browser/api.py -msgid "You are not authorized to add content to this folder" -msgstr "Sie dürfen zu diesem Ordner keine Inhalte hinzufügen" - -#: ../browser/api.py -msgid "Unknown error while saving file" -msgstr "Unbekannter Fehler beim Speichern" - -#: ../browser/templates/view.pt -msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." -msgstr "Für Online-Arbeit mit Formularen ist Version 7.0 von ONLYOFFICE Docs erforderlich" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "Erforderliche Eingabe fehlt." diff --git a/src/onlyoffice/connector/locales/en/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/en/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index ec67b65..0000000 --- a/src/onlyoffice/connector/locales/en/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,111 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "" - -#: ../browser/configure.zcml -msgid "Fill in form in ONLYOFFICE" -msgstr "" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "" - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "" - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "" - -#: ../core/fileUtils.py -msgid "Form template" -msgstr "" - -#: ../browser/api.py -msgid "Save file copy as" -msgstr "" - -#: ../browser/api.py -msgid "Leave the field blank to save to the root of the site" -msgstr "" - -#: ../browser/api.py -msgid "The file was successfully saved as " -msgstr "" - -#: ../browser/api.py -msgid "You are not authorized to add content to this folder" -msgstr "" - -#: ../browser/api.py -msgid "Unknown error while saving file" -msgstr "" - -#: ../browser/templates/view.pt -msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." -msgstr "" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "" \ No newline at end of file diff --git a/src/onlyoffice/connector/locales/es/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/es/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index 708e016..0000000 --- a/src/onlyoffice/connector/locales/es/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,113 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-27 15:48+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: es\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "Servicio de edición de documentos" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "Instalar add-on del conector de ONLYOFFICE" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "ONLYOFFICE Configuración" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "ONLYOFFICE Edición" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "ONLYOFFICE Vista" - -#: ../browser/configure.zcml -msgid "Fill in form in ONLYOFFICE" -msgstr "Rellenar el formulario en ONLYOFFICE" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE Vista de páginas" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "ONLYOFFICE no puede abrir este archivo" - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "Desinstalar add-on del conector de ONLYOFFICE" - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (desinstalar)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "Clave secreta (deje en blanco o desactive)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "Crear en ONLYOFFICE" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "Documento" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "Hoja de cálculo" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "Presentación" - -#: ../core/fileUtils.py -msgid "Form template" -msgstr "Plantilla de formulario" - -#: ../browser/api.py -msgid "Save file copy as" -msgstr "Guardar copia del archivo como" - -#: ../browser/api.py -msgid "Leave the field blank to save to the root of the site" -msgstr "Deje el campo en blanco para guardar en la raíz del sitio" - -#: ../browser/api.py -msgid "The file was successfully saved as " -msgstr "El archivo se ha guardado correctamente como" - -#: ../browser/api.py -msgid "You are not authorized to add content to this folder" -msgstr "No tiene autorización para añadir contenido a esta carpeta" - -#: ../browser/api.py -msgid "Unknown error while saving file" -msgstr "Error desconocido al guardar el documento" - -#: ../browser/templates/view.pt -msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." -msgstr "Por favor, actualice ONLYOFFICE Docs a la versión 7.0 para poder trabajar con formularios rellenables en línea" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "Un campo requerido esta sin tomar en cuenta." diff --git a/src/onlyoffice/connector/locales/fr/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/fr/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index 67943f0..0000000 --- a/src/onlyoffice/connector/locales/fr/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,113 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-27 15:48+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: fr\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "Service d'édition de documents" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "Installer le module complémentaire du connecteur ONLYOFFICE" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "Configuration ONLYOFFICE" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "ONLYOFFICE Éditer" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "ONLYOFFICE Voir" - -#: ../browser/configure.zcml -msgid "Fill in form in ONLYOFFICE" -msgstr "Remplir le formulaire dans ONLYOFFICE" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE Voir la page" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "ONLYOFFICE ne peut pas ouvrir ce fichier" - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "Désinstaller le module complémentaire du connecteur ONLYOFFICE" - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connecteur (désinstaller)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "Clé secrète (laisser vide pour désactiver)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "Créer dans ONLYOFFICE" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "Document" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "Feuille de calcul" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "Présentation" - -#: ../core/fileUtils.py -msgid "Form template" -msgstr "Modèle de formulaire" - -#: ../browser/api.py -msgid "Save file copy as" -msgstr "Enregistrer une copie du fichier comme" - -#: ../browser/api.py -msgid "Leave the field blank to save to the root of the site" -msgstr "Laisser le champ vide pour enregistrer à la racine du site" - -#: ../browser/api.py -msgid "The file was successfully saved as " -msgstr "Le fichier a été enregistré avec succès comme" - -#: ../browser/api.py -msgid "You are not authorized to add content to this folder" -msgstr "Vous n'êtes pas autorisé à ajouter du contenu à ce dossier" - -#: ../browser/api.py -msgid "Unknown error while saving file" -msgstr "Une erreur inconnue s'est produite lors de l'enregistrement du fichier" - -#: ../browser/templates/view.pt -msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." -msgstr "Veuillez mettre à jour ONLYOFFICE Docs vers la version 7.0 pour travailler sur les formulaires à remplir en ligne" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "Un champ obligatoire est manquant" diff --git a/src/onlyoffice/connector/locales/it/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/it/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index 339059e..0000000 --- a/src/onlyoffice/connector/locales/it/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,113 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-27 15:49+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "Servizio Documenti Editing" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "Installa il componente aggiuntivo ONLYOFFICE" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "ONLYOFFICE Configurazione" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "ONLYOFFICE Modifica" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "ONLYOFFICE Visualizza" - -#: ../browser/configure.zcml -msgid "Fill in form in ONLYOFFICE" -msgstr "Compilare il modulo in ONLYOFFICE" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE Visualizza pagina" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "ONLYOFFICE non può aprire questo file." - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "Disinstalla il componente aggiuntivo ONLYOFFICE." - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (disinstalla)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "Chiave segreta (lasciare vuoto per disabilitare)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "Creare in ONLYOFFICE" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "Documento" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "Foglio di calcolo" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "Presentazione" - -#: ../core/fileUtils.py -msgid "Form template" -msgstr "Modello di modulo" - -#: ../browser/api.py -msgid "Save file copy as" -msgstr "Salvare la copia del file come" - -#: ../browser/api.py -msgid "Leave the field blank to save to the root of the site" -msgstr "Lasciare il campo vuoto per salvare nella radice del sito" - -#: ../browser/api.py -msgid "The file was successfully saved as " -msgstr "Il file è stato salvato con successo come" - -#: ../browser/api.py -msgid "You are not authorized to add content to this folder" -msgstr "Non sei autorizzato ad aggiungere contenuti a questa cartella" - -#: ../browser/api.py -msgid "Unknown error while saving file" -msgstr "Errore sconosciuto durante il salvataggio del documento" - -#: ../browser/templates/view.pt -msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." -msgstr "Si prega di aggiornare ONLYOFFICE Docs alla versione 7.0 per lavorare su moduli compilabili online" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "Un campo richiesto è mancante." diff --git a/src/onlyoffice/connector/locales/ja/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/ja/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index 2f7784c..0000000 --- a/src/onlyoffice/connector/locales/ja/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,113 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-27 18:15+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: ja\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "ドキュメント編集サービス" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "ONLYOFFICE コネクターアドオンをインストールします" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "ONLYOFFICE コンフィギュレーション" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "ONLYOFFICE 編集" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "ONLYOFFICE 閲覧" - -#: ../browser/configure.zcml -msgid "Fill in form in ONLYOFFICE" -msgstr "ONLYOFFICEでフォームを記入する" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE 閲覧ページ" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "このファイルを開くことができません" - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "ONLYOFFICE コネクターアドオンをアンインストールします" - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (アンインストールする)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "シークレットキー (ブランクで無効)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "ONLYOFFICEで作成" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "ドキュメント" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "スプレッドシート" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "プレゼンテーション" - -#: ../core/fileUtils.py -msgid "Form template" -msgstr "フォーム テンプレート" - -#: ../browser/api.py -msgid "Save file copy as" -msgstr "ファイルのコピーを保存する形は" - -#: ../browser/api.py -msgid "Leave the field blank to save to the root of the site" -msgstr "サイトのルートに保存するには、フィールドを空白のままにしてください" - -#: ../browser/api.py -msgid "The file was successfully saved as " -msgstr "正常に保存されたファイル形は" - -#: ../browser/api.py -msgid "You are not authorized to add content to this folder" -msgstr "このフォルダにコンテンツを追加する権限がありません" - -#: ../browser/api.py -msgid "Unknown error while saving file" -msgstr "ファイルの保存中に不明なエラーが発生しました" - -#: ../browser/templates/view.pt -msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." -msgstr "オンラインで入力可能なフォームを作成するには、ONLYOFFICE Docs 7.0版まで更新してください" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "必要な入力がありません" diff --git a/src/onlyoffice/connector/locales/nl/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/nl/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index 0359e99..0000000 --- a/src/onlyoffice/connector/locales/nl/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,81 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-24 16:21+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: nl\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "Documentbewerkingsservice" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "Installeert de add-on van de ONLYOFFICE connector" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "ONLYOFFICE Configuratie" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "ONLYOFFICE Bewerken" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "ONLYOFFICE Bekijken" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE Bekijk pagina" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "ONLYOFFICE kan dit bestand niet openen." - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "Hiermee wordt de add-on ONLYOFFICE-connector verwijderd." - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (verwijdering)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "Geheime sleutel (leeg laten om uit te schakelen)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "Aanmaken in ONLYOFFICE" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "Tekst" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "Spreadsheet" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "Presentatie" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "Verplichte waarde mist." \ No newline at end of file diff --git a/src/onlyoffice/connector/locales/onlyoffice.connector.pot b/src/onlyoffice/connector/locales/onlyoffice.connector.pot deleted file mode 100644 index e69de29..0000000 diff --git a/src/onlyoffice/connector/locales/pt/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/pt/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index 30f4aad..0000000 --- a/src/onlyoffice/connector/locales/pt/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,81 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-24 16:21+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: pt\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "Serviço de edição de documentos" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "Instala o complemento do conector do ONLYOFFICE" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "Configuração do ONLYOFFICE" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "ONLYOFFICE Editar" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "ONLYOFFICE Ver" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE Ver página" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "O ONLYOFFICE não pode abrir este arquivo" - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "Desinstala o complemento do conector do ONLYOFFICE" - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (desinstalar)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "Chave secreta (deixe em branco para desativar)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "Criar no ONLYOFFICE" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "Documento" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "Planilha" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "Apresentação" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "Falta informação obrigatória." \ No newline at end of file diff --git a/src/onlyoffice/connector/locales/ru/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/ru/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index 372502e..0000000 --- a/src/onlyoffice/connector/locales/ru/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,111 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "Адрес Document Server" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "Установка коннектора ONLYOFFICE" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "Настройка ONLYOFFICE" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "Редактирование файла в ONLYOFFICE" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "Просмотр файла в ONLYOFFICE" - -#: ../browser/configure.zcml -msgid "Fill in form in ONLYOFFICE" -msgstr "Заполнить форму в ONLYOFFICE" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE (Страница просмотра файла)" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "Невозможно открыть этот файл с помощью ONLYOFFICE" - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "Удаление коннектора ONLYOFFICE." - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (удаление)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "Секретный ключ (оставьте пустым для отключения)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "Создать в ONLYOFFICE" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "Документ" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "Таблица" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "Презентация" - -#: ../core/fileUtils.py -msgid "Form template" -msgstr "Шаблон формы" - -#: ../browser/api.py -msgid "Save file copy as" -msgstr "Сохранить копию файла как" - -#: ../browser/api.py -msgid "Leave the field blank to save to the root of the site" -msgstr "Оставьте поле пустым, чтобы сохранить в корень сайта" - -#: ../browser/api.py -msgid "The file was successfully saved as " -msgstr "Файл был успешно сохранен как " - -#: ../browser/api.py -msgid "You are not authorized to add content to this folder" -msgstr "У вас нет прав на добавление содержимого в эту папку" - -#: ../browser/api.py -msgid "Unknown error while saving file" -msgstr "Неизвестная ошибка при сохранении файла" - -#: ../browser/templates/view.pt -msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." -msgstr "Обновите сервер документов ONLYOFFICE до версии 7.0, чтобы работать с заполняемыми формами." - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "Отсутствуют требуемые входные данные" \ No newline at end of file diff --git a/src/onlyoffice/connector/locales/zh/LC_MESSAGES/onlyoffice.connector.po b/src/onlyoffice/connector/locales/zh/LC_MESSAGES/onlyoffice.connector.po deleted file mode 100644 index 529ea68..0000000 --- a/src/onlyoffice/connector/locales/zh/LC_MESSAGES/onlyoffice.connector.po +++ /dev/null @@ -1,113 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2020-02-14 10:33+0000\n" -"PO-Revision-Date: 2021-12-27 15:50+0300\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: zh\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"Language-Code: en\n" -"Language-Name: English\n" -"Preferred-Encodings: utf-8 latin1\n" -"Domain: DOMAIN\n" -"X-Generator: Poedit 3.0.1\n" - -#: ../browser/controlpanel.py:12 -msgid "Document Editing service" -msgstr "文档编辑服务" - -#: ../configure.zcml:28 -msgid "Installs the ONLYOFFICE connector add-on." -msgstr "安装ONLYOFFICE连接器附加组件" - -#: ../browser/controlpanel.py:21 -msgid "ONLYOFFICE Configuration" -msgstr "ONLYOFFICE配置" - -#: ../profiles/default/types/File.xml -msgid "ONLYOFFICE Edit" -msgstr "ONLYOFFICE 编辑" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View" -msgstr "ONLYOFFICE视图" - -#: ../browser/configure.zcml -msgid "Fill in form in ONLYOFFICE" -msgstr "在ONLYOFFICE上填写表单" - -#: ../browser/configure.zcml:52 -msgid "ONLYOFFICE View page" -msgstr "ONLYOFFICE视图页" - -#: ../browser/templates/error.pt:10 -msgid "ONLYOFFICE can't open this file." -msgstr "ONLYOFFICE无法打开该文件" - -#: ../configure.zcml:37 -msgid "Uninstalls the ONLYOFFICE connector add-on." -msgstr "卸载ONLYOFFICE连接器附加组件" - -#: ../configure.zcml:28 -msgid "onlyoffice.connector" -msgstr "onlyoffice.connector" - -#: ../configure.zcml:37 -msgid "onlyoffice.connector (uninstall)" -msgstr "onlyoffice.connector (卸载)" - -#: ../browser/controlpanel.py:34 -msgid "Secret key (leave blank to disable)" -msgstr "秘钥(留空为关闭)" - -#: ../browser/menu.py -msgid "Create in ONLYOFFICE" -msgstr "在ONLYOFFICE中创建" - -#: ../core/fileUtils.py -msgid "Document" -msgstr "文档" - -#: ../core/fileUtils.py -msgid "Spreadsheet" -msgstr "电子表格" - -#: ../core/fileUtils.py -msgid "Presentation" -msgstr "演示文稿" - -#: ../core/fileUtils.py -msgid "Form template" -msgstr "表单模板" - -#: ../browser/api.py -msgid "Save file copy as" -msgstr "文件副本另存为" - -#: ../browser/api.py -msgid "Leave the field blank to save to the root of the site" -msgstr " 请将该字段留空以保存到网站根目录下" - -#: ../browser/api.py -msgid "The file was successfully saved as " -msgstr "文档已另存为" - -#: ../browser/api.py -msgid "You are not authorized to add content to this folder" -msgstr "您无权将内容添加到此文件夹中" - -#: ../browser/api.py -msgid "Unknown error while saving file" -msgstr "保存文件时出现未知错误" - -#: ../browser/templates/view.pt -msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." -msgstr "请将ONLYOFFICE Docs更新到7.0版本,以便在线编辑可填写的表单" - -#: ../browser/templates/view.pt -msgid "Required input is missing." -msgstr "缺失所需输入内容" diff --git a/src/onlyoffice/connector/profiles/default/browserlayer.xml b/src/onlyoffice/connector/profiles/default/browserlayer.xml deleted file mode 100644 index e445726..0000000 --- a/src/onlyoffice/connector/profiles/default/browserlayer.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/src/onlyoffice/connector/__init__.py b/src/onlyoffice/plone/__init__.py similarity index 100% rename from src/onlyoffice/connector/__init__.py rename to src/onlyoffice/plone/__init__.py diff --git a/src/onlyoffice/connector/browser/__init__.py b/src/onlyoffice/plone/browser/__init__.py similarity index 100% rename from src/onlyoffice/connector/browser/__init__.py rename to src/onlyoffice/plone/browser/__init__.py diff --git a/src/onlyoffice/plone/browser/actions.py b/src/onlyoffice/plone/browser/actions.py new file mode 100644 index 0000000..9dc73df --- /dev/null +++ b/src/onlyoffice/plone/browser/actions.py @@ -0,0 +1,182 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from AccessControl import getSecurityManager +from Acquisition import aq_inner +from Acquisition import aq_parent +from Products.CMFPlone.permissions import AddPortalContent +from Products.CMFPlone import PloneMessageFactory as _plone_message +from Products.Five.browser import BrowserView +from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile +from zope.component import getMultiAdapter +from z3c.form import button, field, form + +from onlyoffice.plone.browser.interfaces import IConversionForm +from onlyoffice.plone.browser.interfaces import IDownloadAsForm +from onlyoffice.plone.core import fileUtils +from onlyoffice.plone.core import utils +from onlyoffice.plone.core import featureUtils +from onlyoffice.plone.core import conversionUtils +from onlyoffice.plone.interfaces import _ +from onlyoffice.plone.interfaces import logger + +import json + +class Edit(form.EditForm): + def isAvailable(self): + return fileUtils.canEdit(self.context) + + def __call__(self): + return render_editor(self, True) + +class FillForm(form.EditForm): + def isAvailable(self): + return fileUtils.canFillForm(self.context) + + def __call__(self): + return render_editor(self, True) + +class View(BrowserView): + def isAvailable(self): + return fileUtils.canView(self.context) + + def __call__(self): + return render_editor(self, False) + +class ConversionForm(form.Form): + def isAvailable(self): + folder = aq_parent(aq_inner(self.context)) + canAddContent = getSecurityManager().checkPermission(AddPortalContent, folder) + return canAddContent and fileUtils.canConvert(self.context) + + fields = field.Fields(IConversionForm) + template = ViewPageTemplateFile("templates/convert.pt") + + enableCSRFProtection = True + ignoreContext = True + + label = _(u'Conversion in ONLYOFFICE') + description = _(u'You can conversion you document in format OOXML') + + def view_url(self): + context_state = getMultiAdapter( + (self.context, self.request), name="plone_context_state" + ) + return context_state.view_url() + + @button.buttonAndHandler(_("Convert"), name="Convert") + def handle_convert(self, action): + self.request.response.redirect(self.view_url()) + + @button.buttonAndHandler(_plone_message("label_cancel", default="Cancel"), name="Cancel") + def handle_cancel(self, action): + self.request.response.redirect(self.view_url()) + + def updateActions(self): + super().updateActions() + if self.actions and "Convert" in self.actions: + self.actions["Convert"].addClass("context") + +class DownloadAsForm(form.Form): + fields = field.Fields(IDownloadAsForm) + template = ViewPageTemplateFile("templates/download-as.pt") + + enableCSRFProtection = True + ignoreContext = True + + label = _("Download as") + + def isAvailable(self): + ext = fileUtils.getFileExt(self.context) + return bool(conversionUtils.getConvertToExtArray(ext)) + +def render_editor(self, forEdit): + self.docUrl = utils.getPublicDocUrl() + self.saveAs = featureUtils.getSaveAsObject(self) + self.demo = featureUtils.getDemoAsObject(self) + self.relatedItemsOptions = json.dumps(fileUtils.getRelatedRtemsOptions(self.context)) + self.token = get_token(self) + self.editorCfg = get_config(self, forEdit) + if not self.editorCfg: + index = ViewPageTemplateFile("templates/error.pt") + return index(self) + return self.index() + +def get_token(self): + authenticator = getMultiAdapter((self.context, self.request), name="authenticator") + + return authenticator.token() + +def portal_state(self): + context = aq_inner(self.context) + portal_state = getMultiAdapter((context, self.request), name=u'plone_portal_state') + return portal_state + +def get_config(self, forEdit): + # def viewURLFor(self, item): + # cstate = getMultiAdapter((item, item.REQUEST), name='plone_context_state') + # return cstate.view_url() + + canEdit = forEdit and bool(getSecurityManager().checkPermission('Modify portal content', self.context)) + + fileTitle = self.context.Title() + filename = self.context.file.filename + + logger.info("getting config for " + utils.getPloneContextUrl(self.context)) + + if not fileUtils.canView(self.context) or (forEdit and not fileUtils.canEdit(self.context) and not fileUtils.canFillForm(self.context)): + # self.request.response.status = 500 + # self.request.response.setHeader('Location', self.viewURLFor(self.context)) + return None + + state = portal_state(self) + user = state.member() + securityToken = utils.createSecurityTokenFromContext(self.context) + config = { + 'type': 'desktop', + 'documentType': fileUtils.getFileType(self.context), + 'document': { + 'title': fileTitle, + 'url': utils.getPloneContextUrl(self.context) + '/onlyoffice-dl/file?token=' + securityToken, + 'fileType': fileUtils.getFileExt(self.context), + 'key': utils.getDocumentKey(self.context), + 'info': { + 'author': self.context.creators[0], + 'created': str(self.context.creation_date) + }, + 'permissions': { + 'edit': canEdit + } + }, + 'editorConfig': { + 'mode': 'edit' if canEdit else 'view', + 'lang': state.language(), + 'user': { + 'id': user.getId(), + 'name': user.getUserName() + }, + 'customization': { + 'feedback': True + } + } + } + if canEdit: + config['editorConfig']['callbackUrl'] = utils.getPloneContextUrl(self.context) + '/onlyoffice-callback?token=' + securityToken + + if utils.isJwtEnabled(): + config['token'] = utils.createSecurityToken(config) + + return json.dumps(config) \ No newline at end of file diff --git a/src/onlyoffice/plone/browser/api.py b/src/onlyoffice/plone/browser/api.py new file mode 100644 index 0000000..cec452e --- /dev/null +++ b/src/onlyoffice/plone/browser/api.py @@ -0,0 +1,352 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from Acquisition import aq_inner +from AccessControl import getSecurityManager +from Products.Five.browser import BrowserView +from plone.namedfile.browser import Download +from plone.namedfile.file import NamedBlobFile +from plone.rfc822.interfaces import IPrimaryFieldInfo +from zope.component import getMultiAdapter +from zope.publisher.interfaces import NotFound +from plone.app.uuid.utils import uuidToObject +from plone.protect.utils import addTokenToUrl +from Products.CMFCore import permissions +from Acquisition import aq_inner +from Acquisition import aq_parent +from zExceptions import BadRequest +from plone.app.content.utils import json_dumps +from Products.CMFPlone.permissions import AddPortalContent +from Products.CMFCore.utils import getToolByName +from zope.i18n import translate +from AccessControl.ZopeGuards import guarded_getattr +from onlyoffice.plone.core import fileUtils +from onlyoffice.plone.core import utils +from onlyoffice.plone.core import conversionUtils +from onlyoffice.plone.interfaces import logger +from onlyoffice.plone.interfaces import _ +from urllib.request import urlopen + +import json +import os +import mimetypes +import io + +def portal_state(self): + context = aq_inner(self.context) + portal_state = getMultiAdapter((context, self.request), name=u'plone_portal_state') + return portal_state + +class Callback(BrowserView): + def __call__(self): + logger.info("got callback request for " + self.context.absolute_url()) + logger.debug(vars(self.request)) + utils.checkSecurityToken(self.context, utils.getTokenFromRequest(self.request)) + self.request.response.setHeader('Content-Type', 'application/json') + + error = None + response = {} + + try: + body = json.loads(self.request.get('BODY')) + logger.debug(body) + + if utils.isJwtEnabled(): + token = body.get('token') + + if (not token): + token = utils.getTokenFromHeader(self.request) + + if (not token): + raise Exception('Expected JWT') + + body = utils.decodeSecurityToken(token) + if (body.get('payload')): + body = body['payload'] + + status = body['status'] + if (status == 2) | (status == 3): # mustsave, corrupted + download = utils.replaceDocUrlToInternal(body.get('url')) + logger.info("saving file " + self.context.absolute_url()) + self.context.file = NamedBlobFile(urlopen(download).read(), filename=self.context.file.filename) + self.context.reindexObject() + logger.info("saved " + self.context.absolute_url()) + + except Exception as e: + error = str(e) + + if error: + logger.warn("error while saving " + self.context.absolute_url() + ": " + error) + response['error'] = 1 + response['message'] = error + self.request.response.status = 500 + else: + response['error'] = 0 + self.request.response.status = 200 + + return json.dumps(response) + +class ODownload(Download): + def _getFile(self): + logger.info("got download request for " + self.context.absolute_url()) + + if utils.isJwtEnabled(): + token = utils.getTokenFromHeader(self.request) + + if (not token): + raise Exception('Expected JWT') + + utils.decodeSecurityToken(token) + + utils.checkSecurityToken(self.context, utils.getTokenFromRequest(self.request)) + + if not self.fieldname: + info = IPrimaryFieldInfo(self.context, None) + if info is None: + # Ensure that we have at least a fieldname + raise NotFound(self, "", self.request) + self.fieldname = info.fieldname + + file = info.value + else: + context = getattr(self.context, "aq_explicit", self.context) + file = getattr(context, self.fieldname, None) + + if file is None: + raise NotFound(self, self.fieldname, self.request) + + return file + +class OTestConvert(BrowserView): + def __call__(self): + + self.request.response.setHeader("Content-Disposition", "attachment; filename=test.txt") + self.request.response.setHeader('Content-Type', "text/plain") + + return "This is a test file to test the document conversion service." + +class Create(BrowserView): + def __call__( + self, + documentType + ): + + fileExt = fileUtils.getDefaultExtByType(documentType) + fileName = translate(fileUtils.getDefaultNameByType(documentType), context = self.request) + "." + fileExt + template = 'new.' + fileExt + contentType = mimetypes.guess_type(template)[0] or '' + + if fileName is None or fileExt is None: + raise NotFound(self, documentType, self.request) + + state = portal_state(self) + language = state.language() + + localePath = fileUtils.localePath.get(language) + if localePath is None: + language = language.split('-')[0] + localePath = fileUtils.localePath.get(language) + if localePath is None: + localePath = fileUtils.localePath.get('en') + + file = open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'app_data', localePath, template), 'rb') + + try: + fileData = file.read() + finally: + file.close() + + file = fileUtils.addNewFile(fileName, contentType, fileData, self.context) + + self.request.response.redirect(addTokenToUrl('{0}/onlyoffice-edit'.format(file.absolute_url()))) + +class SaveAs(BrowserView): + def __call__(self): + body = json.loads(self.request.get('BODY')) + url = body.get('url') + fileType = body.get('fileType') + fileTitle = body.get('fileTitle') + folderUID = body.get('folderUID') + + if not url or not fileType or not fileTitle: + raise BadRequest(u'Required url or fileType or fileTitle parameters not found.') + + if not folderUID: + portal_url = getToolByName(self.context, "portal_url") + folder = portal_url.getPortalObject() + else: + folder = uuidToObject(folderUID) + + if not getSecurityManager().checkPermission(AddPortalContent, folder): + pm = getToolByName(self.context, "portal_membership") + if bool(pm.isAnonymousUser()): + self.request.response.setStatus(401) + else: + self.request.response.setStatus(403) + return "You are not authorized to add content to this folder." + + fileName = fileUtils.getCorrectFileName(fileTitle + "." + fileType) + contentType = mimetypes.guess_type(fileName)[0] or '' + + fileData = urlopen(url).read() + + fileUtils.addNewFile(fileName, contentType, fileData, folder) + + self.request.response.setHeader( + "Content-Type", "application/json; charset=utf-8" + ) + + return json_dumps({ + "status": "success", + "fileName": fileName + }) + +class OInsert(BrowserView): + def __call__(self): + + pm = getToolByName(self.context, "portal_membership") + if bool(pm.isAnonymousUser()): + self.request.response.setStatus(401) + + body = json.loads(self.request.get('BODY')) + command = body.get('command') + UIDs = body.get('UIDs') + + response = [] + + for UID in UIDs: + obj = uuidToObject(UID) + + type ='file' + if obj.portal_type == "Image" : + type = 'image' + + if getSecurityManager().checkPermission(permissions.View, obj): + insertObject = {} + insertObject['command'] = command + insertObject['url'] = utils.getPloneContextUrl(obj) + '/onlyoffice-dl/' + type + '?token=' + utils.createSecurityTokenFromContext(obj) + insertObject['fileType'] = fileUtils.getFileExt(obj) + + if utils.isJwtEnabled(): + insertObject['token'] = utils.createSecurityToken(insertObject) + + response.append(insertObject) + + self.request.response.setHeader( + "Content-Type", "application/json; charset=utf-8" + ) + + return json.dumps(response) + +class Conversion(BrowserView): + def __call__(self): + + folder = aq_parent(aq_inner(self.context)) + + if not getSecurityManager().checkPermission(AddPortalContent, folder): + pm = getToolByName(self.context, "portal_membership") + if bool(pm.isAnonymousUser()): + self.request.response.setStatus(401) + else: + self.request.response.setStatus(403) + return "You are not authorized to add content to this folder." + + key = utils.getDocumentKey(self.context) + url = utils.getPloneContextUrl(self.context) + '/onlyoffice-dl/file?token=' + utils.createSecurityTokenFromContext(self.context) + fileType = fileUtils.getFileExt(self.context) + outputType = conversionUtils.getTargetExt(fileType) + region = portal_state(self).language() + + data, error = conversionUtils.convert(key, url, fileType, outputType, None, region, True) + + self.request.response.setHeader( + "Content-Type", "application/json; charset=utf-8" + ) + + if error != None: + errorMessage = translate(error["message"], context = self.request) + + if error["type"] == 1: + errorMessage = translate( + _("Document conversion service returned error (${error})", mapping = { + "error": errorMessage + }), + context = self.request + ) + + return json_dumps({ + "error": errorMessage + }) + + if data.get("endConvert") == True: + title = self.request.form.get("title") + fileName = fileUtils.getCorrectFileName(title + "." + outputType) + contentType = mimetypes.guess_type(fileName)[0] or '' + + fileData = urlopen(data.get("fileUrl")).read() + + file = fileUtils.addNewFile(fileName, contentType, fileData, folder) + + return json_dumps({ + "endConvert": data.get("endConvert"), + "percent": data.get("percent"), + "fileURL": addTokenToUrl('{0}/onlyoffice-edit'.format(file.absolute_url())) + }) + + else: + return json_dumps({ + "endConvert": data.get("endConvert"), + "percent": data.get("percent") + }) + +class DownloadAs(BrowserView): + def __call__(self): + + pm = getToolByName(self.context, "portal_membership") + if bool(pm.isAnonymousUser()): + self.request.response.setStatus(401) + return + + outputType = self.request.form.get("targetType") + key = utils.getDocumentKey(self.context) + url = utils.getPloneContextUrl(self.context) + '/onlyoffice-dl/file?token=' + utils.createSecurityTokenFromContext(self.context) + fileType = fileUtils.getFileExt(self.context) + region = portal_state(self).language() + + data, error = conversionUtils.convert(key, url, fileType, outputType, self.context.Title(), region, False) + + self.request.response.setHeader( + "Content-Type", "application/json; charset=utf-8" + ) + + if error != None: + errorMessage = translate(error["message"], context = self.request) + + if error["type"] == 1: + errorMessage = translate( + _("Document conversion service returned error (${error})", mapping = { + "error": errorMessage + }), + context = self.request + ) + + return json_dumps({ + "error": errorMessage + }) + + return json_dumps({ + "fileUrl": data.get("fileUrl") + }) \ No newline at end of file diff --git a/src/onlyoffice/plone/browser/app_data b/src/onlyoffice/plone/browser/app_data new file mode 160000 index 0000000..087cbd4 --- /dev/null +++ b/src/onlyoffice/plone/browser/app_data @@ -0,0 +1 @@ +Subproject commit 087cbd4d43bc36574a83e7ea9a9300b66168c7dd diff --git a/src/onlyoffice/plone/browser/configure.zcml b/src/onlyoffice/plone/browser/configure.zcml new file mode 100644 index 0000000..d41997e --- /dev/null +++ b/src/onlyoffice/plone/browser/configure.zcml @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/onlyoffice/plone/browser/controlpanel.py b/src/onlyoffice/plone/browser/controlpanel.py new file mode 100644 index 0000000..5a22d2f --- /dev/null +++ b/src/onlyoffice/plone/browser/controlpanel.py @@ -0,0 +1,249 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper +from plone.app.registry.browser.controlpanel import RegistryEditForm +from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile +from z3c.form.interfaces import WidgetActionExecutionError +from zope import schema +from zope.interface import Interface +from zope.interface import Invalid +from plone import api +from zope.component import getUtility +from plone.registry.interfaces import IRegistry +from DateTime import DateTime +from Products.statusmessages.interfaces import IStatusMessage +from z3c.form import button +from zope.component.hooks import getSite +from zope.i18nmessageid import MessageFactory +from onlyoffice.plone.core import conversionUtils +from urllib.request import urlopen +from onlyoffice.plone.interfaces import _ +from onlyoffice.plone.interfaces import logger +from onlyoffice.plone.core import utils +from onlyoffice.plone.core.config import Config + +import json +import requests +import os + +_Plone = MessageFactory("plone") + +class IOnlyofficeControlPanel(Interface): + + docUrl = schema.TextLine( + title=_(u'Document Editing service'), + required=False, + default=u'https://documentserver/', + ) + + docUrlPublicValidation = schema.Bool( + required=True, + default=True + ) + + demoEnabled = schema.Bool( + title=_(u"Connect to demo ONLYOFFICE Document Server"), + description=_(u"This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period."), + required=False, + default=False + ) + + jwtSecret = schema.TextLine( + title=_(u'Secret key (leave blank to disable)'), + required=False, + ) + + ploneUrl = schema.TextLine( + title=_(u'Server address for internal requests from the Document Editing Service'), + required=False + ) + + docInnerUrl = schema.TextLine( + title=_(u'Document Editing Service address for internal requests from the server'), + required=False + ) + +def settings_validation_demo(data): + demoUrl = Config(getUtility(IRegistry)).demoDocUrl + demoSecret = Config(getUtility(IRegistry)).demoJwtSecret + ploneInnerUrl = data["ploneUrl"] + + check_doc_serv_url(demoUrl, "demoEnabled", True) + + check_doc_serv_command_service(demoUrl, demoSecret, True) + + check_doc_serv_convert_service(demoUrl, ploneInnerUrl, demoSecret, True) + + utils.setDemo() + +def settings_validation(data): + if (not data["docUrlPublicValidation"]): + raise WidgetActionExecutionError( + "docUrl", + Invalid(_(u'ONLYOFFICE cannot be reached')) + ) + + portalUrl = api.portal.get().absolute_url() + ploneInnerUrl = data["ploneUrl"] + + if (portalUrl.startswith("https") and not data["docUrl"].startswith("https")): + raise WidgetActionExecutionError( + "docUrl", + Invalid(_(u'Mixed Active Content is not allowed. HTTPS address for Document Server is required.')) + ) + + if data["docInnerUrl"] != None and data["docInnerUrl"] != "": + nameField = "docInnerUrl" + url = data["docInnerUrl"] + else : + nameField = "docUrl" + url = data["docUrl"] + + url = url if url.endswith("/") else url + "/" + + check_doc_serv_url(url, nameField, False) + + check_doc_serv_command_service(url, data["jwtSecret"], False) + + check_doc_serv_convert_service(url, ploneInnerUrl, data["jwtSecret"], False) + +def check_doc_serv_url(url, nameField, demo): + logger.debug("Checking docserv url") + try: + response = urlopen(os.path.join(url, "healthcheck")) + healthcheck = response.read() + if not healthcheck: + raise Exception(os.path.join(url, "healthcheck") + " returned false.") + except Exception as e: + raise WidgetActionExecutionError( + nameField, + Invalid(get_message_error(_(u'ONLYOFFICE cannot be reached'), demo)) + ) + +def check_doc_serv_command_service(url, jwtSecret, demo): + logger.debug("Checking docserv commandservice") + try: + headers = { "Content-Type" : "application/json" } + bodyJson = { "c" : "version" } + + if jwtSecret != None and jwtSecret != "": + payload = { "payload" : bodyJson } + + headerToken = utils.createSecurityToken(payload, jwtSecret) + header = Config(getUtility(IRegistry)).demoHeader if demo else utils.getJwtHeaderEnv() + headers[header] = "Bearer " + headerToken + + token = utils.createSecurityToken(bodyJson, jwtSecret) + bodyJson["token"] = token + + response = requests.post(os.path.join(url, "coauthoring/CommandService.ashx"), data = json.dumps(bodyJson), headers = headers) + + if response.json()["error"] == 6: + nameField = "demoEnabled" if demo else "jwtSecret" + + raise WidgetActionExecutionError( + nameField, + Invalid(get_message_error(_(u"Authorization error"), demo)) + ) + + if response.json()["error"] != 0: + raise Exception(os.path.join(url, "coauthoring/CommandService.ashx") + " returned error: " + str(response.json()["error"])) + except WidgetActionExecutionError: + raise + except Exception as e: + logger.error(e) + if demo: + raise WidgetActionExecutionError( + "demoEnabled", + Invalid(get_message_error(_(u"Error when trying to check CommandService"), demo)) + ) + else: + raise Invalid(_(u"Error when trying to check CommandService")) + +def check_doc_serv_convert_service(docUrl, ploneInnerUrl, jwtSecret, demo): + logger.debug("Checking docserv convertservice") + + key = int(DateTime()) + url = utils.getTestConvertDocUrl(ploneInnerUrl) + header = Config(getUtility(IRegistry)).demoHeader if demo else utils.getJwtHeaderEnv() + jwtEnabled = bool(jwtSecret) + + data, error = conversionUtils.convert(key, url, "txt", "txt", + docUrl = docUrl, + jwtEnabled = jwtEnabled, + jwtSecret = jwtSecret, + jwtHeader = header + ) + + if error: + if demo: + raise WidgetActionExecutionError( + "demoEnabled", + Invalid(get_message_error(_(u"Error when trying to check ConvertService"), demo)) + ) + else: + raise Invalid(_(u"Error when trying to check ConvertService")) + +def get_message_error(message, demo): + if demo: + return _(u'Error connecting to demo server (${error})', mapping = { + "error": message + }) + else: + return message + +class OnlyofficeControlPanelForm(RegistryEditForm): + schema = IOnlyofficeControlPanel + id = "OnlyofficeControlPanelForm" + schema_prefix = "onlyoffice.plone" + label = _(u'ONLYOFFICE Configuration') + + @button.buttonAndHandler(_Plone("Save"), name="save") + def handleSave(self, action): + logger.error("SAdfasdf") + data, errors = self.extractData() + + if data["demoEnabled"] and utils.getDemoAvailable(True): + settings_validation_demo(data) + else: + settings_validation(data) + + if errors: + self.status = self.formErrorsMessage + return + self.applyChanges(data) + IStatusMessage(self.request).addStatusMessage(_Plone("Changes saved."), "info") + self.request.response.redirect(self.request.getURL()) + + @button.buttonAndHandler(_Plone("Cancel"), name="cancel") + def handleCancel(self, action): + IStatusMessage(self.request).addStatusMessage(_Plone("Changes canceled."), "info") + self.request.response.redirect( + f"{getSite().absolute_url()}/{self.control_panel_view}" + ) + +class OnlyofficeControlPanelView(ControlPanelFormWrapper): + form = OnlyofficeControlPanelForm + index = ViewPageTemplateFile("templates/controlpanel.pt") + + def settings(self): + output = [] + + if utils.getDemoAvailable(True): + output.append("demo_available") + + return " ".join(output) \ No newline at end of file diff --git a/src/onlyoffice/plone/browser/interfaces.py b/src/onlyoffice/plone/browser/interfaces.py new file mode 100644 index 0000000..1950c87 --- /dev/null +++ b/src/onlyoffice/plone/browser/interfaces.py @@ -0,0 +1,101 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from z3c.form.widget import ComputedWidgetAttribute +from zope.interface import Interface +from zope import schema +from Products.CMFPlone import PloneMessageFactory as _plone_message +from zope.schema.interfaces import IVocabularyFactory +from zope.schema.vocabulary import SimpleTerm +from zope.schema.vocabulary import SimpleVocabulary +from zope.interface import implementer + +from onlyoffice.plone.interfaces import _ +from onlyoffice.plone.core import fileUtils +from onlyoffice.plone.core import conversionUtils + +class IConversionForm(Interface): + title = schema.TextLine( + title=_plone_message("label_title", default="Title"), + required = True, + ) + + current_type = schema.TextLine( + title=_("Current type:"), + required = False, + readonly = True + ) + + target_type = schema.TextLine( + title=_("Target type:"), + required = False, + readonly = True + ) + +convert_title = ComputedWidgetAttribute( + lambda form: fileUtils.getFileTitleWithoutExt(form.context), field=IConversionForm["title"] +) + +convert_current_type = ComputedWidgetAttribute( + lambda form: fileUtils.getFileExt(form.context), field=IConversionForm["current_type"] +) + +convert_target_type = ComputedWidgetAttribute( + lambda form: conversionUtils.getTargetExt(fileUtils.getFileExt(form.context)), field=IConversionForm["target_type"] +) + + +@implementer(IVocabularyFactory) +class OnlyofficeConvertTypeVocabulary(object): + + def __call__(self, context): + ext = fileUtils.getFileExt(context) + supportedConvertTypes = conversionUtils.getConvertToExtArray(ext) + + terms = [] + + for supportedConvertType in supportedConvertTypes: + terms.append(SimpleTerm(supportedConvertType, supportedConvertType)) + + return SimpleVocabulary(terms) + +OnlyofficeConvertTypeVocabularyFactory = OnlyofficeConvertTypeVocabulary() + +class IDownloadAsForm(Interface): + title = schema.TextLine( + title=_plone_message("label_title", default="Title"), + required = False, + readonly = True + ) + + current_type = schema.TextLine( + title=_("Current type:"), + required = False, + readonly = True + ) + + target_type = schema.Choice( + title=_("Select file type you want to download"), + vocabulary="onlyoffice.plone.OnlyofficeConvertType" + ) + +download_as_title = ComputedWidgetAttribute( + lambda form: form.context.Title(), field=IDownloadAsForm["title"] +) + +download_as_current_type = ComputedWidgetAttribute( + lambda form: fileUtils.getFileExt(form.context), field=IDownloadAsForm["current_type"] +) diff --git a/src/onlyoffice/connector/browser/menu.py b/src/onlyoffice/plone/browser/menu.py similarity index 93% rename from src/onlyoffice/connector/browser/menu.py rename to src/onlyoffice/plone/browser/menu.py index 8ee21fe..a49fd7b 100644 --- a/src/onlyoffice/connector/browser/menu.py +++ b/src/onlyoffice/plone/browser/menu.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2021 +# (c) Copyright Ascensio System SIA 2022 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,9 +20,9 @@ from zope.security import checkPermission from zope.component import getMultiAdapter from plone.protect.utils import addTokenToUrl -from onlyoffice.connector.interfaces import logger -from onlyoffice.connector.interfaces import _ -from onlyoffice.connector.core import fileUtils +from onlyoffice.plone.interfaces import logger +from onlyoffice.plone.interfaces import _ +from onlyoffice.plone.core import fileUtils @implementer(IActionsSubMenuItem) class OnlyofficeCreateSubMenuItem(BrowserSubMenuItem): diff --git a/src/onlyoffice/connector/browser/overrides/.gitkeep b/src/onlyoffice/plone/browser/overrides/.gitkeep similarity index 100% rename from src/onlyoffice/connector/browser/overrides/.gitkeep rename to src/onlyoffice/plone/browser/overrides/.gitkeep diff --git a/src/onlyoffice/connector/browser/static/config.json b/src/onlyoffice/plone/browser/static/config.json similarity index 100% rename from src/onlyoffice/connector/browser/static/config.json rename to src/onlyoffice/plone/browser/static/config.json diff --git a/src/onlyoffice/connector/browser/static/css/onlyoffice.css b/src/onlyoffice/plone/browser/static/css/onlyoffice.css similarity index 90% rename from src/onlyoffice/connector/browser/static/css/onlyoffice.css rename to src/onlyoffice/plone/browser/static/css/onlyoffice.css index 3979f06..063d094 100644 --- a/src/onlyoffice/connector/browser/static/css/onlyoffice.css +++ b/src/onlyoffice/plone/browser/static/css/onlyoffice.css @@ -26,6 +26,8 @@ .icon-onlyoffice-create:before { content: '\e801' !important; } /* '' */ .icon-onlyoffice-edit:before { content: '\e801' !important; } /* '' */ .icon-onlyoffice-fill-form:before { content: '\e801' !important; } /* '' */ +.icon-onlyoffice-conversion-file:before { content: '\e801' !important; } /* '' */ +.icon-onlyoffice-conversion-document:before { content: '\e801' !important; } /* '' */ .icon-onlyoffice-file-word:before { content: '\e800' !important; } /* '' */ .icon-onlyoffice-file-cell:before { content: '\e802' !important; } /* '' */ .icon-onlyoffice-file-slide:before { content: '\e803' !important; } /* '' */ diff --git a/src/onlyoffice/connector/browser/static/font/onlyoffice.eot b/src/onlyoffice/plone/browser/static/font/onlyoffice.eot similarity index 100% rename from src/onlyoffice/connector/browser/static/font/onlyoffice.eot rename to src/onlyoffice/plone/browser/static/font/onlyoffice.eot diff --git a/src/onlyoffice/connector/browser/static/font/onlyoffice.svg b/src/onlyoffice/plone/browser/static/font/onlyoffice.svg similarity index 100% rename from src/onlyoffice/connector/browser/static/font/onlyoffice.svg rename to src/onlyoffice/plone/browser/static/font/onlyoffice.svg diff --git a/src/onlyoffice/connector/browser/static/font/onlyoffice.ttf b/src/onlyoffice/plone/browser/static/font/onlyoffice.ttf similarity index 100% rename from src/onlyoffice/connector/browser/static/font/onlyoffice.ttf rename to src/onlyoffice/plone/browser/static/font/onlyoffice.ttf diff --git a/src/onlyoffice/connector/browser/static/font/onlyoffice.woff b/src/onlyoffice/plone/browser/static/font/onlyoffice.woff similarity index 100% rename from src/onlyoffice/connector/browser/static/font/onlyoffice.woff rename to src/onlyoffice/plone/browser/static/font/onlyoffice.woff diff --git a/src/onlyoffice/connector/browser/static/font/onlyoffice.woff2 b/src/onlyoffice/plone/browser/static/font/onlyoffice.woff2 similarity index 100% rename from src/onlyoffice/connector/browser/static/font/onlyoffice.woff2 rename to src/onlyoffice/plone/browser/static/font/onlyoffice.woff2 diff --git a/src/onlyoffice/plone/browser/static/js/controlpanel.js b/src/onlyoffice/plone/browser/static/js/controlpanel.js new file mode 100644 index 0000000..7f9cb6b --- /dev/null +++ b/src/onlyoffice/plone/browser/static/js/controlpanel.js @@ -0,0 +1,115 @@ +require([ + "jquery" +], function ($) { + + /* Disable a control panel setting */ + $.disableSettings = function (settings) { + $.each(settings, function (intIndex, setting) { + setting.addClass("unclickable"); + var setting_field = $(setting).find("input,select"); + setting_field.attr("disabled", "disabled"); + }); + }; + + /* Enable a control panel setting */ + $.enableSettings = function (settings) { + $.each(settings, function (intIndex, setting) { + setting.removeClass("unclickable"); + var setting_field = $(setting).find("input,select"); + setting_field.removeAttr("disabled"); + }); + }; + + $.updateSettings = function () { + var demoEnabled = $("#form-widgets-demoEnabled-0").prop("checked"); + var demoAvailable = $("#content-core").hasClass("demo_available"); + + if (demoEnabled === true && demoAvailable === true) { + $.disableSettings([ + $("#formfield-form-widgets-docUrl"), + $("#formfield-form-widgets-jwtSecret"), + $("#formfield-form-widgets-docInnerUrl") + ]); + } else { + $.enableSettings([ + $("#formfield-form-widgets-docUrl"), + $("#formfield-form-widgets-jwtSecret"), + $("#formfield-form-widgets-docInnerUrl") + ]); + } + + if (demoAvailable === false) { + $.disableSettings([ + $("#formfield-form-widgets-demoEnabled") + ]); + + $("#formfield-form-widgets-demoEnabled span.formHelp").text( + $.I18N("The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server.") + ); + } + }; + + $.testDocServiceApi = function () { + var testApiResult = function () { + var docUrlPublicValidation = $("#form-widgets-docUrlPublicValidation-0"); + + var result = typeof DocsAPI != "undefined"; + + docUrlPublicValidation.addClass("verified"); + docUrlPublicValidation.prop("checked", result); + + $("#form-buttons-save").click(); + }; + + delete DocsAPI; + + $("#scripDocServiceAddress").remove(); + + var js = document.createElement("script"); + js.setAttribute("type", "text/javascript"); + js.setAttribute("id", "scripDocServiceAddress"); + document.getElementsByTagName("head")[0].appendChild(js); + + var scriptAddress = $("#scripDocServiceAddress"); + + scriptAddress.on("load", testApiResult).on("error", testApiResult); + + var docServiceUrlApi = $("#form-widgets-docUrl").val(); + + if (!docServiceUrlApi.endsWith("/")) { + docServiceUrlApi += "/"; + } + + scriptAddress.attr("src", docServiceUrlApi + "web-apps/apps/api/documents/api.js"); + }; + + $("#form-widgets-docUrlPublicValidation").hide(); + + $(document).ready(function () { + $.updateSettings(); + + $("#form-widgets-demoEnabled-0").on("change", function(){ + $.updateSettings(); + }); + + $("#form-buttons-save").on("click", function(e) { + var demoEnabled = $("#form-widgets-demoEnabled-0").prop("checked"); + var demoAvailable = $("#content-core").hasClass("demo_available"); + var verifiedPublicUrl = $("#form-widgets-docUrlPublicValidation-0").hasClass("verified"); + + if (!verifiedPublicUrl && !(demoEnabled && demoAvailable)) { + e.preventDefault(); + $.testDocServiceApi(); + } + }); + + /********************************************************************** + * Remove the disabled attribute from all form elements before + * submitting the form. Otherwise the z3c.form will raise errors on + * the required attributes. + **********************************************************************/ + $("form#OnlyofficeControlPanelForm").bind("submit", function () { + $(this).find("input,select").removeAttr("disabled"); + }); + }); +}); diff --git a/src/onlyoffice/plone/browser/static/js/convert.js b/src/onlyoffice/plone/browser/static/js/convert.js new file mode 100644 index 0000000..5cb6cea --- /dev/null +++ b/src/onlyoffice/plone/browser/static/js/convert.js @@ -0,0 +1,76 @@ +require([ + "jquery" +], function ($) { + $(document).ready(function () { + var form = $("form[class*='view-name-onlyoffice-convert']"); + var titleInput = $("#form-widgets-title"); + var currentType = $("#form-widgets-current_type"); + var targetType = $("#form-widgets-target_type"); + var buttonBlock = $("form .formControls"); + var progressBar = $("#progressBar"); + + + function onResponseSuccess(data) { + $("div.progress-bar").width(data.percent + "%") + if (data.endConvert === true) { + $.showMessage($.I18N("Item converted"), "info") + $("#messageProgress").text($.I18N("Converting is finished")); + setTimeout(function () { + document.location.href = data.fileURL; + }, 2000); + } else { + setTimeout(requestConvert, 1000); + } + }; + + function onResponseError(message){ + $.showMessage(message, "error") + titleInput.removeAttr("disabled"); + buttonBlock.show(); + progressBar.addClass("hide"); + } + + function requestConvert () { + titleInput.attr("disabled", "disabled"); + buttonBlock.hide(); + progressBar.removeClass("hide"); + $("#messageProgress").text( + $.I18N("Converting ${currentType} to ${targetType} in progress..", { + "currentType": currentType.text(), + "targetType": targetType.text() + }) + ); + + form.ajaxSubmit({ + type: "POST", + url: form.attr('action') + "-action", + data: { + "title": titleInput.val() + }, + success: function(data) { + if (!data.hasOwnProperty("error")) { + onResponseSuccess(data); + } else { + onResponseError(data.error); + } + }, + error: function(state, value, xhr) { + if (state.status == 403) { + onResponseError($.I18N("You are not authorized to add content to this folder")); + } else{ + onResponseError(xhr); + } + } + }); + }; + + $("#form-buttons-Convert").on("click", function (event) { + $(window).off('beforeunload'); + event.preventDefault(); + + if ($("#form div.error").length == 0) { + requestConvert(); + } + }); + }); +}); diff --git a/src/onlyoffice/plone/browser/static/js/utils.js b/src/onlyoffice/plone/browser/static/js/utils.js new file mode 100644 index 0000000..baae1c7 --- /dev/null +++ b/src/onlyoffice/plone/browser/static/js/utils.js @@ -0,0 +1,26 @@ +require([ + "jquery", + "mockup-i18n" +], function ($, I18N) { + + $.I18N = function (msgid, mapping = {}) { + var i18n = new I18N(); + i18n.loadCatalog("onlyoffice.plone"); + _t = i18n.MessageFactory("onlyoffice.plone"); + return _t(msgid, mapping = mapping); + } + + $.showMessage = function(message, type, modal = false) { + var global_message = modal ? $(".plone-modal-dialog #global_statusmessage") : $("#global_statusmessage"); + + global_message.empty(); + + global_message.html( + "
" + + "" + $("#" + type).text() + "" + + message + + "
" + ); + + }; +}); \ No newline at end of file diff --git a/src/onlyoffice/plone/browser/templates/controlpanel.pt b/src/onlyoffice/plone/browser/templates/controlpanel.pt new file mode 100644 index 0000000..7660867 --- /dev/null +++ b/src/onlyoffice/plone/browser/templates/controlpanel.pt @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + +
+

View Title

+
+ +
+ +
+ +
+ + + diff --git a/src/onlyoffice/plone/browser/templates/convert.pt b/src/onlyoffice/plone/browser/templates/convert.pt new file mode 100644 index 0000000..404e3cb --- /dev/null +++ b/src/onlyoffice/plone/browser/templates/convert.pt @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + +
+

Conversion in ONLYOFFICE

+ +
+
+
+ +
+
+
+
+ +
+
+ 100% Complete (success) +
+
+
+
+
+
+ + + +
+
+ + + \ No newline at end of file diff --git a/src/onlyoffice/plone/browser/templates/download-as.pt b/src/onlyoffice/plone/browser/templates/download-as.pt new file mode 100644 index 0000000..c982a1c --- /dev/null +++ b/src/onlyoffice/plone/browser/templates/download-as.pt @@ -0,0 +1,112 @@ + + + + + + + + + + +
+

Download as

+ +
+
+
+ + +
+
+
+ + + + + + +
+ + + \ No newline at end of file diff --git a/src/onlyoffice/connector/browser/templates/error.pt b/src/onlyoffice/plone/browser/templates/error.pt similarity index 92% rename from src/onlyoffice/connector/browser/templates/error.pt rename to src/onlyoffice/plone/browser/templates/error.pt index c00d5b9..94634d6 100644 --- a/src/onlyoffice/connector/browser/templates/error.pt +++ b/src/onlyoffice/plone/browser/templates/error.pt @@ -4,11 +4,11 @@ xmlns:i18n="http://xml.zope.org/namespaces/i18n" lang="en" metal:use-macro="here/main_template/macros/master" - i18n:domain="onlyoffice.connector"> + i18n:domain="onlyoffice.plone"> diff --git a/src/onlyoffice/connector/core/__init__.py b/src/onlyoffice/plone/core/__init__.py similarity index 100% rename from src/onlyoffice/connector/core/__init__.py rename to src/onlyoffice/plone/core/__init__.py diff --git a/src/onlyoffice/connector/core/config.py b/src/onlyoffice/plone/core/config.py similarity index 52% rename from src/onlyoffice/connector/core/config.py rename to src/onlyoffice/plone/core/config.py index f5d3c38..635215c 100644 --- a/src/onlyoffice/connector/core/config.py +++ b/src/onlyoffice/plone/core/config.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2021 +# (c) Copyright Ascensio System SIA 2022 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,8 +16,18 @@ class Config(): docUrl = None + ploneUrl = None + docInnerUrl = None jwtSecret = None + demoDocUrl = "https://onlinedocs.onlyoffice.com/" + demoHeader = "AuthorizationJWT" + demoJwtSecret = "sn2puSUF7muF5Jas" + demoTrial = 30 + def __init__(self, registry): - self.docUrl = registry.get('onlyoffice.connector.docUrl') - self.jwtSecret = registry.get('onlyoffice.connector.jwtSecret') \ No newline at end of file + self.docUrl = registry.get('onlyoffice.plone.docUrl') + self.ploneUrl = registry.get('onlyoffice.plone.ploneUrl') + self.docInnerUrl = registry.get('onlyoffice.plone.docInnerUrl') + self.jwtSecret = registry.get('onlyoffice.plone.jwtSecret') + self.demoEnabled = registry.get('onlyoffice.plone.demoEnabled') diff --git a/src/onlyoffice/plone/core/conversionUtils.py b/src/onlyoffice/plone/core/conversionUtils.py new file mode 100644 index 0000000..1e90067 --- /dev/null +++ b/src/onlyoffice/plone/core/conversionUtils.py @@ -0,0 +1,138 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from onlyoffice.plone.core import utils +from onlyoffice.plone.core import formatUtils +from onlyoffice.plone.interfaces import logger +from onlyoffice.plone.interfaces import _ + +import requests +import json +import os + +def convert( + key, url, fileType, outputType, title = None, region = None, + asyncType = False, docUrl = None, jwtEnabled = None, + jwtSecret = None, jwtHeader = None + ): + + if docUrl == None: + docUrl = utils.getInnerDocUrl() + if jwtEnabled == None: + jwtEnabled = utils.isJwtEnabled() + if jwtSecret == None: + jwtSecret = utils.getJwtSecret() + if jwtHeader == None: + jwtHeader = utils.getJwtHeader() + + bodyJson = { + "key": key, + "url": url, + "filetype": fileType, + "outputtype": outputType, + "title": title, + "region": region, + "async": asyncType + } + + headers = { + "Content-Type" : "application/json", + "Accept": "application/json", + } + + if jwtEnabled: + payload = { "payload": bodyJson } + + headerToken = utils.createSecurityToken(payload, jwtSecret) + headers[jwtHeader] = "Bearer " + headerToken + + token = utils.createSecurityToken(bodyJson, jwtSecret) + bodyJson["token"] = token + + data = {} + error = None + + try: + response = requests.post( + os.path.join(docUrl, "ConvertService.ashx"), + data = json.dumps(bodyJson), + headers = headers + ) + + if response.status_code == 200: + response_json = response.json() + + if "error" in response_json: + error = { + "type": 1, + "message": getConversionErrorMessage(response_json.get("error")) + } + else: + data = response_json + + else: + logger.debug("ConvertService returned status: " + response.status_code) + error = { + "type": 2, + "message": _("Document conversion service returned status ${status_code}", mapping = { + "status_code": response.status_code + }) + } + + except: + logger.debug("ConvertService cannot be reached") + error = { + "type": 2, + "message": _('Document conversion service cannot be reached') + } + + return data, error + +def getConversionErrorMessage(errorCode): + errorDictionary = { + -1: _("Unknown error"), + -2: _("Conversion timeout error"), + -3: _("Conversion error"), + -4: _("Error while downloading the document file to be converted"), + -5: _("Incorrect password"), + -6: _("Error while accessing the conversion result database"), + -7: _("Input error"), + -8: _("Invalid token") + } + + try: + return errorDictionary[errorCode] + except: + return _("Undefined error code") + +def getTargetExt(ext): + for format in formatUtils.getSupportedFormats(): + if format.name == ext: + if format.type == "word": + if "docx" in format.convertTo: return "docx" + if format.type == "cell": + if "xlsx" in format.convertTo: return "xlsx" + if format.type == "slide": + if "pptx" in format.convertTo: return "pptx" + + return None + +def getConvertToExtArray(ext): + for format in formatUtils.getSupportedFormats(): + if format.name == ext: + return format.convertTo + + return None \ No newline at end of file diff --git a/src/onlyoffice/plone/core/featureUtils.py b/src/onlyoffice/plone/core/featureUtils.py new file mode 100644 index 0000000..79d1b2b --- /dev/null +++ b/src/onlyoffice/plone/core/featureUtils.py @@ -0,0 +1,39 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from Products.CMFCore.utils import getToolByName +from zope.i18n import translate +from onlyoffice.plone.interfaces import _ +from onlyoffice.plone.core import utils + +import json + +def getSaveAsObject(self): + return json.dumps({ + 'available': not getToolByName(self.context, 'portal_membership').isAnonymousUser(), + 'title': translate(_(u'Save file copy as'), context = self.request), + 'helpTitle': translate(_(u'Leave the field blank to save to the root of the site'), context = self.request), + 'messages': { + 'success': translate(_(u'The file was successfully saved as '), context = self.request), + 'errorNotAuthorized': translate(_(u'You are not authorized to add content to this folder'), context = self.request), + 'errorUnknown': translate(_(u'Unknown error while saving file'), context = self.request) + } + }) + +def getDemoAsObject(self): + return json.dumps({ + 'message': translate(_(u'You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data.'), context = self.request), + }) if utils.getDemoActive() else None diff --git a/src/onlyoffice/plone/core/fileUtils.py b/src/onlyoffice/plone/core/fileUtils.py new file mode 100644 index 0000000..458acf4 --- /dev/null +++ b/src/onlyoffice/plone/core/fileUtils.py @@ -0,0 +1,155 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from plone.app.widgets.utils import get_relateditems_options +from plone.app.dexterity.interfaces import IDXFileFactory +from AccessControl import getSecurityManager +from zope.event import notify +from zope.lifecycleevent import ObjectModifiedEvent +from onlyoffice.plone.interfaces import _ +from onlyoffice.plone.core import formatUtils +from onlyoffice.plone.core import conversionUtils +import re +from onlyoffice.plone.interfaces import logger + +localePath = { + 'az': 'az-Latn-AZ', + 'bg': 'bg-BG', + 'cs': 'cs-CZ', + 'de': 'de-DE', + 'el': 'el-GR', + 'en-gb': 'en-GB', + 'en': 'en-US', + 'es': 'es-ES', + 'fr': 'fr-FR', + 'it': 'it-IT', + 'ja': 'ja-JP', + 'ko': 'ko-KR', + 'lv': 'lv-LV', + 'nl': 'nl-NL', + 'pl': 'pl-PL', + 'pt-br': 'pt-BR', + 'pt': 'pt-PT', + 'ru': 'ru-RU', + 'sk': 'sk-SK', + 'sv': 'sv-SE', + 'uk': 'uk-UA', + 'vi': 'vi-VN', + 'zh': 'zh-CN' + } + +def getCorrectFileName(str): + return re.sub(r'[*?:\"<>/|\\\\]', '_', str) + +def getFileTitleWithoutExt(context): + title = context.Title() + ind = context.Title().rfind('.') + return title[:ind] + +def getFileNameWithoutExt(context): + filename = context.file.filename + ind = context.file.filename.rfind('.') + return filename[:ind] + +def getFileExt(context): + portal_type = context.portal_type + + if portal_type == "Image" : + filename = context.image.filename if hasattr(context, "image") else None + + if portal_type == "File" or portal_type == "Document" : + filename = context.file.filename if hasattr(context, "file") else None + + if filename : + return filename[filename.rfind('.') + 1:].lower() + + return None + +def getFileType(context): + for format in formatUtils.getSupportedFormats(): + if format.name == getFileExt(context): + return format.type + + return None + +def canView(context): + for format in formatUtils.getSupportedFormats(): + if format.name == getFileExt(context): + return True + + return False + +def canEdit(context): + for format in formatUtils.getSupportedFormats(): + if format.name == getFileExt(context): + return format.edit + + return False + +def canFillForm(context): + for format in formatUtils.getSupportedFormats(): + if format.name == getFileExt(context): + return format.fillForm + + return False + +def canConvert(context): + return conversionUtils.getTargetExt(getFileExt(context)) != None + +def getDefaultExtByType(str): + if (str == 'word'): + return 'docx' + if (str == 'cell'): + return 'xlsx' + if (str == 'slide'): + return 'pptx' + if (str == 'form'): + return 'docxf' + + return None + +def getDefaultNameByType(str): + if (str == 'word'): + return _(u'Document') + if (str == 'cell'): + return _(u'Spreadsheet') + if (str == 'slide'): + return _(u'Presentation') + if (str == 'form'): + return _(u'Form template') + + return None + +def addNewFile(fileName, contentType, fileData, folder, title = None): + factory = IDXFileFactory(folder) + file = factory(fileName, contentType, fileData) + + if title != None and title != "": + getSecurityManager().validate(file, file, "setTitle", file.setTitle) + file.setTitle(title) + notify(ObjectModifiedEvent(file)) + + return file + +def getRelatedRtemsOptions(context): + return get_relateditems_options( + context=context, + value=None, + separator=";", + vocabulary_name="plone.app.vocabularies.Catalog", + vocabulary_view="@@getVocabulary", + field_name="relatedItems", + ) \ No newline at end of file diff --git a/src/onlyoffice/plone/core/formatUtils.py b/src/onlyoffice/plone/core/formatUtils.py new file mode 100644 index 0000000..9c8f869 --- /dev/null +++ b/src/onlyoffice/plone/core/formatUtils.py @@ -0,0 +1,75 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +class Format: + def __init__(self, name, type, edit = False, fillForm = False, convertTo = []): + self.name = name + self.type = type + self.edit = edit + self.fillForm = fillForm + self.convertTo = convertTo + +def getSupportedFormats(): + return [ + Format("djvu", "word"), + Format("doc", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("docm", "word", convertTo = ["docx", "docxf", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("docx", "word", True, convertTo = ["docxf", "oform", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("docxf", "word", True, convertTo = ["docx", "oform", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("dot", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("dotm", "word", convertTo = ["docx", "docxf", "docm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("dotx", "word", convertTo = ["docx", "docxf", "docm", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("epub", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("fb2", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("fodt", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("html", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("mht", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("odt", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("ott", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "pdf", "pdfa", "rtf", "txt"]), + Format("oxps", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("pdf", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdfa", "rtf", "txt"]), + Format("rtf", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "txt"]), + Format("txt", "word"), + Format("xps", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("xml", "word", convertTo = ["docx", "docxf", "docm", "dotm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"]), + Format("oform", "word", fillForm = True), + + Format("csv", "cell"), + Format("fods", "cell", convertTo = ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xlsm", "xltm", "xltx"]), + Format("ods", "cell", convertTo = ["xlsx", "csv", "ots", "pdf", "pdfa", "xlsm", "xltm", "xltx"]), + Format("ots", "cell", convertTo = ["xlsx", "csv", "ods", "pdf", "pdfa", "xlsm", "xltm", "xltx"]), + Format("xls", "cell", convertTo = ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xlsm", "xltm", "xltx"]), + Format("xlsb", "cell", convertTo = ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xlsm", "xltm", "xltx"]), + Format("xlsm", "cell", convertTo = ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xltm", "xltx"]), + Format("xlsx", "cell", True, convertTo = ["csv", "ods", "ots", "pdf", "pdfa", "xlsm", "xltm", "xltx"]), + Format("xlt", "cell", convertTo = ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xlsm", "xltm", "xltx"]), + Format("xltm", "cell", convertTo = ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xlsm", "xltx"]), + Format("xltx", "cell", convertTo = ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xlsm", "xltm"]), + + Format("fodp", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potm", "potx", "pptm"]), + Format("odp", "slide", convertTo = ["pptx", "otp", "pdf", "pdfa", "potm", "potx", "pptm"]), + Format("otp", "slide", convertTo = ["pptx", "odp", "pdf", "pdfa", "potm", "potx", "pptm"]), + Format("pot", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potm", "potx", "pptm"]), + Format("potm", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "pptm"]), + Format("potx", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potm", "pptm"]), + Format("pps", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potm", "potx", "pptm"]), + Format("ppsm", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potm", "potx", "pptm"]), + Format("ppsx", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potm", "potx", "pptm"]), + Format("ppt", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potm", "potx", "pptm"]), + Format("pptm", "slide", convertTo = ["pptx", "odp", "otp", "pdf", "pdfa", "potm", "potx"]), + Format("pptx", "slide", True, convertTo = ["odp", "otp", "pdf", "pdfa", "potm", "potx", "pptm"]), + ] diff --git a/src/onlyoffice/plone/core/utils.py b/src/onlyoffice/plone/core/utils.py new file mode 100644 index 0000000..c4c424b --- /dev/null +++ b/src/onlyoffice/plone/core/utils.py @@ -0,0 +1,141 @@ +# +# (c) Copyright Ascensio System SIA 2022 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +from logging import log +from plone.uuid.interfaces import IUUID +from zope.publisher.interfaces import Unauthorized +from urllib.parse import parse_qs +from plone.registry.interfaces import IRegistry +from zope.component import getUtility +from zope.annotation.interfaces import IAnnotations +from plone import api +from DateTime import DateTime +from onlyoffice.plone.core.config import Config +from onlyoffice.plone.interfaces import logger + +import base64 +import jwt +import os + +def getDocumentKey(obj): + return base64.b64encode((obj.id + '_' + str(obj.modification_date)).encode('utf8')).decode('ascii') + +def isJwtEnabled(): + if getDemoActive(): + return True + else: + return bool(Config(getUtility(IRegistry)).jwtSecret) + +def createSecurityToken(payload, jwtSecret = None): + if (jwtSecret is None): + jwtSecret = getJwtSecret() + return jwt.encode(payload, jwtSecret, algorithm="HS256").decode("utf-8") + +def createSecurityTokenFromContext(obj): + return createSecurityToken({"key": obj.id}, IUUID(obj)) + +def decodeSecurityToken(token): + return jwt.decode(token, getJwtSecret(), algorithms=['HS256']) + +def checkSecurityToken(obj, token): + if (token != createSecurityTokenFromContext(obj)): + raise Unauthorized + +def getTokenFromRequest(request): + query = parse_qs(request['QUERY_STRING']) + if 'token' in query: + return query['token'][0] + return None + +def getTokenFromHeader(request): + jwtHeader = "HTTP_" + getJwtHeader().upper() + token = request._orig_env.get(jwtHeader) + if token: + token = token[len("Bearer "):] + return token + +def getJwtSecret(): + if getDemoActive(): + return Config(getUtility(IRegistry)).demoJwtSecret + else: + return Config(getUtility(IRegistry)).jwtSecret + +def getJwtHeader(): + if getDemoActive(): + return Config(getUtility(IRegistry)).demoHeader + else: + return getJwtHeaderEnv() + +def getJwtHeaderEnv(): + return os.getenv("ONLYOFFICE_JWT_HEADER") if os.getenv("ONLYOFFICE_JWT_HEADER", None) else "Authorization" + +def replaceDocUrlToInternal(url): + docUrl = Config(getUtility(IRegistry)).docUrl + docInnerUrl = Config(getUtility(IRegistry)).docInnerUrl + if docInnerUrl and not getDemoActive(): + url = url.replace(docUrl, docInnerUrl) + return url + +def getPublicDocUrl(): + if getDemoActive(): + return os.path.join(Config(getUtility(IRegistry)).demoDocUrl, "") + else: + return os.path.join(Config(getUtility(IRegistry)).docUrl, "") + +def getInnerDocUrl(): + docInnerUrl = Config(getUtility(IRegistry)).docInnerUrl + if getDemoActive() or docInnerUrl == None or docInnerUrl == "": + return os.path.join(getPublicDocUrl(), "") + else: + return os.path.join(docInnerUrl, "") + +def getPloneContextUrl(context): + innerPloneUrl = Config(getUtility(IRegistry)).ploneUrl + + if innerPloneUrl: + return os.path.join(innerPloneUrl, "/".join(context.getPhysicalPath())[1:]) + else: + return context.absolute_url() + +def getTestConvertDocUrl(innerPloneUrl): + portal = api.portal.get() + + if innerPloneUrl: + return os.path.join(innerPloneUrl, "/".join(portal.getPhysicalPath()[1:]), "onlyoffice-test-convert") + else: + return os.path.join(portal.absolute_url(), "onlyoffice-test-convert") + +def setDemo(): + potralAnnotations = IAnnotations(api.portal.get()) + if "onlyoffice.plone.demoStart" not in potralAnnotations: + potralAnnotations["onlyoffice.plone.demoStart"] = int(DateTime()) + +def getDemoAvailable(forActive): + potralAnnotations = IAnnotations(api.portal.get()) + + if "onlyoffice.plone.demoStart" in potralAnnotations: + dateStart = potralAnnotations["onlyoffice.plone.demoStart"] + + try: + dateEnd = dateStart + Config(getUtility(IRegistry)).demoTrial * 60 * 60 * 24 + return DateTime(dateEnd).isFuture() + except: + return False + + return forActive + +def getDemoActive(): + return Config(getUtility(IRegistry)).demoEnabled and getDemoAvailable(False) \ No newline at end of file diff --git a/src/onlyoffice/connector/interfaces.py b/src/onlyoffice/plone/interfaces.py similarity index 86% rename from src/onlyoffice/connector/interfaces.py rename to src/onlyoffice/plone/interfaces.py index 7ba6194..42e8816 100644 --- a/src/onlyoffice/connector/interfaces.py +++ b/src/onlyoffice/plone/interfaces.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2021 +# (c) Copyright Ascensio System SIA 2022 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import logging logger = logging.getLogger("onlyoffice") -_ = MessageFactory('onlyoffice.connector') +_ = MessageFactory('onlyoffice.plone') -class IOnlyofficeConnectorLayer(IDefaultBrowserLayer): +class IOnlyofficePloneLayer(IDefaultBrowserLayer): """Marker interface that defines a browser layer.""" \ No newline at end of file diff --git a/src/onlyoffice/connector/locales/README.rst b/src/onlyoffice/plone/locales/README.rst similarity index 100% rename from src/onlyoffice/connector/locales/README.rst rename to src/onlyoffice/plone/locales/README.rst diff --git a/src/onlyoffice/connector/locales/__init__.py b/src/onlyoffice/plone/locales/__init__.py similarity index 100% rename from src/onlyoffice/connector/locales/__init__.py rename to src/onlyoffice/plone/locales/__init__.py diff --git a/src/onlyoffice/plone/locales/cs/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/cs/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..53fe76c --- /dev/null +++ b/src/onlyoffice/plone/locales/cs/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-09-30 17:43+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "Služba Úpravy dokumentů" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "Nainstaluje doplněk konektor ONLYOFFICE" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "Konfigurace ONLYOFFICE" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "Úprava ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "Náhled ONLYOFFICE" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "Vyplňte formulář v ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "Stránka náhledu ONLYOFFICE" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "ONLYOFFICE nedokáže otevřít tento soubor." + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "Odinstaluje doplněk konektor ONLYOFFICE" + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (odinstalovat)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "Tajný klíč (pro deaktivaci ponechte prázdné)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "Vytvořit v ONLYOFFICE" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "Dokument" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "Tabulka" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "Prezentace" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "Šablona formuláře" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "Uložit kopii souboru jako" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "Pro uložení do kořenového adresáře webu ponechte pole prázdné" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "Soubor byl úspěšně uložen jako" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "Nejste oprávněni přidávat obsah do této složky" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "Neznámá chyba při ukládání souboru" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "Nepodporovaná verze DocumentServer." + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "Aktualizujte prosím Dokumenty ONLYOFFICE na verzi 7.0, abyste mohli pracovat s vyplnitelnými formuláři online." + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "Chybí požadovaný vstup." + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "ONLYOFFICE nelze dosáhnout" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "Chyba autorizace" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "Chyba při pokusu o kontrolu služby CommandService" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "Chyba při pokusu o kontrolu služby ConvertService" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "Smíšený aktivní obsah není povolen. Je vyžadována adresa HTTPS pro Document Server." + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "Připojení k ukázkovému serveru dokumentů ONLYOFFICE" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "Jedná se o veřejný testovací server, nepoužívejte jej pro soukromá citlivá data. Server bude k dispozici po dobu 30 dnů." + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "Po uplynutí 30denního testovacího období se již nelze k demo verzi Dokumentového serveru ONLYOFFICE připojit." + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "Chyba při připojování k demo serveru (${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "Používáte veřejný demo server ONLYOFFICE Document Server. Neukládejte prosím soukromá citlivá data." + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "Konverze v ONLYOFFICE" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "Dokument můžete převést do formátu OOXML" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "Aktuální typ:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "Cílový typ:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "Převod" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "Převáděná položka" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress." +msgstr "Probíhá konverze ${currentType} na ${targetType}." + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "Převod je dokončen" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "Služba převodu dokumentu vrátila chybu (${error})" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "Neznámá chyba" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "Chyba časového limitu převodu" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "Chyba převodu" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "Chyba při stahování souboru dokumentu, který má být převeden" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "Nesprávné heslo" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "Chyba při přístupu do databáze výsledků převodu" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "Chyba při zadávání" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "Neplatný token" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "Nedefinovaný chybový kód" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "Služba převodu dokumentů vrátila stav ${status_code}" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "Službu převodu dokumentů nelze kontaktovat" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "Vyberte typ souboru, který chcete stáhnout" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "Stáhnout jako" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "Stáhnout" diff --git a/src/onlyoffice/plone/locales/de/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/de/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..43642db --- /dev/null +++ b/src/onlyoffice/plone/locales/de/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-10-07 18:53+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "Dienst zur Dokumentenbearbeitung" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "Connector-Add-On von ONLYOFFICE installieren" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "ONLYOFFICE Konfiguration" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "ONLYOFFICE Bearbeiten" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "ONLYOFFICE Anzeigen" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "Formular in ONLYOFFICE ausfüllen" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE Seite anzeigen" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "ONLYOFFICE kann diese Datei nicht öffnen" + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "Connector-Add-On von ONLYOFFICE deinstallieren" + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (deinstallieren)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "Geheimer Schlüssel (freilassen, um zu deaktivieren)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "Serveradresse für interne Anforderungen vom Dokumentbearbeitung-Service" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "Serviceadresse der Dokumentbearbeitung für interne Anforderungen vom Server" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "In ONLYOFFICE erstellen" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "Dokument" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "Tabelle" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "Präsentation" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "Formularvorlage" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "Dateikopie speichern als" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "Lassen Sie das Feld leer, um im Stammverzeichnis der Site zu speicher" + +#: ../browser/api.py +msgid "The file was successfully saved as" +msgstr "Die Datei wurde gespeichert als" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "Sie dürfen zu diesem Ordner keine Inhalte hinzufügen" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "Unbekannter Fehler beim Speichern" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "Die Version des Document Servers ist nicht unterstützt." + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "Für Online-Arbeit mit Formularen ist Version 7.0 von ONLYOFFICE Docs erforderlich" + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "Erforderliche Eingabe fehlt." + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "ONLYOFFICE ist zurzeit nicht erreichbar" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "Fehler bei der Autorisierung" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "Fehler beim Versuch, CommandService zu überprüfen" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "Fehler beim Versuch, ConvertService zu überprüfen" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "Mixed Active Content ist nicht möglich. HTTPS-Adresse für Document Server ist erforderlich." + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "Demo-Verbindung zum ONLYOFFICE Document Server herstellen" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "Dies ist ein öffentlicher Testserver. Bitte verwende beim Testen keine privaten sensiblen Daten. Der Server ist 30 Tage lang verfügbar." + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "Der 30-tägige Testzeitraum ist abgelaufen. Du kannst keine Verbindung mehr zu Demo ONLYOFFICE Document Server herstellen." + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "Fehler beim Verbindung zum Demo-Server: (${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "Du verwendest den öffentlichen Demo ONLYOFFICE Document Server. Bitte benutze ihn nicht zum Speichern von Deinen privaten sensiblen Daten." + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "Konvertierung in ONLYOFFICE" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "Sie können Ihr Dokument ins OOXML-Format konvertieren" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "Derzeitiges Format:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "Zielformat:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "Konvertieren" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "Datei wurde konvertiert" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress.." +msgstr "Umwandlung von ${currentType} in ${targetType} wird durchgeführt." + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "Die Konvertierung ist abgeschlossen" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "Der Dienst für die Dokumentenkonvertierung hat einen Fehler gemeldet: (${error})" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "Unbekannter Fehler" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "Fehler bei der Konvertierung: Timeout" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "Fehler bei der Umwandlung" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "Fehler beim Herunterladen der Datei, die konvertiert werden muss" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "Ungültiges Passwort" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "Fehler beim Zugriff auf die Datenbank der Ergebnisse der Konvertierung" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "Eingabefehler" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "Ungültiges Token" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "Unbekannter Fehlercode" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "Der Dienst für die Dokumentenkonvertierung hat den Status ${status_code} zurückgegeben" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "Der Dienst für die Dokumentenkonvertierung ist nicht erreichbar" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "Wählen Sie den Dateityp aus, den Sie herunterladen möchten" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "Herunterladen als" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "Herunterladen" diff --git a/src/onlyoffice/plone/locales/en/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/en/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..c2efd47 --- /dev/null +++ b/src/onlyoffice/plone/locales/en/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,255 @@ +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "" + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "" + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "" + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "" + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "" + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "" + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "" + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "" + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "" + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "" + +#: ../browser/apy.py +msgid "Convert" +msgstr "" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress." +msgstr "" + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "" \ No newline at end of file diff --git a/src/onlyoffice/plone/locales/es/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/es/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..1b90f63 --- /dev/null +++ b/src/onlyoffice/plone/locales/es/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-10-07 18:58+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "Servicio de edición de documentos" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "Instalar add-on del conector de ONLYOFFICE" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "ONLYOFFICE Configuración" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "ONLYOFFICE Edición" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "ONLYOFFICE Vista" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "Rellenar el formulario en ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE Vista de páginas" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "ONLYOFFICE no puede abrir este archivo" + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "Desinstalar add-on del conector de ONLYOFFICE" + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (desinstalar)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "Clave secreta (deje en blanco o desactive)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "Dirección de servidor para solicitudes internas del Servicio de Edición de Documentos" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "Dirección del Servicio de Edición de Documentos para solicitudes internas del servidor" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "Crear en ONLYOFFICE" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "Documento" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "Hoja de cálculo" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "Presentación" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "Plantilla de formulario" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "Guardar copia del archivo como" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "Deje el campo en blanco para guardar en la raíz del sitio" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "El archivo se ha guardado correctamente como" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "No tiene autorización para añadir contenido a esta carpeta" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "Error desconocido al guardar el documento" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "Versión no soportada del Servidor de documentos." + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "Por favor, actualice ONLYOFFICE Docs a la versión 7.0 para poder trabajar con formularios rellenables en línea" + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "Un campo requerido esta sin tomar en cuenta." + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "No se puede acceder al ONLYOFFICE" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "Error de autorización" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "Error al intentar comprobar CommandService" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "Error al intentar comprobar ConvertService" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "Contenido Mixto Activo no está permitido. Se requiere la dirección HTTPS para el Servidor de documentos." + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "Conectarse al Servidor de documentos de ONLYOFFICE de demostración" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "Este es un servidor de pruebas público, por favor no lo uses para tus datos confidenciales. El servidor estará disponible durante un período de 30 días." + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "El período de prueba de 30 días ha terminado, ya no puedes conectarte al Servidor de documentos de ONLYOFFICE de demostración." + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "Error al conectarse al Servidor de demostración (${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "Estás usando el Servidor de documentos de ONLYOFFICE de demostración. Por favor, no almacenes tus datos confidenciales aquí." + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "Conversión en ONLYOFFICE" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "Puedes convertir tu documento en formato OOXM" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "Tipo actual:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "Tipo de destino:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "Convertir" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "Elemento convertido" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress.." +msgstr "Conversión de ${currentType} a ${targetType} en progreso." + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "La conversión ha finalizado" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "El servicio de conversión de documentos ha devuelto un error (${error})" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "Error desconocido" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "Error de tiempo de conversión" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "Error de conversión" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "Error al descargar el archivo para conversión" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "Contraseña incorrecta" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "Error al acceder la base de datos de resultados de conversión" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "Error de entrada" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "Token no válido" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "Código de error no definido" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "El servicio de conversión de documentos ha devuelto el estado ${status_code}" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "No se puede acceder al servicio de conversión de documentos" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "Selecciona el tipo de archivo que quieres descargar" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "Descargar como" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "Descargar" diff --git a/src/onlyoffice/plone/locales/fr/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/fr/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..4d9c206 --- /dev/null +++ b/src/onlyoffice/plone/locales/fr/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-10-07 18:55+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "Service d'édition de documents" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "Installer le module complémentaire du connecteur ONLYOFFICE" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "Configuration ONLYOFFICE" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "ONLYOFFICE Éditer" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "ONLYOFFICE Voir" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "Remplir le formulaire dans ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE Voir la page" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "ONLYOFFICE ne peut pas ouvrir ce fichier" + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "Désinstaller le module complémentaire du connecteur ONLYOFFICE" + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (désinstaller)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "Clé secrète (laisser vide pour désactiver)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "Adresse du serveur pour les demandes internes du service d'édition de document" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "Adresse du service d'édition de document pour les demandes internes du serveur" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "Créer dans ONLYOFFICE" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "Document" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "Feuille de calcul" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "Présentation" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "Modèle de formulaire" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "Enregistrer une copie du fichier comme" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "Laisser le champ vide pour enregistrer à la racine du site" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "Le fichier a été enregistré avec succès comme" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "Vous n'êtes pas autorisé à ajouter du contenu à ce dossier" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "Une erreur inconnue s'est produite lors de l'enregistrement du fichier" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "Version de DocumentServer non prise en charge." + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "Veuillez mettre à jour ONLYOFFICE Docs vers la version 7.0 pour travailler sur les formulaires à remplir en ligne" + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "Un champ obligatoire est manquant" + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "ONLYOFFICE est indisponible" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "Erreur d'autorisation" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "Erreur lors de la vérification de CommandService" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "Erreur lors de la vérification de ConvertService" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "Le contenu mixte actif n'est pas autorisé. Une adresse HTTPS pour le Document Server est requise." + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "Se connecter à la version démo de ONLYOFFICE Document Server" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "C'est un serveur public proposé à des fins de tests, veuillez ne pas l’utiliser pour vos données personnelles sensibles. Le serveur est disponible pendant 30 jours." + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "La période d'essai de 30 jours est expirée, vous n’êtes plus en mesure de vous connecter à la version démo de ONLYOFFICE Document Server." + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "Erreur de connexion au serveur de démo" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "Vous utilisez la version démo de ONLYOFFICE Docs, proposée à des fins de tests. Veuillez ne pas stocker vos données confidentielles." + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "Conversion dans ONLYOFFICE" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "Vous pouvez concertir votre documents dans le format OOXML" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "Type actuel :" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "Type de cible :" + +#: ../browser/apy.py +msgid "Convert" +msgstr "Convertir" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "Élément converti" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress.." +msgstr "La conversion de ${currentType} en ${targetType} est en cours." + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "La conversion est terminée" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "Le service de conversion de documents a renvoyé une erreur (${error})" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "Erreur inconnue" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "Erreur de délai de conversion" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "Erreur de conversion" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "Erreur lors du téléchargement du fichier à convertir" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "Mot de passe incorrect" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "Erreur lors de l'accès à la base de données des résultats de la conversion" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "Erreur de saisie" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "Jeton non valide" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "Code d'erreur non défini" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "Le service de conversion de documents a renvoyé le statut ${status_code}" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "Le service de conversion des documents n'est pas accessible" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "Sélectionnez le type de fichier que vous souhaitez télécharger" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "Télécharger sous" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "Télécharger" diff --git a/src/onlyoffice/plone/locales/it/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/it/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..64ba4cb --- /dev/null +++ b/src/onlyoffice/plone/locales/it/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-10-07 18:55+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "Servizio Documenti Editing" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "Installa il componente aggiuntivo ONLYOFFICE" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "ONLYOFFICE Configurazione" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "ONLYOFFICE Modifica" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "ONLYOFFICE Visualizza" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "Compilare il modulo in ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE Visualizza pagina" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "ONLYOFFICE non può aprire questo file." + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "Disinstalla il componente aggiuntivo ONLYOFFICE." + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (disinstalla)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "Chiave segreta (lasciare vuoto per disabilitare)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "Indirizzo del server per richieste interne dal Document Editing Service" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "Indirizzo di Document Editing Service per richieste interne dal server" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "Creare in ONLYOFFICE" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "Documento" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "Foglio di calcolo" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "Presentazione" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "Modello di modulo" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "Salvare la copia del file come" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "Lasciare il campo vuoto per salvare nella radice del sito" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "Il file è stato salvato con successo come" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "Non sei autorizzato ad aggiungere contenuti a questa cartella" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "Errore sconosciuto durante il salvataggio del documento" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "Versione di DocumentServer non supportata." + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "Si prega di aggiornare ONLYOFFICE Docs alla versione 7.0 per lavorare su moduli compilabili online" + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "Un campo richiesto è mancante." + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "Impossibile raggiungere ONLYOFFICE" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "Errore di autorizzazione" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "Errore durante il tentativo di controllare CommandService" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "Errore durante il tentativo di controllare ConvertService" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "Il contenuto attivo misto non è consentito. L'indirizzo HTTPS per Document Server è obbligatorio." + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "Connettiti alla demo ONLYOFFICE Document Server" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "Questo è un server di prova pubblico, non utilizzarlo per dati sensibili privati. Il server sarà disponibile per un periodo di 30 giorni." + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "Il periodo di prova di 30 giorni è scaduto, non puoi più connetterti alla demo di ONLYOFFICE Document Server." + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "Errore di connessione al server demo (${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "Stai usando la demo pubblica di ONLYOFFICE Document Server. Ti preghiamo di non archiviare dati sensibili privati." + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "Conversione in ONLYOFFICE" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "Puoi convertire il tuo documento in formato OOXML" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "Tipo presente:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "Tipo di obiettivo:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "Convertire" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "Elemento convertito" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress.." +msgstr "Conversione ${currentType} in ${targetType} in corso." + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "La conversione è compiuta" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "Il servizio di conversione dei documenti ha restituito un errore (${error})" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "Errore sconosciuto" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "Errore di timeout di conversione" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "Errore di conversione" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "Errore di download del documento da convertire" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "Password errata" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "Errore durante l'accesso al database dei risultati della conversione" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "Errore di input" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "Token non valido" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "Codice di errore non definito" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "Il servizio di conversione dei documenti ha restituito lo stato ${status_code}" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "Impossibile raggiungere il servizio di conversione di documenti" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "Scegli il tipo di file che vuoi scaricare" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "Scaricare come" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "Scaricare" diff --git a/src/onlyoffice/plone/locales/ja/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/ja/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..f72b91a --- /dev/null +++ b/src/onlyoffice/plone/locales/ja/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-10-10 14:08+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "ドキュメント編集サービス" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "ONLYOFFICE コネクターアドオンをインストールします" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "ONLYOFFICE コンフィギュレーション" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "ONLYOFFICE 編集" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "ONLYOFFICE 閲覧" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "ONLYOFFICEでフォームを記入する" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE 閲覧ページ" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "このファイルを開くことができません" + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "ONLYOFFICE コネクターアドオンをアンインストールします" + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (アンインストールする)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "シークレットキー (ブランクで無効)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "ドキュメント編集サービスからの内部リクエスト用サーバーアドレス" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "サーバーからの内部リクエスト用ドキュメント編集サービスアドレス" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "ONLYOFFICEで作成" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "ドキュメント" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "スプレッドシート" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "プレゼンテーション" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "フォーム テンプレート" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "ファイルのコピーを保存する形は" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "サイトのルートに保存するには、フィールドを空白のままにしてください" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "正常に保存されたファイル形は" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "このフォルダにコンテンツを追加する権限がありません" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "ファイルの保存中に不明なエラーが発生しました" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "この DocumentServerのバージョンはサポートされていません。" + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "オンラインで入力可能なフォームを作成するには、ONLYOFFICE Docs 7.0版まで更新してください" + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "必要な入力がありません" + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "ONLYOFFICEに接続できません。" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "認識エラー" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "CommandServiceをチェック中にエラーが出ました" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "ConvertServiceをチェック中にエラーが出ました" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "アクティブコンテンツの混在は許可されていません。Document ServerにはHTTPSアドレスが必要です" + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "ONLYOFFICE Document Serverのデモ版へ接続します。" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "このサーバーは公開テストサーバーであり、個人の機密データには使用しないでください。サーバーは30日間利用可能です。" + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "30日間のテスト期間が終了したら、ONLYOFFICE Document Server デモサーバーには繋がらなくなります" + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "デモサーバへの接続エラー (${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "パブリック ONLYOFFICE Docs サーバーを使っているので、プライベートな機密データを利用しないようにしてください。" + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "ONLYOFFICEでのファイル変換" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "OOXMLへの変換が可能です" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "現在のタイプ:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "ターゲットのタイプ:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "変換" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "変換されたアイテム" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress.." +msgstr "${currentType}から${targetType}への変換中" + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "変換終了" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "文書変換サービスが(${error})エラーを返しました" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "不明なエラー" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "変換のタイムアウトエラー" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "変換エラー" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "変換したいファイルのアップロード中にエラーが出ました" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "パスワードが正しくありません" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "変換結果のデータベースへのアクセス中にエラーが出ました" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "入力エラー" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "トークンが無効です" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "エラーコードが定義されていません" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "文書変換サービスが${status_code}ステータスを返しました。" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "文書変換サービスがアクセスできません" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "ダウンロードしたいファイルを選択してください" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "別の形式でダウンロード" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "ダウンロード" diff --git a/src/onlyoffice/plone/locales/nl/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/nl/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..3c782f3 --- /dev/null +++ b/src/onlyoffice/plone/locales/nl/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-09-30 17:58+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "Documentbewerkingsservice" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "Installeert de add-on van de ONLYOFFICE connector" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "ONLYOFFICE Configuratie" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "ONLYOFFICE Bewerken" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "ONLYOFFICE Bekijken" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "Formulier invullen in ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE Bekijk pagina" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "ONLYOFFICE kan dit bestand niet openen." + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "Hiermee wordt de add-on ONLYOFFICE-connector verwijderd." + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (verwijdering)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "Geheime sleutel (leeg laten om uit te schakelen)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "Aanmaken in ONLYOFFICE" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "Tekst" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "Spreadsheet" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "Presentatie" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "Formulier sjabloon" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "Bestand opslaan als" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "Laat het veld leeg om op te slaan in de hoofdmap van de site" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "Het bestand is succesvol opgeslagen als" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "U bent niet gemachtigd om materiaal aan deze map toe te voegen" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "Onbekende fout bij het opslaan van bestand de site" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "Niet ondersteunde versie DocumentServer." + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "Update ONLYOFFICE Docs naar versie 7.0 om online invulbare formulieren te kunnen gebruiken." + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "Verplichte waarde mist." + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "ONLYOFFICE kan niet worden bereikt" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "Autorisatie fout" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "Fout bij de controle van CommandService" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "Fout bij de controle van ConvertService" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "Gemende Actieve Inhoud is niet toegestaan. HTTPS-adres voor ONLYOFFICE Docs is vereist." + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "Verbinding maken met demo ONLYOFFICE documentserver" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "Dit is een openbare testserver, gelieve deze niet te gebruiken voor persoonlijke en vertrouwelijke gegevens. De server zal gedurende een periode van 30 dagen beschikbaar zijn." + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "De 30-dagen proefperiode is voorbij, u kunt niet langer verbinding maken met demo ONLYOFFICE Document server." + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "Fout bij verbinding met demoserver (${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "U gebruikt de openbare demo ONLYOFFICE Document server. Sla geen vertrouwelijke gegevens op." + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "Conversie in ONLYOFFICE" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "U kunt uw document converteren in het formaat OOXML" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "Huidig type:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "Gewenst type:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "Omzetten" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "Item geconverteerd" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress." +msgstr "Conversie van ${currentType} naar ${targetType} bezig." + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "Het converteren is voltooid" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "Document conversiedienst gaf foutmelding (${error})" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "Onbekende fout" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "Conversie time-out fout" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "Conversiefout" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "Fout bij de toegang tot de database met conversieresultaten" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "Onjuist wachtwoord" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "Fout bij de toegang tot de database met conversieresultaten" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "Invoerfout" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "Ongeldig token" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "Ongedefinieerde foutcode" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "Document conversiedienst heeft status ${status_code} teruggestuurd" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "Document conversiedienst kan niet worden bereikt" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "Kies het bestandstype dat u wilt downloaden" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "Downloaden als" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "Downloaden" diff --git a/src/onlyoffice/plone/locales/pt/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/pt/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..f7cacae --- /dev/null +++ b/src/onlyoffice/plone/locales/pt/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-10-10 14:07+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "Serviço de edição de documentos" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "Instala o complemento do conector do ONLYOFFICE" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "Configuração do ONLYOFFICE" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "ONLYOFFICE Editar" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "ONLYOFFICE Ver" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "Preencher formulário no ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE Ver página" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "O ONLYOFFICE não pode abrir este arquivo" + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "Desinstala o complemento do conector do ONLYOFFICE" + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (desinstalar)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "Chave secreta (deixe em branco para desativar)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "Endereço do servidor para solicitações internas do Serviço de Edição de Documentos" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "Endereço do serviço de edição de documentos para solicitações internas do servidor" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "Criar no ONLYOFFICE" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "Documento" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "Planilha" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "Apresentação" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "Modelo de formulário" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "Salvar cópia de arquivo como" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "Deixe o campo em branco para salvar na raiz do site" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "O arquivo foi salvo com sucesso como" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "Você não está autorizado a adicionar conteúdo a esta pasta" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "Erro desconhecido ao salvar o documento" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "Versão não suportada Servidor de documentos." + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "Atualize o ONLYOFFICE Docs para a versão 7.0 para trabalhar em formulários preenchíveis online" + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "Falta informação obrigatória." + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "ONLYOFFICE não pode ser alcançado" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "Erro de autorização" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "Erro ao tentar verificar o serviço de comando" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "Erro ao tentar verificar o serviço de conversão" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "Conteúdo Misto não é permitido. É necessário um endereço HTTPS para o ONLYOFFICE Docs." + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "Conecte-se ao servidor de documentos do ONLYOFFICE de demonstração" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "Este é um servidor de teste público, não o use para dados confidenciais. O servidor estará disponível por um período de 30 dias." + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "O período de teste de 30 dias acabou, você não pode mais se conectar ao Servidor do documento ONLYOFFICE de demonstração" + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "Erro ao conectar ao servidor de demonstração (${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "Você está usando o Servidor do documento ONLYOFFICE de demonstração pública. Não armazene dados confidenciais." + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "Conversão no ONLYOFFICE" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "Você pode converter seu documento no formato OOXML" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "Tipo atual:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "Tipo de alvo:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "Converter" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "Item convertido" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress." +msgstr "Convertendo ${currentType} para ${targetType} em andamento." + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "A conversão está concluída" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "O serviço de conversão de documentos retornou um erro (${error})" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "Erro desconhecido" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "Erro de tempo limite de conversão" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "Erro de conversão" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "Erro ao baixar o arquivo do documento a ser convertido" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "Senha incorreta" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "Erro ao acessar o banco de dados de resultados de conversão" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "Erro de entrada" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "Token inválido" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "Código de erro indefinido" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "O serviço de conversão de documentos retornou o status ${status_code}" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "O serviço de conversão de documentos não pode ser alcançado" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "Selecione o tipo de arquivo que deseja baixar" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "Baixar como" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "Baixar" diff --git a/src/onlyoffice/plone/locales/ru/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/ru/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..cd6b62f --- /dev/null +++ b/src/onlyoffice/plone/locales/ru/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-10-07 19:00+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "Адрес Document Server" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "Установка коннектора ONLYOFFICE" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "Настройка ONLYOFFICE" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "Редактирование файла в ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "Просмотр файла в ONLYOFFICE" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "Заполнить форму в ONLYOFFICE" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE (Страница просмотра файла)" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "Невозможно открыть этот файл с помощью ONLYOFFICE" + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "Удаление коннектора ONLYOFFICE." + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (удаление)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "Секретный ключ (оставьте пустым для отключения)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "Адрес сервера для внутренних запросов службы редактирования документов" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "Адрес службы редактирования документов для внутренних запросов сервера" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "Создать в ONLYOFFICE" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "Документ" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "Таблица" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "Презентация" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "Шаблон формы" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "Сохранить копию файла как" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr "Оставьте поле пустым, чтобы сохранить в корень сайта" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "Файл был успешно сохранен как " + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "У вас нет прав на добавление содержимого в эту папку" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "Неизвестная ошибка при сохранении файла" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "Неподдерживаемая версия Сервера документов." + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "Обновите сервер документов ONLYOFFICE до версии 7.0, чтобы работать с заполняемыми формами." + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "Отсутствуют требуемые входные данные" + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "Приложение ONLYOFFICE недоступно" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "Ошибка авторизации" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "Ошибка во время проверки CommandService" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "Ошибка во время проверки ConvertService" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "Смешанное активное содержимое запрещено. Для Сервера документов необходимо использовать HTTPS-адрес." + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "Подключиться к демонстрационному Серверу Документов ONLYOFFICE" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "Это публичный тестовый сервер, пожалуйста, не используйте его для личных конфиденциальных данных. Сервер будет доступен в течение 30 дней." + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "30-дневный тестовый период закончен, вы больше не можете подключаться к демонстрационному Серверу Документов ONLYOFFICE" + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "Ошибка подключения к демонстрационному серверу (${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "Вы используете публичный демонстрационный Сервер документов ONLYOFFICE. Пожалуйста, не храните конфиденциальные данные." + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "Конвертация в ONLYOFFICE" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "Вы можете преобразовать документ в формат OOXML" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "Текущий тип:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "Целевой тип:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "Конвертировать" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "Элемент преобразован" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress.." +msgstr "Выполняется преобразование ${currentType} в ${targetType}" + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "Преобразование завершено" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "Служба преобразования документов вернула ошибку (${error})" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "Неизвестная ошибка" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "Ошибка тайм-аута конвертации" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "Ошибка преобразования" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "Ошибка при загрузке файла документа для преобразования" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "Неверный пароль" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "Ошибка при доступе к базе данных результатов конвертации" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "Ошибка ввода" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "Неверный токен" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "Неопределенный код ошибки" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "Служба преобразования документов вернула статус ${status_code}" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "Служба преобразования документов недоступна" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "Выберите тип файла, который вы хотите скачать" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "Скачать как" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "Скачать" diff --git a/src/onlyoffice/connector/locales/update.py b/src/onlyoffice/plone/locales/update.py similarity index 95% rename from src/onlyoffice/connector/locales/update.py rename to src/onlyoffice/plone/locales/update.py index 60cd9fa..e2db31a 100644 --- a/src/onlyoffice/connector/locales/update.py +++ b/src/onlyoffice/plone/locales/update.py @@ -5,10 +5,10 @@ import subprocess -domain = 'onlyoffice.connector' +domain = 'onlyoffice.plone' os.chdir(pkg_resources.resource_filename(domain, '')) os.chdir('../../../') -target_path = 'src/onlyoffice/connector/' +target_path = 'src/onlyoffice/plone/' locale_path = target_path + 'locales/' i18ndude = './bin/i18ndude' diff --git a/src/onlyoffice/connector/locales/update.sh b/src/onlyoffice/plone/locales/update.sh similarity index 73% rename from src/onlyoffice/connector/locales/update.sh rename to src/onlyoffice/plone/locales/update.sh index f84f278..a3653a5 100644 --- a/src/onlyoffice/connector/locales/update.sh +++ b/src/onlyoffice/plone/locales/update.sh @@ -3,10 +3,10 @@ # ``export PATH=$PATH:$BUILDOUT_DIR/bin`` when i18ndude is located in your buildout's bin directory) # # For every language you want to translate into you need a -# locales/[language]/LC_MESSAGES/onlyoffice.connector.po -# (e.g. locales/de/LC_MESSAGES/onlyoffice.connector.po) +# locales/[language]/LC_MESSAGES/onlyoffice.plone.po +# (e.g. locales/de/LC_MESSAGES/onlyoffice.plone.po) -domain=onlyoffice.connector +domain=onlyoffice.plone ../../../../bin/i18ndude rebuild-pot --pot $domain.pot --create $domain ../ ../../../../bin/i18ndude sync --pot $domain.pot */LC_MESSAGES/$domain.po diff --git a/src/onlyoffice/plone/locales/zh/LC_MESSAGES/onlyoffice.plone.po b/src/onlyoffice/plone/locales/zh/LC_MESSAGES/onlyoffice.plone.po new file mode 100644 index 0000000..3cc012f --- /dev/null +++ b/src/onlyoffice/plone/locales/zh/LC_MESSAGES/onlyoffice.plone.po @@ -0,0 +1,257 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2020-02-14 10:33+0000\n" +"PO-Revision-Date: 2022-10-10 14:08+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: zh\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"Language-Code: en\n" +"Language-Name: English\n" +"Preferred-Encodings: utf-8 latin1\n" +"Domain: DOMAIN\n" +"X-Generator: Poedit 3.1.1\n" + +#: ../browser/controlpanel.py:12 +msgid "Document Editing service" +msgstr "文档编辑服务" + +#: ../configure.zcml:28 +msgid "Installs the ONLYOFFICE connector add-on." +msgstr "安装ONLYOFFICE连接器附加组件" + +#: ../browser/controlpanel.py:21 +msgid "ONLYOFFICE Configuration" +msgstr "ONLYOFFICE配置" + +#: ../profiles/default/types/File.xml +msgid "ONLYOFFICE Edit" +msgstr "ONLYOFFICE 编辑" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View" +msgstr "ONLYOFFICE视图" + +#: ../browser/configure.zcml +msgid "Fill in form in ONLYOFFICE" +msgstr "在ONLYOFFICE上填写表单" + +#: ../browser/configure.zcml:52 +msgid "ONLYOFFICE View page" +msgstr "ONLYOFFICE视图页" + +#: ../browser/templates/error.pt:10 +msgid "ONLYOFFICE can't open this file." +msgstr "ONLYOFFICE无法打开该文件" + +#: ../configure.zcml:37 +msgid "Uninstalls the ONLYOFFICE connector add-on." +msgstr "卸载ONLYOFFICE连接器附加组件" + +#: ../configure.zcml:28 +msgid "onlyoffice.plone" +msgstr "onlyoffice.plone" + +#: ../configure.zcml:37 +msgid "onlyoffice.plone (uninstall)" +msgstr "onlyoffice.plone (卸载)" + +#: ../browser/controlpanel.py:34 +msgid "Secret key (leave blank to disable)" +msgstr "秘钥(留空为关闭)" + +#: ../browser/controlpanel.py:34 +msgid "Server address for internal requests from the Document Editing Service" +msgstr "来自文档编辑服务用于内部请求的服务器地址" + +#: ../browser/controlpanel.py:34 +msgid "Document Editing Service address for internal requests from the server" +msgstr "来自服务器用于内部请求的文档编辑服务" + +#: ../browser/menu.py +msgid "Create in ONLYOFFICE" +msgstr "在ONLYOFFICE中创建" + +#: ../core/fileUtils.py +msgid "Document" +msgstr "文档" + +#: ../core/fileUtils.py +msgid "Spreadsheet" +msgstr "电子表格" + +#: ../core/fileUtils.py +msgid "Presentation" +msgstr "演示文稿" + +#: ../core/fileUtils.py +msgid "Form template" +msgstr "表单模板" + +#: ../browser/api.py +msgid "Save file copy as" +msgstr "文件副本另存为" + +#: ../browser/api.py +msgid "Leave the field blank to save to the root of the site" +msgstr " 请将该字段留空以保存到网站根目录下" + +#: ../browser/api.py +msgid "The file was successfully saved as " +msgstr "文档已另存为" + +#: ../browser/api.py +msgid "You are not authorized to add content to this folder" +msgstr "您无权将内容添加到此文件夹中" + +#: ../browser/api.py +msgid "Unknown error while saving file" +msgstr "保存文件时出现未知错误" + +#: ../browser/templates/view.pt +msgid "Not supported version DocumentServer." +msgstr "不支持的DocumentServer 版本" + +#: ../browser/templates/view.pt +msgid "Please update ONLYOFFICE Docs to version 7.0 to work on fillable forms online." +msgstr "请将ONLYOFFICE Docs更新到7.0版本,以便在线编辑可填写的表单" + +#: ../browser/templates/view.pt +msgid "Required input is missing." +msgstr "缺失所需输入内容" + +#: ../browser/controlpanel.py +msgid "ONLYOFFICE cannot be reached" +msgstr "ONLYOFFICE服务器无法连接" + +#: ../browser/controlpanel.py +msgid "Authorization error" +msgstr "授权错误" + +#: ../browser/controlpanel.py +msgid "Error when trying to check CommandService" +msgstr "在尝试检查CommandService时出错" + +#: ../browser/controlpanel.py +msgid "Error when trying to check ConvertService" +msgstr "在尝试检查ConvertService时出错" + +#: ../browser/controlpanel.py +msgid "Mixed Active Content is not allowed. HTTPS address for Document Server is required." +msgstr "不允许混合活动内容,请使用HTTPS连接Document Server" + +#: ../browser/controlpanel.py +msgid "Connect to demo ONLYOFFICE Document Server" +msgstr "连接到演示ONLYOFFICE文件服务器" + +#: ../browser/controlpanel.py +msgid "This is a public test server, please do not use it for private sensitive data. The server will be available during a 30-day period." +msgstr "这是公开的测试服务器,请勿用于隐私数据。服务器试用期限为30天。" + +#: ../browser/static/js/controlpanel.js +msgid "The 30-day test period is over, you can no longer connect to demo ONLYOFFICE Document Server." +msgstr "30天试用期已结束,无法连接演示ONLYOFFICE 文档服务器。" + +#: ../browser/controlpanel.py +msgid "Error connecting to demo server (${error})" +msgstr "连接到演示服务器出错(${error})" + +#: ../browser/actions.py +msgid "You are using public demo ONLYOFFICE Document Server. Please do not store private sensitive data." +msgstr "您正在使用公开的演示ONLYOFFICE 文档服务器,请勿存储隐私数据" + +#: ../browser/api.py +msgid "Conversion in ONLYOFFICE" +msgstr "在ONLYOFFICE中进行转换" + +#: ../browser/api.py +msgid "You can convert you document in format OOXML" +msgstr "您可以将您的文件转换为OOXML格式" + +#: ../browser/interfaces.py +msgid "Current type:" +msgstr "目前类型:" + +#: ../browser/interfaces.py +msgid "Target type:" +msgstr "目标类型:" + +#: ../browser/apy.py +msgid "Convert" +msgstr "转换" + +#: ../browser/static/js/convert.js +msgid "Item converted" +msgstr "项目已转换" + +#: ../browser/static/js/convert.js +msgid "Converting ${currentType} to ${targetType} in progress.." +msgstr "正在将${currentType}转换为${targetType}" + +#: ../browser/static/js/convert.js +msgid "Converting is finished" +msgstr "转换完成" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned error (${error})" +msgstr "文件转换服务返回(${error})错误" + +#: ../core/conversionUtils.py +msgid "Unknown error" +msgstr "未知错误" + +#: ../core/conversionUtils.py +msgid "Conversion timeout error" +msgstr "转换超时错误" + +#: ../core/conversionUtils.py +msgid "Conversion error" +msgstr "转换错误" + +#: ../core/conversionUtils.py +msgid "Error while downloading the document file to be converted" +msgstr "下载要转换的文件时出错" + +#: ../core/conversionUtils.py +msgid "Incorrect password" +msgstr "密码不正确" + +#: ../core/conversionUtils.py +msgid "Error while accessing the conversion result database" +msgstr "访问转换结果数据库时出错" + +#: ../core/conversionUtils.py +msgid "Input error" +msgstr "输入错误" + +#: ../core/conversionUtils.py +msgid "Invalid token" +msgstr "令牌无效" + +#: ../core/conversionUtils.py +msgid "Undefined error code" +msgstr "未定义的错误代码" + +#: ../core/conversionUtils.py +msgid "Document conversion service returned status ${status_code}" +msgstr "文件转换服务返回 ${status_code} 状态" + +#: ../core/conversionUtils.py +msgid "Document conversion service cannot be reached" +msgstr "无法链接到文件转换服务" + +#: ../browser/interfaces.py +msgid "Select file type you want to download" +msgstr "选择需要下载的文件类型" + +#: ../browser/interfaces.py +msgid "Download as" +msgstr "下载为" + +#: ../browser/interfaces.py +msgid "Download" +msgstr "下载" diff --git a/src/onlyoffice/connector/permissions.zcml b/src/onlyoffice/plone/permissions.zcml similarity index 100% rename from src/onlyoffice/connector/permissions.zcml rename to src/onlyoffice/plone/permissions.zcml diff --git a/src/onlyoffice/plone/profiles/default/actions.xml b/src/onlyoffice/plone/profiles/default/actions.xml new file mode 100644 index 0000000..614be6b --- /dev/null +++ b/src/onlyoffice/plone/profiles/default/actions.xml @@ -0,0 +1,34 @@ + + + + + Download as + + string:$object_url/onlyoffice-download-as-file + + object/@@onlyoffice-download-as-file/isAvailable|nothing + + + + True + {"width": "300"} + + + Download as + + string:$object_url/onlyoffice-download-as-document + + object/@@onlyoffice-download-as-document/isAvailable|nothing + + + + True + {"width": "300"} + + + \ No newline at end of file diff --git a/src/onlyoffice/plone/profiles/default/browserlayer.xml b/src/onlyoffice/plone/profiles/default/browserlayer.xml new file mode 100644 index 0000000..76f7b5a --- /dev/null +++ b/src/onlyoffice/plone/profiles/default/browserlayer.xml @@ -0,0 +1,7 @@ + + + + diff --git a/src/onlyoffice/connector/profiles/default/catalog.xml b/src/onlyoffice/plone/profiles/default/catalog.xml similarity index 100% rename from src/onlyoffice/connector/profiles/default/catalog.xml rename to src/onlyoffice/plone/profiles/default/catalog.xml diff --git a/src/onlyoffice/connector/profiles/default/controlpanel.xml b/src/onlyoffice/plone/profiles/default/controlpanel.xml similarity index 100% rename from src/onlyoffice/connector/profiles/default/controlpanel.xml rename to src/onlyoffice/plone/profiles/default/controlpanel.xml diff --git a/src/onlyoffice/connector/profiles/default/metadata.xml b/src/onlyoffice/plone/profiles/default/metadata.xml similarity index 86% rename from src/onlyoffice/connector/profiles/default/metadata.xml rename to src/onlyoffice/plone/profiles/default/metadata.xml index 2c01a41..d066f7b 100644 --- a/src/onlyoffice/connector/profiles/default/metadata.xml +++ b/src/onlyoffice/plone/profiles/default/metadata.xml @@ -1,6 +1,6 @@ - 2110 + 3000 diff --git a/src/onlyoffice/connector/profiles/default/registry.xml b/src/onlyoffice/plone/profiles/default/registry.xml similarity index 77% rename from src/onlyoffice/connector/profiles/default/registry.xml rename to src/onlyoffice/plone/profiles/default/registry.xml index a39ec97..3201f83 100644 --- a/src/onlyoffice/connector/profiles/default/registry.xml +++ b/src/onlyoffice/plone/profiles/default/registry.xml @@ -1,11 +1,11 @@ + i18n:domain="onlyoffice.plone"> - + + + + + + + + + + \ No newline at end of file diff --git a/src/onlyoffice/connector/profiles/default/types/File.xml b/src/onlyoffice/plone/profiles/default/types/File.xml similarity index 64% rename from src/onlyoffice/connector/profiles/default/types/File.xml rename to src/onlyoffice/plone/profiles/default/types/File.xml index bafe7e9..1323d89 100644 --- a/src/onlyoffice/connector/profiles/default/types/File.xml +++ b/src/onlyoffice/plone/profiles/default/types/File.xml @@ -3,14 +3,14 @@ meta_type="Factory-based Type Information with dynamic views" i18n:domain="plone" xmlns:i18n="http://xml.zope.org/namespaces/i18n"> - + + + + + \ No newline at end of file diff --git a/src/onlyoffice/plone/profiles/uninstall/actions.xml b/src/onlyoffice/plone/profiles/uninstall/actions.xml new file mode 100644 index 0000000..cbc97a6 --- /dev/null +++ b/src/onlyoffice/plone/profiles/uninstall/actions.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/src/onlyoffice/connector/profiles/uninstall/browserlayer.xml b/src/onlyoffice/plone/profiles/uninstall/browserlayer.xml similarity index 73% rename from src/onlyoffice/connector/profiles/uninstall/browserlayer.xml rename to src/onlyoffice/plone/profiles/uninstall/browserlayer.xml index 9e27ff9..74dfeaf 100644 --- a/src/onlyoffice/connector/profiles/uninstall/browserlayer.xml +++ b/src/onlyoffice/plone/profiles/uninstall/browserlayer.xml @@ -1,7 +1,7 @@ diff --git a/src/onlyoffice/connector/profiles/uninstall/controlpanel.xml b/src/onlyoffice/plone/profiles/uninstall/controlpanel.xml similarity index 100% rename from src/onlyoffice/connector/profiles/uninstall/controlpanel.xml rename to src/onlyoffice/plone/profiles/uninstall/controlpanel.xml diff --git a/src/onlyoffice/connector/profiles/uninstall/registry.xml b/src/onlyoffice/plone/profiles/uninstall/registry.xml similarity index 84% rename from src/onlyoffice/connector/profiles/uninstall/registry.xml rename to src/onlyoffice/plone/profiles/uninstall/registry.xml index 20366de..6d5a4e3 100644 --- a/src/onlyoffice/connector/profiles/uninstall/registry.xml +++ b/src/onlyoffice/plone/profiles/uninstall/registry.xml @@ -1,7 +1,7 @@ + i18n:domain="onlyoffice.plone"> diff --git a/src/onlyoffice/plone/profiles/uninstall/types/Document.xml b/src/onlyoffice/plone/profiles/uninstall/types/Document.xml new file mode 100644 index 0000000..4c70773 --- /dev/null +++ b/src/onlyoffice/plone/profiles/uninstall/types/Document.xml @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/onlyoffice/connector/profiles/uninstall/types/File.xml b/src/onlyoffice/plone/profiles/uninstall/types/File.xml similarity index 72% rename from src/onlyoffice/connector/profiles/uninstall/types/File.xml rename to src/onlyoffice/plone/profiles/uninstall/types/File.xml index b2c7a39..13eb413 100644 --- a/src/onlyoffice/connector/profiles/uninstall/types/File.xml +++ b/src/onlyoffice/plone/profiles/uninstall/types/File.xml @@ -3,7 +3,7 @@ meta_type="Factory-based Type Information with dynamic views" i18n:domain="plone" xmlns:i18n="http://xml.zope.org/namespaces/i18n"> - + + + + \ No newline at end of file diff --git a/src/onlyoffice/connector/profiles/upgrades/to_2/registry.xml b/src/onlyoffice/plone/profiles/upgrades/to_2/registry.xml similarity index 51% rename from src/onlyoffice/connector/profiles/upgrades/to_2/registry.xml rename to src/onlyoffice/plone/profiles/upgrades/to_2/registry.xml index ef90ebd..b4104cd 100644 --- a/src/onlyoffice/connector/profiles/upgrades/to_2/registry.xml +++ b/src/onlyoffice/plone/profiles/upgrades/to_2/registry.xml @@ -1,7 +1,7 @@ - + \ No newline at end of file diff --git a/src/onlyoffice/connector/setuphandlers.py b/src/onlyoffice/plone/setuphandlers.py similarity index 92% rename from src/onlyoffice/connector/setuphandlers.py rename to src/onlyoffice/plone/setuphandlers.py index a71826c..b140d2d 100644 --- a/src/onlyoffice/connector/setuphandlers.py +++ b/src/onlyoffice/plone/setuphandlers.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2021 +# (c) Copyright Ascensio System SIA 2022 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ class HiddenProfiles(object): def getNonInstallableProfiles(self): """Hide uninstall profile from site-creation and quickinstaller.""" return [ - 'onlyoffice.connector:uninstall', + 'onlyoffice.plone:uninstall', ] diff --git a/src/onlyoffice/connector/testing.py b/src/onlyoffice/plone/testing.py similarity index 64% rename from src/onlyoffice/connector/testing.py rename to src/onlyoffice/plone/testing.py index 0c4c77d..90972c6 100644 --- a/src/onlyoffice/connector/testing.py +++ b/src/onlyoffice/plone/testing.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2021 +# (c) Copyright Ascensio System SIA 2022 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -23,10 +23,10 @@ from plone.app.testing import PloneSandboxLayer from plone.testing import z2 -import onlyoffice.connector +import onlyoffice.plone -class OnlyofficeConnectorLayer(PloneSandboxLayer): +class OnlyofficePloneLayer(PloneSandboxLayer): defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE,) @@ -36,32 +36,32 @@ def setUpZope(self, app, configurationContext): # layer. import plone.restapi self.loadZCML(package=plone.restapi) - self.loadZCML(package=onlyoffice.connector) + self.loadZCML(package=onlyoffice.plone) def setUpPloneSite(self, portal): - applyProfile(portal, 'onlyoffice.connector:default') + applyProfile(portal, 'onlyoffice.plone:default') -ONLYOFFICE_CONNECTOR_FIXTURE = OnlyofficeConnectorLayer() +ONLYOFFICE_PLONE_FIXTURE = OnlyofficePloneLayer() -ONLYOFFICE_CONNECTOR_INTEGRATION_TESTING = IntegrationTesting( - bases=(ONLYOFFICE_CONNECTOR_FIXTURE,), - name='OnlyofficeConnectorLayer:IntegrationTesting', +ONLYOFFICE_PLONE_INTEGRATION_TESTING = IntegrationTesting( + bases=(ONLYOFFICE_PLONE_FIXTURE,), + name='OnlyofficePloneLayer:IntegrationTesting', ) -ONLYOFFICE_CONNECTOR_FUNCTIONAL_TESTING = FunctionalTesting( - bases=(ONLYOFFICE_CONNECTOR_FIXTURE,), - name='OnlyofficeConnectorLayer:FunctionalTesting', +ONLYOFFICE_PLONE_FUNCTIONAL_TESTING = FunctionalTesting( + bases=(ONLYOFFICE_PLONE_FIXTURE,), + name='OnlyofficePloneLayer:FunctionalTesting', ) -ONLYOFFICE_CONNECTOR_ACCEPTANCE_TESTING = FunctionalTesting( +ONLYOFFICE_PLONE_ACCEPTANCE_TESTING = FunctionalTesting( bases=( - ONLYOFFICE_CONNECTOR_FIXTURE, + ONLYOFFICE_PLONE_FIXTURE, REMOTE_LIBRARY_BUNDLE_FIXTURE, z2.ZSERVER_FIXTURE, ), - name='OnlyofficeConnectorLayer:AcceptanceTesting', + name='OnlyofficePloneLayer:AcceptanceTesting', ) diff --git a/src/onlyoffice/connector/tests/__init__.py b/src/onlyoffice/plone/tests/__init__.py similarity index 100% rename from src/onlyoffice/connector/tests/__init__.py rename to src/onlyoffice/plone/tests/__init__.py diff --git a/src/onlyoffice/connector/tests/robot/test_example.robot b/src/onlyoffice/plone/tests/robot/test_example.robot similarity index 87% rename from src/onlyoffice/connector/tests/robot/test_example.robot rename to src/onlyoffice/plone/tests/robot/test_example.robot index 6ff2524..2209bdb 100644 --- a/src/onlyoffice/connector/tests/robot/test_example.robot +++ b/src/onlyoffice/plone/tests/robot/test_example.robot @@ -4,17 +4,17 @@ # # Run this robot test stand-alone: # -# $ bin/test -s onlyoffice.connector -t test_example.robot --all +# $ bin/test -s onlyoffice.plone -t test_example.robot --all # # Run this robot test with robot server (which is faster): # # 1) Start robot server: # -# $ bin/robot-server --reload-path src onlyoffice.connector.testing.ONLYOFFICE_CONNECTOR_ACCEPTANCE_TESTING +# $ bin/robot-server --reload-path src onlyoffice.plone.testing.ONLYOFFICE_PLONE_ACCEPTANCE_TESTING # # 2) Run robot tests: # -# $ bin/robot src/onlyoffice/connector/tests/robot/test_example.robot +# $ bin/robot src/onlyoffice/plone/tests/robot/test_example.robot # # See the http://docs.plone.org for further details (search for robot # framework). diff --git a/src/onlyoffice/connector/tests/test_robot.py b/src/onlyoffice/plone/tests/test_robot.py similarity index 86% rename from src/onlyoffice/connector/tests/test_robot.py rename to src/onlyoffice/plone/tests/test_robot.py index 095e604..af6f3f6 100644 --- a/src/onlyoffice/connector/tests/test_robot.py +++ b/src/onlyoffice/plone/tests/test_robot.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2021 +# (c) Copyright Ascensio System SIA 2022 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ # # -*- coding: utf-8 -*- -from onlyoffice.connector.testing import ONLYOFFICE_CONNECTOR_ACCEPTANCE_TESTING # noqa: E501 +from onlyoffice.plone.testing import ONLYOFFICE_PLONE_ACCEPTANCE_TESTING # noqa: E501 from plone.app.testing import ROBOT_TEST_LEVEL from plone.testing import layered @@ -38,7 +38,7 @@ def test_suite(): suite.addTests([ layered( robottestsuite, - layer=ONLYOFFICE_CONNECTOR_ACCEPTANCE_TESTING, + layer=ONLYOFFICE_PLONE_ACCEPTANCE_TESTING, ), ]) return suite diff --git a/src/onlyoffice/connector/tests/test_setup.py b/src/onlyoffice/plone/tests/test_setup.py similarity index 69% rename from src/onlyoffice/connector/tests/test_setup.py rename to src/onlyoffice/plone/tests/test_setup.py index bd2c983..93e7603 100644 --- a/src/onlyoffice/connector/tests/test_setup.py +++ b/src/onlyoffice/plone/tests/test_setup.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2021 +# (c) Copyright Ascensio System SIA 2022 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ # -*- coding: utf-8 -*- """Setup tests for this package.""" -from onlyoffice.connector.testing import ONLYOFFICE_CONNECTOR_INTEGRATION_TESTING # noqa: E501 +from onlyoffice.plone.testing import ONLYOFFICE_PLONE_INTEGRATION_TESTING # noqa: E501 from plone import api from plone.app.testing import setRoles from plone.app.testing import TEST_USER_ID @@ -31,9 +31,9 @@ class TestSetup(unittest.TestCase): - """Test that onlyoffice.connector is properly installed.""" + """Test that onlyoffice.plone is properly installed.""" - layer = ONLYOFFICE_CONNECTOR_INTEGRATION_TESTING + layer = ONLYOFFICE_PLONE_INTEGRATION_TESTING def setUp(self): """Custom shared utility setup for tests.""" @@ -44,23 +44,23 @@ def setUp(self): self.installer = api.portal.get_tool('portal_quickinstaller') def test_product_installed(self): - """Test if onlyoffice.connector is installed.""" + """Test if onlyoffice.plone is installed.""" self.assertTrue(self.installer.isProductInstalled( - 'onlyoffice.connector')) + 'onlyoffice.plone')) def test_browserlayer(self): - """Test that IOnlyofficeConnectorLayer is registered.""" - from onlyoffice.connector.interfaces import ( - IOnlyofficeConnectorLayer) + """Test that IOnlyofficePloneLayer is registered.""" + from onlyoffice.plone.interfaces import ( + IOnlyofficePloneLayer) from plone.browserlayer import utils self.assertIn( - IOnlyofficeConnectorLayer, + IOnlyofficePloneLayer, utils.registered_layers()) class TestUninstall(unittest.TestCase): - layer = ONLYOFFICE_CONNECTOR_INTEGRATION_TESTING + layer = ONLYOFFICE_PLONE_INTEGRATION_TESTING def setUp(self): self.portal = self.layer['portal'] @@ -70,19 +70,19 @@ def setUp(self): self.installer = api.portal.get_tool('portal_quickinstaller') roles_before = api.user.get_roles(TEST_USER_ID) setRoles(self.portal, TEST_USER_ID, ['Manager']) - self.installer.uninstallProducts(['onlyoffice.connector']) + self.installer.uninstallProducts(['onlyoffice.plone']) setRoles(self.portal, TEST_USER_ID, roles_before) def test_product_uninstalled(self): - """Test if onlyoffice.connector is cleanly uninstalled.""" + """Test if onlyoffice.plone is cleanly uninstalled.""" self.assertFalse(self.installer.isProductInstalled( - 'onlyoffice.connector')) + 'onlyoffice.plone')) def test_browserlayer_removed(self): - """Test that IOnlyofficeConnectorLayer is removed.""" - from onlyoffice.connector.interfaces import \ - IOnlyofficeConnectorLayer + """Test that IOnlyofficePloneLayer is removed.""" + from onlyoffice.plone.interfaces import \ + IOnlyofficePloneLayer from plone.browserlayer import utils self.assertNotIn( - IOnlyofficeConnectorLayer, + IOnlyofficePloneLayer, utils.registered_layers()) diff --git a/src/onlyoffice/connector/upgrades.py b/src/onlyoffice/plone/upgrades.py similarity index 89% rename from src/onlyoffice/connector/upgrades.py rename to src/onlyoffice/plone/upgrades.py index 46ad97b..a6b2461 100644 --- a/src/onlyoffice/connector/upgrades.py +++ b/src/onlyoffice/plone/upgrades.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2021 +# (c) Copyright Ascensio System SIA 2022 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ # limitations under the License. # -PROFILE_ID = 'onlyoffice.connector:default' +PROFILE_ID = 'onlyoffice.plone:default' def upgrade_to_2(context): context.runImportStepFromProfile( diff --git a/src/onlyoffice/connector/upgrades.zcml b/src/onlyoffice/plone/upgrades.zcml similarity index 78% rename from src/onlyoffice/connector/upgrades.zcml rename to src/onlyoffice/plone/upgrades.zcml index 094ade2..c0c363e 100644 --- a/src/onlyoffice/connector/upgrades.zcml +++ b/src/onlyoffice/plone/upgrades.zcml @@ -1,7 +1,7 @@ + i18n_domain="onlyoffice.plone"> \ No newline at end of file