From 6f13cefc04ece937c33f1c91d861bbba1a9674ad Mon Sep 17 00:00:00 2001 From: Andrey Panov Date: Fri, 14 Feb 2020 17:56:48 +0300 Subject: [PATCH 01/31] build scripts --- LICENSE.txt | 625 ++++++++++++++++++++++++++++++++++++++++ base.cfg | 107 +++++++ buildout.cfg | 9 + constraints_plone52.txt | 3 + requirements.txt | 3 + setup.cfg | 19 ++ setup.py | 73 +++++ test_plone52.cfg | 11 + 8 files changed, 850 insertions(+) create mode 100644 LICENSE.txt create mode 100644 base.cfg create mode 100644 buildout.cfg create mode 100644 constraints_plone52.txt create mode 100644 requirements.txt create mode 100644 setup.cfg create mode 100644 setup.py create mode 100644 test_plone52.cfg diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..7d10a1f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,625 @@ +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations, which became +Zope Corporation. In 2001, the Python Software Foundation (PSF, see +https://www.python.org/psf/) was formed, a non-profit organization +created specifically to own Python-related Intellectual Property. +Zope Corporation was a sponsoring member of the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2 and above 2.1.1 2001-now PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF hereby +grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, +analyze, test, perform and/or display publicly, prepare derivative works, +distribute, and otherwise use Python alone or in any derivative version, +provided, however, that PSF's License Agreement and PSF's notice of copyright, +i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative version +prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + + +Additional Conditions for this Windows binary build +--------------------------------------------------- + +This program is linked with and uses Microsoft Distributable Code, +copyrighted by Microsoft Corporation. The Microsoft Distributable Code +is embedded in each .exe, .dll and .pyd file as a result of running +the code through a linker. + +If you further distribute programs that include the Microsoft +Distributable Code, you must comply with the restrictions on +distribution specified by Microsoft. In particular, you must require +distributors and external end users to agree to terms that protect the +Microsoft Distributable Code at least as much as Microsoft's own +requirements for the Distributable Code. See Microsoft's documentation +(included in its developer tools and on its website at microsoft.com) +for specific details. + +Redistribution of the Windows binary build of the Python interpreter +complies with this agreement, provided that you do not: + +- alter any copyright, trademark or patent notice in Microsoft's +Distributable Code; + +- use Microsoft's trademarks in your programs' names or in a way that +suggests your programs come from or are endorsed by Microsoft; + +- distribute Microsoft's Distributable Code to run on a platform other +than Microsoft operating systems, run-time technologies or application +platforms; or + +- include Microsoft Distributable Code in malicious, deceptive or +unlawful programs. + +These restrictions apply only to the Microsoft Distributable Code as +defined above, not to Python itself or any programs running on the +Python interpreter. The redistribution of the Python interpreter and +libraries is governed by the Python Software License included with this +file, or by other licenses as marked. + + + +-------------------------------------------------------------------------- + +This program, "bzip2", the associated library "libbzip2", and all +documentation, are copyright (C) 1996-2010 Julian R Seward. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Julian Seward, jseward@bzip.org +bzip2/libbzip2 version 1.0.6 of 6 September 2010 + +-------------------------------------------------------------------------- + + + LICENSE ISSUES + ============== + + The OpenSSL toolkit stays under a double license, i.e. both the conditions of + the OpenSSL License and the original SSLeay license apply to the toolkit. + See below for the actual license texts. + + OpenSSL License + --------------- + +/* ==================================================================== + * Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ + + Original SSLeay License + ----------------------- + +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + + +libffi - Copyright (c) 1996-2014 Anthony Green, Red Hat, Inc and others. +See source files for details. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +``Software''), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +This software is copyrighted by the Regents of the University of +California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState +Corporation and other parties. The following terms apply to all files +associated with the software unless explicitly disclaimed in +individual files. + +The authors hereby grant permission to use, copy, modify, distribute, +and license this software and its documentation for any purpose, provided +that existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written agreement, +license, or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their authors +and need not follow the licensing terms described here, provided that +the new terms are clearly indicated on the first page of each file where +they apply. + +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +MODIFICATIONS. + +GOVERNMENT USE: If you are acquiring this software on behalf of the +U.S. government, the Government shall have only "Restricted Rights" +in the software and related documentation as defined in the Federal +Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you +are acquiring the software on behalf of the Department of Defense, the +software shall be classified as "Commercial Computer Software" and the +Government shall have only "Restricted Rights" as defined in Clause +252.227-7014 (b) (3) of DFARs. Notwithstanding the foregoing, the +authors grant the U.S. Government and others acting in its behalf +permission to use and distribute the software in accordance with the +terms specified in this license. + +This software is copyrighted by the Regents of the University of +California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState +Corporation, Apple Inc. and other parties. The following terms apply to +all files associated with the software unless explicitly disclaimed in +individual files. + +The authors hereby grant permission to use, copy, modify, distribute, +and license this software and its documentation for any purpose, provided +that existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written agreement, +license, or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their authors +and need not follow the licensing terms described here, provided that +the new terms are clearly indicated on the first page of each file where +they apply. + +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +MODIFICATIONS. + +GOVERNMENT USE: If you are acquiring this software on behalf of the +U.S. government, the Government shall have only "Restricted Rights" +in the software and related documentation as defined in the Federal +Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you +are acquiring the software on behalf of the Department of Defense, the +software shall be classified as "Commercial Computer Software" and the +Government shall have only "Restricted Rights" as defined in Clause +252.227-7013 (b) (3) of DFARs. Notwithstanding the foregoing, the +authors grant the U.S. Government and others acting in its behalf +permission to use and distribute the software in accordance with the +terms specified in this license. + +Copyright (c) 1993-1999 Ioi Kim Lam. +Copyright (c) 2000-2001 Tix Project Group. +Copyright (c) 2004 ActiveState + +This software is copyrighted by the above entities +and other parties. The following terms apply to all files associated +with the software unless explicitly disclaimed in individual files. + +The authors hereby grant permission to use, copy, modify, distribute, +and license this software and its documentation for any purpose, provided +that existing copyright notices are retained in all copies and that this +notice is included verbatim in any distributions. No written agreement, +license, or royalty fee is required for any of the authorized uses. +Modifications to this software may be copyrighted by their authors +and need not follow the licensing terms described here, provided that +the new terms are clearly indicated on the first page of each file where +they apply. + +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +MODIFICATIONS. + +GOVERNMENT USE: If you are acquiring this software on behalf of the +U.S. government, the Government shall have only "Restricted Rights" +in the software and related documentation as defined in the Federal +Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you +are acquiring the software on behalf of the Department of Defense, the +software shall be classified as "Commercial Computer Software" and the +Government shall have only "Restricted Rights" as defined in Clause +252.227-7013 (c) (1) of DFARs. Notwithstanding the foregoing, the +authors grant the U.S. Government and others acting in its behalf +permission to use and distribute the software in accordance with the +terms specified in this license. + +---------------------------------------------------------------------- + +Parts of this software are based on the Tcl/Tk software copyrighted by +the Regents of the University of California, Sun Microsystems, Inc., +and other parties. The original license terms of the Tcl/Tk software +distribution is included in the file docs/license.tcltk. + +Parts of this software are based on the HTML Library software +copyrighted by Sun Microsystems, Inc. The original license terms of +the HTML Library software distribution is included in the file +docs/license.html_lib. + diff --git a/base.cfg b/base.cfg new file mode 100644 index 0000000..89ffef3 --- /dev/null +++ b/base.cfg @@ -0,0 +1,107 @@ +[buildout] +show-picked-versions = true +extensions = + mr.developer + +index = https://pypi.python.org/simple/ + +parts = + instance + test + code-analysis + coverage + test-coverage + createcoverage + releaser + i18ndude + omelette + robot + plone-helper-scripts +develop = . + + +[instance] +recipe = plone.recipe.zope2instance +user = admin:admin +http-address = 8080 +environment-vars = + zope_i18n_compile_mo_files true +eggs = + Plone + Pillow + plone.app.debugtoolbar + onlyoffice.connector [test] + + +[code-analysis] +recipe = plone.recipe.codeanalysis +directory = ${buildout:directory}/src/onlyoffice +return-status-codes = False + + +[omelette] +recipe = collective.recipe.omelette +eggs = ${instance:eggs} + + +[test] +recipe = zc.recipe.testrunner +eggs = ${instance:eggs} +initialization = + os.environ['TZ'] = 'UTC' +defaults = ['-s', 'onlyoffice.connector', '--auto-color', '--auto-progress'] + + +[coverage] +recipe = zc.recipe.egg +eggs = coverage + + +[test-coverage] +recipe = collective.recipe.template +input = inline: + #!/bin/bash + export TZ=UTC + ${buildout:directory}/bin/coverage run bin/test $* + ${buildout:directory}/bin/coverage html + ${buildout:directory}/bin/coverage report -m --fail-under=90 + # Fail (exit status 1) if coverage returns exit status 2 (this happens + # when test coverage is below 100%. +output = ${buildout:directory}/bin/test-coverage +mode = 755 + + +[createcoverage] +recipe = zc.recipe.egg +eggs = createcoverage + + +[robot] +recipe = zc.recipe.egg +eggs = + ${test:eggs} + plone.app.robotframework[debug,reload] + + +[releaser] +recipe = zc.recipe.egg +eggs = zest.releaser + + +[i18ndude] +recipe = zc.recipe.egg +eggs = i18ndude + +[plone-helper-scripts] +recipe = zc.recipe.egg +eggs = + Products.CMFPlone + ${instance:eggs} +interpreter = zopepy +scripts = + zopepy + plone-compile-resources + +[versions] +# Don't use a released version of onlyoffice.connector +onlyoffice.connector = diff --git a/buildout.cfg b/buildout.cfg new file mode 100644 index 0000000..80d7a7f --- /dev/null +++ b/buildout.cfg @@ -0,0 +1,9 @@ +[buildout] + +# use this extend one of the buildout configuration: +extends = +# -*- mrbob: extra extends -*- +# test_plone43.cfg +# test_plone50.cfg +# test_plone51.cfg + test_plone52.cfg diff --git a/constraints_plone52.txt b/constraints_plone52.txt new file mode 100644 index 0000000..d96fee0 --- /dev/null +++ b/constraints_plone52.txt @@ -0,0 +1,3 @@ +-c https://dist.plone.org/release/5.2-latest/requirements.txt +# setuptools==40.2.0 +# zc.buildout==2.12.2 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..fa2f614 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +-c constraints_plone52.txt +setuptools +zc.buildout diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..e920041 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,19 @@ +[check-manifest] +ignore = + *.cfg + .coveragerc + .editorconfig + .gitattributes + +[isort] +# for details see +# http://docs.plone.org/develop/styleguide/python.html#grouping-and-sorting +force_alphabetical_sort = True +force_single_line = True +lines_after_imports = 2 +line_length = 200 +not_skip = __init__.py + +[flake8] +exclude = bootstrap.py,docs,*.egg.,omelette +max-complexity = 15 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..d3bb562 --- /dev/null +++ b/setup.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +"""Installer for the onlyoffice.connector package.""" + +from setuptools import find_packages +from setuptools import setup + + +long_description = '\n\n'.join([ + open('README.md').read(), + open('AUTHORS.md').read(), + open('CHANGELOG.md').read(), +]) + + +setup( + name='onlyoffice.connector', + version='1.0.0', + description="Plone ONLYOFFICE integration plugin", + long_description=long_description, + # Get more from https://pypi.org/classifiers/ + classifiers=[ + "Environment :: Web Environment", + "Framework :: Plone", + "Framework :: Plone :: Addon", + "Framework :: Plone :: 5.1", + "Programming Language :: Python", + "Programming Language :: Python :: 2.7", + "Operating System :: OS Independent", + "License :: OSI Approved :: GNU Affero General Public License v3 (AGPLv3)", + ], + 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', + 'Source': 'https://github.com/ONLYOFFICE/onlyoffice-plone', + 'Tracker': 'https://github.com/ONLYOFFICE/onlyoffice-plone/issues', + # 'Documentation': 'https://onlyoffice.connector.readthedocs.io/en/latest/', + }, + license='AGPL version 3', + packages=find_packages('src', exclude=['ez_setup']), + namespace_packages=['onlyoffice'], + package_dir={'': 'src'}, + include_package_data=True, + zip_safe=False, + python_requires="==2.7", + install_requires=[ + 'setuptools', + # -*- Extra requirements: -*- + 'z3c.jbot', + 'plone.api>=1.8.4', + 'plone.restapi', + 'plone.app.dexterity', + ], + extras_require={ + 'test': [ + 'plone.app.testing', + # Plone KGS does not use this version, because it would break + # Remove if your package shall be part of coredev. + # plone_coredev tests as of 2016-04-01. + 'plone.testing>=5.0.0', + 'plone.app.contenttypes', + 'plone.app.robotframework[debug]', + ], + }, + entry_points=""" + [z3c.autoinclude.plugin] + target = plone + [console_scripts] + update_locale = onlyoffice.connector.locales.update:update_locale + """, +) diff --git a/test_plone52.cfg b/test_plone52.cfg new file mode 100644 index 0000000..f8a7c22 --- /dev/null +++ b/test_plone52.cfg @@ -0,0 +1,11 @@ +[buildout] + +extends = + https://raw.github.com/collective/buildout.plonetest/master/test-5.2.x.cfg + https://raw.githubusercontent.com/collective/buildout.plonetest/master/qa.cfg + base.cfg + +update-versions-file = test_plone52.cfg + +[versions] +plone.testing = 7.0.1 From b6cfd443f49364a4ae02ee70270786d17620c1ad Mon Sep 17 00:00:00 2001 From: Andrey Panov Date: Thu, 27 Feb 2020 15:08:03 +0300 Subject: [PATCH 02/31] setup.py fixes --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d3bb562..4822e91 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ version='1.0.0', description="Plone ONLYOFFICE integration plugin", long_description=long_description, + long_description_content_type="text/markdown", # Get more from https://pypi.org/classifiers/ classifiers=[ "Environment :: Web Environment", @@ -26,7 +27,7 @@ "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Operating System :: OS Independent", - "License :: OSI Approved :: GNU Affero General Public License v3 (AGPLv3)", + "License :: OSI Approved :: GNU Affero General Public License v3", ], keywords='Python Plone', author='Ascensio System SIA', From 5298a89372fccc680e1780e523223c677cdddc99 Mon Sep 17 00:00:00 2001 From: Andrey Panov Date: Fri, 28 Feb 2020 10:04:45 +0300 Subject: [PATCH 03/31] manifest build file --- MANIFEST.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..93640ba --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,17 @@ +include *.js +include *.json +include *.py +include *.md +include *.txt +include *.cfg +recursive-include src *.css +recursive-include src *.js +recursive-include src *.map +recursive-include src *.po +recursive-include src *.pot +recursive-include src *.pt +recursive-include src *.py +recursive-include src *.sh +recursive-include src *.txt +recursive-include src *.xml +recursive-include src *.zcml \ No newline at end of file From 3f585a68f7a75bef3f3ee5e0a9102f883cd82fb1 Mon Sep 17 00:00:00 2001 From: Andrey Panov Date: Thu, 19 Mar 2020 14:56:29 +0300 Subject: [PATCH 04/31] dropped python2 support --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4822e91..fd16008 100644 --- a/setup.py +++ b/setup.py @@ -24,8 +24,12 @@ "Framework :: Plone", "Framework :: Plone :: Addon", "Framework :: Plone :: 5.1", + "Framework :: Plone :: 5.2", "Programming Language :: Python", - "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", "Operating System :: OS Independent", "License :: OSI Approved :: GNU Affero General Public License v3", ], @@ -45,7 +49,7 @@ package_dir={'': 'src'}, include_package_data=True, zip_safe=False, - python_requires="==2.7", + python_requires=">=3.4", install_requires=[ 'setuptools', # -*- Extra requirements: -*- From de9d7c567712597c130e8d517232ed65673daa70 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 15 Apr 2020 14:54:49 +0300 Subject: [PATCH 05/31] display error if document server wasn't properly configured #4 --- src/onlyoffice/connector/browser/templates/view.pt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/onlyoffice/connector/browser/templates/view.pt b/src/onlyoffice/connector/browser/templates/view.pt index 5754552..6294aaa 100644 --- a/src/onlyoffice/connector/browser/templates/view.pt +++ b/src/onlyoffice/connector/browser/templates/view.pt @@ -8,6 +8,7 @@
+
From 90e4846b4a8d2f83a5d5a9010d82e8e4ee5a749e Mon Sep 17 00:00:00 2001 From: hellonadya Date: Wed, 15 Apr 2020 18:53:05 +0300 Subject: [PATCH 06/31] Update README.md - add installation info + docker + link to PyPi --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 1042dee..78e1a33 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,14 @@ and then running `bin/buildout` To enable plugin, go to `Site Setup` -> `Add-ons`and press the `Install` button. +You could also install plugin via Docker + +``` +docker run --rm -p 8080:8080 -e ADDONS="onlyoffice.connector" plone +``` + +Both options will automatically install plugin from [PyPi](https://pypi.org/project/onlyoffice.connector/). + ## Configuring Plone ONLYOFFICE integration plugin To configure plugin go to `Site Setup`. Scroll down to `Add-ons Configuration` section and press the `ONLYOFFICE Configuration` button. From 5bf83f7384429aa53a45f132a50e806fe933097d Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 31 Aug 2020 10:48:06 +0300 Subject: [PATCH 07/31] apache --- src/onlyoffice/connector/browser/api.py | 16 ++++++++++++++++ .../connector/browser/controlpanel.py | 16 ++++++++++++++++ .../connector/browser/templates/error.pt | 18 ++++++++++++++++++ .../connector/browser/templates/view.pt | 18 ++++++++++++++++++ src/onlyoffice/connector/core/config.py | 16 ++++++++++++++++ src/onlyoffice/connector/core/fileUtils.py | 16 ++++++++++++++++ src/onlyoffice/connector/core/utils.py | 16 ++++++++++++++++ src/onlyoffice/connector/interfaces.py | 16 ++++++++++++++++ src/onlyoffice/connector/setuphandlers.py | 16 ++++++++++++++++ src/onlyoffice/connector/testing.py | 16 ++++++++++++++++ src/onlyoffice/connector/tests/test_robot.py | 16 ++++++++++++++++ src/onlyoffice/connector/tests/test_setup.py | 16 ++++++++++++++++ 12 files changed, 196 insertions(+) diff --git a/src/onlyoffice/connector/browser/api.py b/src/onlyoffice/connector/browser/api.py index aad1bd5..5064ce8 100644 --- a/src/onlyoffice/connector/browser/api.py +++ b/src/onlyoffice/connector/browser/api.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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.CMFCore.utils import getToolByName diff --git a/src/onlyoffice/connector/browser/controlpanel.py b/src/onlyoffice/connector/browser/controlpanel.py index 1859802..12e0f39 100644 --- a/src/onlyoffice/connector/browser/controlpanel.py +++ b/src/onlyoffice/connector/browser/controlpanel.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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 diff --git a/src/onlyoffice/connector/browser/templates/error.pt b/src/onlyoffice/connector/browser/templates/error.pt index a629458..bdbb202 100644 --- a/src/onlyoffice/connector/browser/templates/error.pt +++ b/src/onlyoffice/connector/browser/templates/error.pt @@ -6,6 +6,24 @@ metal:use-macro="here/main_template/macros/master" i18n:domain="onlyoffice.connector"> + +
ONLYOFFICE can't open this file.
diff --git a/src/onlyoffice/connector/browser/templates/view.pt b/src/onlyoffice/connector/browser/templates/view.pt index 5754552..1e936b3 100644 --- a/src/onlyoffice/connector/browser/templates/view.pt +++ b/src/onlyoffice/connector/browser/templates/view.pt @@ -6,6 +6,24 @@ metal:use-macro="here/main_template/macros/master" i18n:domain="onlyoffice.connector"> + +
diff --git a/src/onlyoffice/connector/core/config.py b/src/onlyoffice/connector/core/config.py index 4a47648..a535bd9 100644 --- a/src/onlyoffice/connector/core/config.py +++ b/src/onlyoffice/connector/core/config.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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 Config(): docUrl = None diff --git a/src/onlyoffice/connector/core/fileUtils.py b/src/onlyoffice/connector/core/fileUtils.py index 3c038ba..720db49 100644 --- a/src/onlyoffice/connector/core/fileUtils.py +++ b/src/onlyoffice/connector/core/fileUtils.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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. +# + def getFileName(str): ind = str.rfind('/') return str[ind+1:] diff --git a/src/onlyoffice/connector/core/utils.py b/src/onlyoffice/connector/core/utils.py index c10a152..9561559 100644 --- a/src/onlyoffice/connector/core/utils.py +++ b/src/onlyoffice/connector/core/utils.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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. +# + import base64 def getDocumentKey(obj): diff --git a/src/onlyoffice/connector/interfaces.py b/src/onlyoffice/connector/interfaces.py index 18d4523..0583950 100644 --- a/src/onlyoffice/connector/interfaces.py +++ b/src/onlyoffice/connector/interfaces.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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. +# + # -*- coding: utf-8 -*- """Module where all interfaces, events and exceptions live.""" diff --git a/src/onlyoffice/connector/setuphandlers.py b/src/onlyoffice/connector/setuphandlers.py index 71e9c63..faddb28 100644 --- a/src/onlyoffice/connector/setuphandlers.py +++ b/src/onlyoffice/connector/setuphandlers.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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. +# + # -*- coding: utf-8 -*- from Products.CMFPlone.interfaces import INonInstallable from zope.interface import implementer diff --git a/src/onlyoffice/connector/testing.py b/src/onlyoffice/connector/testing.py index 72af69a..8491cb1 100644 --- a/src/onlyoffice/connector/testing.py +++ b/src/onlyoffice/connector/testing.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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. +# + # -*- coding: utf-8 -*- from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE from plone.app.robotframework.testing import REMOTE_LIBRARY_BUNDLE_FIXTURE diff --git a/src/onlyoffice/connector/tests/test_robot.py b/src/onlyoffice/connector/tests/test_robot.py index 8c3657e..90f7757 100644 --- a/src/onlyoffice/connector/tests/test_robot.py +++ b/src/onlyoffice/connector/tests/test_robot.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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. +# + # -*- coding: utf-8 -*- from onlyoffice.connector.testing import ONLYOFFICE_CONNECTOR_ACCEPTANCE_TESTING # noqa: E501 from plone.app.testing import ROBOT_TEST_LEVEL diff --git a/src/onlyoffice/connector/tests/test_setup.py b/src/onlyoffice/connector/tests/test_setup.py index ecb944e..04f287a 100644 --- a/src/onlyoffice/connector/tests/test_setup.py +++ b/src/onlyoffice/connector/tests/test_setup.py @@ -1,3 +1,19 @@ +# +# (c) Copyright Ascensio System SIA 2020 +# +# 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. +# + # -*- coding: utf-8 -*- """Setup tests for this package.""" from onlyoffice.connector.testing import ONLYOFFICE_CONNECTOR_INTEGRATION_TESTING # noqa: E501 From 9f04b77f66ae8b5b25e8a338de3baeaeb2f7f6d0 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 31 Aug 2020 10:57:43 +0300 Subject: [PATCH 08/31] 3rd-party license --- 3rd-Party.license | 6 ++++++ licenses/3rd-Party.license | 6 ++++++ licenses/PyJWT.license | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 3rd-Party.license create mode 100644 licenses/3rd-Party.license create mode 100644 licenses/PyJWT.license diff --git a/3rd-Party.license b/3rd-Party.license new file mode 100644 index 0000000..8551d43 --- /dev/null +++ b/3rd-Party.license @@ -0,0 +1,6 @@ +Plone ONLYOFFICE integration plugin uses code from the following 3rd party projects: + + +PyJWT - A Python implementation of JWT (https://opensource.org/licenses/MIT) +License: MIT +License File: PyJWT.license diff --git a/licenses/3rd-Party.license b/licenses/3rd-Party.license new file mode 100644 index 0000000..8551d43 --- /dev/null +++ b/licenses/3rd-Party.license @@ -0,0 +1,6 @@ +Plone ONLYOFFICE integration plugin uses code from the following 3rd party projects: + + +PyJWT - A Python implementation of JWT (https://opensource.org/licenses/MIT) +License: MIT +License File: PyJWT.license diff --git a/licenses/PyJWT.license b/licenses/PyJWT.license new file mode 100644 index 0000000..bdc7819 --- /dev/null +++ b/licenses/PyJWT.license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 José Padilla + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 6ba3f6a094f7ac7c944d9c2885a6e8e544058017 Mon Sep 17 00:00:00 2001 From: hellonadya Date: Wed, 2 Sep 2020 16:02:06 +0300 Subject: [PATCH 09/31] Update README.md --- README.md | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 1042dee..2c48aba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Plone ONLYOFFICE integration plugin -This plugin allows users to edit office documents within [Plone](https://plone.org/) using ONLYOFFICE Document Server - [Community or Integration Edition](#onlyoffice-document-server-editions). +This plugin allows users to edit office documents within [Plone](https://plone.org/) using ONLYOFFICE Docs packaged as Document Server - [Community or Enterprise Edition](#onlyoffice-docs-editions). ## Features @@ -15,17 +15,17 @@ Supported formats: * For viewing and editing: DOCX, XLSX, PPTX. * For viewing only: PDF, ODT, ODS, ODP, DOC, XLS, PPT. -## Installing ONLYOFFICE Document Server +## Installing ONLYOFFICE Docs -You will need an instance of ONLYOFFICE Document Server that is resolvable and connectable both from Plone and any end-clients. ONLYOFFICE Document Server must also be able to POST to Plone directly. +You will need an instance of ONLYOFFICE Docs (Document Server) that is resolvable and connectable both from Plone and any end-clients. ONLYOFFICE Document Server must also be able to POST to Plone directly. -You can install free Community version of ONLYOFFICE Document Server or scalable enterprise-level Integration Edition. +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 Integration Edition, follow instructions [here](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx). +To install Enterprise Edition, follow instructions [here](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx). -Community Edition vs Integration Edition comparison can be found [here](#onlyoffice-document-server-editions). +Community Edition vs Enterprise Edition comparison can be found [here](#onlyoffice-docs-editions). ## Installing Plone ONLYOFFICE integration plugin @@ -93,46 +93,44 @@ virtualenv --clear . Note that Plone is based on Zope server and will not run as `root` user. If you intend to run it as `root` user. You must supply [effective-user directive](https://zope.readthedocs.io/en/2.12/SETUID.html). In order to do so add `effective-user ` line to `./parts/instance/etc/zope.conf`. -## ONLYOFFICE Document Server editions +## ONLYOFFICE Docs editions ONLYOFFICE offers different versions of its online document editors that can be deployed on your own servers. -**ONLYOFFICE Document Server:** - * Community Edition (`onlyoffice-documentserver` package) -* Integration Edition (`onlyoffice-documentserver-ie` package) +* Enterprise Edition (`onlyoffice-documentserver-ie` package) The table below will help you make the right choice. -| Pricing and licensing | Community Edition | Integration Edition | +| Pricing and licensing | Community Edition | Enterprise Edition | | ------------- | ------------- | ------------- | -| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | [Start Free Trial](https://www.onlyoffice.com/connectors-request.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | -| Cost | FREE | [Go to the pricing page](https://www.onlyoffice.com/integration-edition-prices.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | +| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | [Start Free Trial](https://www.onlyoffice.com/enterprise-edition-free.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | +| Cost | FREE | [Go to the pricing page](https://www.onlyoffice.com/enterprise-edition.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | | Simultaneous connections | up to 20 maximum | As in chosen pricing plan | | Number of users | up to 20 recommended | As in chosen pricing plan | | License | GNU AGPL v.3 | Proprietary | -| **Support** | **Community Edition** | **Integration Edition** | +| **Support** | **Community Edition** | **Enterprise Edition** | | Documentation | [Help Center](https://helpcenter.onlyoffice.com/server/docker/opensource/index.aspx) | [Help Center](https://helpcenter.onlyoffice.com/server/integration-edition/index.aspx) | | Standard support | [GitHub](https://github.com/ONLYOFFICE/DocumentServer/issues) or paid | One year support included | | Premium support | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | [Buy Now](https://www.onlyoffice.com/support.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | -| **Services** | **Community Edition** | **Integration Edition** | +| **Services** | **Community Edition** | **Enterprise Edition** | | Conversion Service | + | + | | Document Builder Service | + | + | -| **Interface** | **Community Edition** | **Integration Edition** | +| **Interface** | **Community Edition** | **Enterprise Edition** | | Tabbed interface | + | + | | White Label | - | - | | Integrated test example (node.js) | - | + | -| **Plugins & Macros** | **Community Edition** | **Integration Edition** | +| **Plugins & Macros** | **Community Edition** | **Enterprise Edition** | | Plugins | + | + | | Macros | + | + | -| **Collaborative capabilities** | **Community Edition** | **Integration Edition** | +| **Collaborative capabilities** | **Community Edition** | **Enterprise Edition** | | Two co-editing modes | + | + | | Comments | + | + | | Built-in chat | + | + | | Review and tracking changes | + | + | | Display modes of tracking changes | + | + | | Version history | + | + | -| **Document Editor features** | **Community Edition** | **Integration Edition** | +| **Document Editor features** | **Community Edition** | **Enterprise Edition** | | Font and paragraph formatting | + | + | | Object insertion | + | + | | Adding Content control | - | + | @@ -141,20 +139,24 @@ The table below will help you make the right choice. | Table of contents | + | + | | Navigation panel | + | + | | Comparing Documents | - | +* | -| **Spreadsheet Editor features** | **Community Edition** | **Integration Edition** | +| **Spreadsheet Editor features** | **Community Edition** | **Enterprise Edition** | | Font and paragraph formatting | + | + | | Object insertion | + | + | | Functions, formulas, equations | + | + | | Table templates | + | + | -| Pivot tables | +** | +** | -| **Presentation Editor features** | **Community Edition** | **Integration Edition** | +| Pivot tables | -** | + | +| Conditional formatting for viewing | +*** | +** | +| **Presentation Editor features** | **Community Edition** | **Enterprise Edition** | | Font and paragraph formatting | + | + | | Object insertion | + | + | | Animations | + | + | | Presenter mode | + | + | | Notes | + | + | -| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | [Start Free Trial](https://www.onlyoffice.com/connectors-request.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | +| | [Get it now](https://www.onlyoffice.com/download.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | [Start Free Trial](https://www.onlyoffice.com/enterprise-edition-free.aspx?utm_source=github&utm_medium=cpc&utm_campaign=GitHubPlone) | \* It's possible to add documents for comparison from your local drive and from URL. Adding files for comparison from storage is not available yet. -\** Changing style and deleting (Full support coming soon) +\** In free version, pivot tables are supported for viewing, changing style and deleting + +\*** Support for all conditions and gradient. Adding/Editing capabilities are coming soon + From 4e7be8423adb76664b532f71df1a92e2f0f413dd Mon Sep 17 00:00:00 2001 From: Andrei Panov Date: Tue, 9 Feb 2021 12:06:33 +0300 Subject: [PATCH 10/31] fixed an issue when files inside unpublished folders couldn't be edited + logging --- src/onlyoffice/connector/browser/api.py | 45 +++++++++++++++---- .../connector/browser/configure.zcml | 9 +++- src/onlyoffice/connector/core/utils.py | 21 ++++++++- src/onlyoffice/connector/interfaces.py | 2 + 4 files changed, 67 insertions(+), 10 deletions(-) diff --git a/src/onlyoffice/connector/browser/api.py b/src/onlyoffice/connector/browser/api.py index 5064ce8..90ff26a 100644 --- a/src/onlyoffice/connector/browser/api.py +++ b/src/onlyoffice/connector/browser/api.py @@ -16,17 +16,20 @@ from Acquisition import aq_inner from AccessControl import getSecurityManager -from Products.CMFCore.utils import getToolByName 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 onlyoffice.connector.core.config import Config from onlyoffice.connector.core import fileUtils from onlyoffice.connector.core import utils +from onlyoffice.connector.interfaces import logger from urllib.request import urlopen import json @@ -64,15 +67,16 @@ def __call__(self): return self.index() def get_config(self, forEdit): - def viewURLFor(self, item): - cstate = getMultiAdapter((item, item.REQUEST), name='plone_context_state') - return cstate.view_url() + # def viewURLFor(self, item): + # cstate = getMultiAdapter((item, item.REQUEST), name='plone_context_state') + # return cstate.view_url() def portal_state(self): context = aq_inner(self.context) portal_state = getMultiAdapter((context, self.request), name=u'plone_portal_state') return portal_state + 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 @@ -83,12 +87,13 @@ def portal_state(self): state = portal_state(self) user = state.member() + securityToken = utils.getSecurityToken(self.context) config = { 'type': 'desktop', 'documentType': fileUtils.getFileType(filename), 'document': { 'title': filename, - 'url': self.context.absolute_url() + '/@@download', + 'url': self.context.absolute_url() + '/onlyoffice-dl?token=' + securityToken, 'fileType': fileUtils.getFileExt(filename)[1:], 'key': utils.getDocumentKey(self.context), 'info': { @@ -113,12 +118,15 @@ def portal_state(self): } } if canEdit: - config['editorConfig']['callbackUrl'] = self.context.absolute_url() + '/onlyoffice-callback' + config['editorConfig']['callbackUrl'] = self.context.absolute_url() + '/onlyoffice-callback?token=' + securityToken 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 @@ -126,17 +134,20 @@ def __call__(self): try: body = json.loads(self.request.get('BODY')) + logger.debug(body) 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 @@ -144,4 +155,22 @@ def __call__(self): response['error'] = 0 self.request.response.status = 200 - return json.dumps(response) \ No newline at end of file + return json.dumps(response) + +class ODownload(Download): + def _getFile(self): + 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 \ No newline at end of file diff --git a/src/onlyoffice/connector/browser/configure.zcml b/src/onlyoffice/connector/browser/configure.zcml index d1f8bd9..06c38ee 100644 --- a/src/onlyoffice/connector/browser/configure.zcml +++ b/src/onlyoffice/connector/browser/configure.zcml @@ -41,7 +41,14 @@ name="onlyoffice-callback" for="plone.app.contenttypes.interfaces.IFile" class=".api.Callback" - permission="zope2.View" + permission="zope2.Public" + /> + + Date: Mon, 15 Mar 2021 12:59:19 +0300 Subject: [PATCH 11/31] Update README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 608918c..2fcb214 100644 --- a/README.md +++ b/README.md @@ -152,8 +152,9 @@ The table below will help you make the right choice. | Object insertion | + | + | | Functions, formulas, equations | + | + | | Table templates | + | + | -| Pivot tables | -** | + | -| Conditional formatting for viewing | +*** | +** | +| Pivot tables | + | + | +| Conditional formatting for viewing | +** | +** | +| Sheet views | - | + | | **Presentation Editor features** | **Community Edition** | **Enterprise Edition** | | Font and paragraph formatting | + | + | | Object insertion | + | + | @@ -164,7 +165,5 @@ The table below will help you make the right choice. \* It's possible to add documents for comparison from your local drive and from URL. Adding files for comparison from storage is not available yet. -\** In free version, pivot tables are supported for viewing, changing style and deleting - -\*** Support for all conditions and gradient. Adding/Editing capabilities are coming soon +\** Support for all conditions and gradient. Adding/Editing capabilities are coming soon From eb7cd4e9586491875e78beb44fbe133d422bf097 Mon Sep 17 00:00:00 2001 From: Sergey Linnik Date: Mon, 15 Mar 2021 13:05:53 +0300 Subject: [PATCH 12/31] Copyright 2021 --- src/onlyoffice/connector/browser/api.py | 2 +- src/onlyoffice/connector/browser/controlpanel.py | 2 +- src/onlyoffice/connector/browser/templates/error.pt | 2 +- src/onlyoffice/connector/browser/templates/view.pt | 2 +- src/onlyoffice/connector/core/config.py | 2 +- src/onlyoffice/connector/core/fileUtils.py | 2 +- src/onlyoffice/connector/core/utils.py | 2 +- src/onlyoffice/connector/interfaces.py | 2 +- src/onlyoffice/connector/setuphandlers.py | 2 +- src/onlyoffice/connector/testing.py | 2 +- src/onlyoffice/connector/tests/test_robot.py | 2 +- src/onlyoffice/connector/tests/test_setup.py | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/onlyoffice/connector/browser/api.py b/src/onlyoffice/connector/browser/api.py index 90ff26a..5318fe5 100644 --- a/src/onlyoffice/connector/browser/api.py +++ b/src/onlyoffice/connector/browser/api.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2020 +# (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. diff --git a/src/onlyoffice/connector/browser/controlpanel.py b/src/onlyoffice/connector/browser/controlpanel.py index 12e0f39..cdb2eb3 100644 --- a/src/onlyoffice/connector/browser/controlpanel.py +++ b/src/onlyoffice/connector/browser/controlpanel.py @@ -1,5 +1,5 @@ # -# (c) Copyright Ascensio System SIA 2020 +# (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. diff --git a/src/onlyoffice/connector/browser/templates/error.pt b/src/onlyoffice/connector/browser/templates/error.pt index bdbb202..c00d5b9 100644 --- a/src/onlyoffice/connector/browser/templates/error.pt +++ b/src/onlyoffice/connector/browser/templates/error.pt @@ -8,7 +8,7 @@ + + + + + + + + \ No newline at end of file diff --git a/src/onlyoffice/connector/upgrades.py b/src/onlyoffice/connector/upgrades.py new file mode 100644 index 0000000..46ad97b --- /dev/null +++ b/src/onlyoffice/connector/upgrades.py @@ -0,0 +1,23 @@ +# +# (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. +# + +PROFILE_ID = 'onlyoffice.connector:default' + +def upgrade_to_2(context): + context.runImportStepFromProfile( + PROFILE_ID.replace('default', 'to_2'), + 'plone.app.registry', + ) \ No newline at end of file diff --git a/src/onlyoffice/connector/upgrades.zcml b/src/onlyoffice/connector/upgrades.zcml new file mode 100644 index 0000000..094ade2 --- /dev/null +++ b/src/onlyoffice/connector/upgrades.zcml @@ -0,0 +1,22 @@ + + + + + + + \ No newline at end of file From 9db12f7f6a432301338277df6379e5db32da1b66 Mon Sep 17 00:00:00 2001 From: Alexandr Fedorov Date: Thu, 8 Apr 2021 14:25:38 +0300 Subject: [PATCH 29/31] changelog & version --- CHANGELOG.md | 6 ++++++ setup.py | 2 +- src/onlyoffice/connector/profiles/default/metadata.xml | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9d1184..cf17b2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 2.0.0 +## Added + - JWT support +## Fixed + - Issue when files inside unpublished folders couldn't be edited + ## 1.0.0 ## Added - Edit option for DOCX, XLSX, PPTX. diff --git a/setup.py b/setup.py index fd16008..4924fcf 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( name='onlyoffice.connector', - version='1.0.0', + version='2.0.0', description="Plone ONLYOFFICE integration plugin", long_description=long_description, long_description_content_type="text/markdown", diff --git a/src/onlyoffice/connector/profiles/default/metadata.xml b/src/onlyoffice/connector/profiles/default/metadata.xml index 3fcf1da..273fa7d 100644 --- a/src/onlyoffice/connector/profiles/default/metadata.xml +++ b/src/onlyoffice/connector/profiles/default/metadata.xml @@ -1,6 +1,6 @@ - 1000 + 2000 From 3e013734aed43caed0f18110464cc6bc5327bd62 Mon Sep 17 00:00:00 2001 From: Natalia Date: Thu, 8 Apr 2021 17:42:19 +0300 Subject: [PATCH 30/31] change structure --- README.md | 98 +++++++++++++++++++++++++++---------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index e990d65..5571e8a 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Community Edition vs Enterprise Edition comparison can be found [here](#onlyoffi ## Installing Plone ONLYOFFICE integration plugin -Install plugin by adding it to your `buildout.cfg`: +1. Install plugin by adding it to your `buildout.cfg`: ``` [buildout] @@ -40,9 +40,9 @@ eggs = onlyoffice.connector ``` -and then running `bin/buildout` +2. Run `bin/buildout`. -To enable plugin, go to `Site Setup` -> `Add-ons`and press the `Install` button. +3. Go to `Site Setup` -> `Add-ons`and press the `Install` button to enable plugin. You could also install plugin via Docker @@ -56,54 +56,18 @@ Both options will automatically install plugin from [PyPi](https://pypi.org/proj To configure plugin go to `Site Setup`. Scroll down to `Add-ons Configuration` section and press the `ONLYOFFICE Configuration` button. - -## Upgrade Plone ONLYOFFICE integration plugin - - If you specified concrete version plugin in your buildout.cfg file (so-called “pinning”, and a recommended practice), - like onlyoffice.connector = 1.0.0, update these reference to point to the new version. If the plugin version is not - specified, then the latest version will be automatically loaded - -``` -[versions] - - ... - -onlyoffice.connector = 2.0.0 -``` - - - Run bin/buildout. Wait until all new software is downloaded and installed. - - Restart Plone - your site may look weird, or even be inaccessible until you have performed the next step - - Navigate to the Add-on screen (add /prefs_install_products_form to your site URL) and in the Upgrades list select onlyoffice.connector and click the "Upgrade onlyoffice.connector" - -## How it works - -The ONLYOFFICE integration follows the API documented [here](https://api.onlyoffice.com/editors/basic): - -* User navigates to a document within Plone and selects the `ONLYOFFICE Edit` action. -* Plone prepares a JSON object for the Document Server with the following properties: - * **url**: the URL that ONLYOFFICE Document Server uses to download the document; - * **callbackUrl**: the URL that ONLYOFFICE Document Server informs about status of the document editing; - * **key**: the UUID+Modified Timestamp to instruct ONLYOFFICE Document Server whether to download the document again or not; - * **title**: the document Title (name). -* Plone constructs a page from a `.pt` template, filling in all of those values so that the client browser can load up the editor. -* The client browser makes a request for the javascript library from ONLYOFFICE Document Server and sends ONLYOFFICE Document Server the docEditor configuration with the above properties. -* Then ONLYOFFICE Document Server downloads the document from Plone and the user begins editing. -* ONLYOFFICE Document Server sends a POST request to the `callback` URL to inform Plone that a user is editing the document. -* When all users and client browsers are done with editing, they close the editing window. -* After 10 seconds of inactivity, ONLYOFFICE Document Server sends a POST to the `callback` URL letting Plone know that the clients have finished editing the document and closed it. -* Plone downloads the new version of the document, replacing the old one. - ## Developing Plone ONLYOFFICE plugin -- Clone repository and change directory +1. Clone repository and change directory: ``` git clone --branch deploy git@github.com:ONLYOFFICE/onlyoffice-plone.git cd onlyoffice-plone ``` - - Create a virtualenv in the package - - Install requirements with pip - - Run buildout +2. Create a virtualenv in the package. +3. Install requirements with pip. +4. Run buildout: ``` virtualenv . @@ -111,16 +75,16 @@ virtualenv . ./bin/buildout ``` - - Start Plone in foreground +5. Start Plone in foreground: ``` ./bin/instance fg ``` If you have a working Plone instance, you can install plugin by adding the project files to the src directory: - - In the src directory create the onlyoffice.connector directory - - Put your project files received by git into the onlyoffice.connector directory - - Edit the buildout.cfg file: +1. In the src directory create the onlyoffice.connector directory. +2. Put your project files received by git into the onlyoffice.connector directory. +3. Edit the buildout.cfg file: ``` [buildout] @@ -132,15 +96,51 @@ If you have a working Plone instance, you can install plugin by adding the proje develop = src/onlyoffice.connector ``` - - You need to rerun buildout for the changes to take effect: +4. Rerun buildout for the changes to take effect: ``` ./bin/buildout ``` - - Then start or restart your Plone instance +5. Then start or restart your Plone instance. Note that Plone is based on Zope server and will not run as `root` user. If you intend to run it as `root` user. You must supply [effective-user directive](https://zope.readthedocs.io/en/2.12/SETUID.html). In order to do so add `effective-user ` line to `./parts/instance/etc/zope.conf`. +## Upgrade Plone ONLYOFFICE integration plugin +1. If you specified a concrete plugin version in your buildout.cfg file (so-called “pinning”, and a recommended practice), + like onlyoffice.connector = 1.0.0, update this reference to point to the newer version. If the plugin version is not + specified, then the latest version will be automatically loaded: + +``` +[versions] + + ... + +onlyoffice.connector = 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". + +## How it works + +The ONLYOFFICE integration follows the API documented [here](https://api.onlyoffice.com/editors/basic): + +* User navigates to a document within Plone and selects the `ONLYOFFICE Edit` action. +* Plone prepares a JSON object for the Document Server with the following properties: + * **url**: the URL that ONLYOFFICE Document Server uses to download the document; + * **callbackUrl**: the URL that ONLYOFFICE Document Server informs about status of the document editing; + * **key**: the UUID+Modified Timestamp to instruct ONLYOFFICE Document Server whether to download the document again or not; + * **title**: the document Title (name). +* Plone constructs a page from a `.pt` template, filling in all of those values so that the client browser can load up the editor. +* The client browser makes a request for the javascript library from ONLYOFFICE Document Server and sends ONLYOFFICE Document Server the docEditor configuration with the above properties. +* Then ONLYOFFICE Document Server downloads the document from Plone and the user begins editing. +* ONLYOFFICE Document Server sends a POST request to the `callback` URL to inform Plone that a user is editing the document. +* When all users and client browsers are done with editing, they close the editing window. +* After 10 seconds of inactivity, ONLYOFFICE Document Server sends a POST to the `callback` URL letting Plone know that the clients have finished editing the document and closed it. +* Plone downloads the new version of the document, replacing the old one. + + ## ONLYOFFICE Docs editions ONLYOFFICE offers different versions of its online document editors that can be deployed on your own servers. From 7e83f720ce22502a1a33ebe7db80669545815d15 Mon Sep 17 00:00:00 2001 From: Alexandr Fedorov Date: Thu, 8 Apr 2021 18:22:49 +0300 Subject: [PATCH 31/31] fix tabulation --- README.md | 89 +++++++++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 5571e8a..53a1387 100644 --- a/README.md +++ b/README.md @@ -30,26 +30,21 @@ Community Edition vs Enterprise Edition comparison can be found [here](#onlyoffi ## Installing Plone ONLYOFFICE integration plugin 1. Install plugin by adding it to your `buildout.cfg`: + ``` + [buildout] -``` -[buildout] - -... - -eggs = - onlyoffice.connector -``` + ... + eggs = + onlyoffice.connector + ``` 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 ``` - Both options will automatically install plugin from [PyPi](https://pypi.org/project/onlyoffice.connector/). ## Configuring Plone ONLYOFFICE integration plugin @@ -59,48 +54,41 @@ To configure plugin go to `Site Setup`. Scroll down to `Add-ons Configuration` s ## Developing Plone ONLYOFFICE plugin 1. Clone repository and change directory: - -``` -git clone --branch deploy git@github.com:ONLYOFFICE/onlyoffice-plone.git -cd onlyoffice-plone -``` - + ``` + git clone --branch deploy git@github.com:ONLYOFFICE/onlyoffice-plone.git + cd onlyoffice-plone + ``` 2. Create a virtualenv in the package. 3. Install requirements with pip. 4. Run buildout: - -``` -virtualenv . -./bin/pip install -r requirements.txt -./bin/buildout -``` - + ``` + virtualenv . + ./bin/pip install -r requirements.txt + ./bin/buildout + ``` 5. Start Plone in foreground: - -``` -./bin/instance fg -``` - + ``` + ./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. 3. Edit the buildout.cfg file: - ``` - [buildout] - - ... - - eggs = - onlyoffice.connector - -develop = - src/onlyoffice.connector - ``` -4. Rerun buildout for the changes to take effect: -``` -./bin/buildout -``` + ``` + [buildout] + ... + + eggs = + onlyoffice.connector + + develop = + src/onlyoffice.connector + ``` +4. Rerun buildout for the changes to take effect: + ``` + ./bin/buildout + ``` 5. Then start or restart your Plone instance. Note that Plone is based on Zope server and will not run as `root` user. If you intend to run it as `root` user. You must supply [effective-user directive](https://zope.readthedocs.io/en/2.12/SETUID.html). In order to do so add `effective-user ` line to `./parts/instance/etc/zope.conf`. @@ -109,15 +97,13 @@ Note that Plone is based on Zope server and will not run as `root` user. If you 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 specified, then the latest version will be automatically loaded: - -``` -[versions] + ``` + [versions] - ... - -onlyoffice.connector = 1.0.1 -``` + ... + onlyoffice.connector = 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". @@ -140,7 +126,6 @@ The ONLYOFFICE integration follows the API documented [here](https://api.onlyoff * After 10 seconds of inactivity, ONLYOFFICE Document Server sends a POST to the `callback` URL letting Plone know that the clients have finished editing the document and closed it. * Plone downloads the new version of the document, replacing the old one. - ## ONLYOFFICE Docs editions ONLYOFFICE offers different versions of its online document editors that can be deployed on your own servers.