Zope Documentation Release 5.3
Total Page:16
File Type:pdf, Size:1020Kb
Zope Documentation Release 5.3 The Zope developer community Jul 31, 2021 Contents 1 What’s new in Zope 3 1.1 What’s new in Zope 5..........................................4 1.2 What’s new in Zope 4..........................................4 2 Installing Zope 11 2.1 Prerequisites............................................... 11 2.2 Installing Zope with zc.buildout .................................. 12 2.3 Installing Zope with pip ........................................ 13 2.4 Building the documentation with Sphinx ............................... 14 3 Configuring and Running Zope 15 3.1 Creating a Zope instance......................................... 16 3.2 Filesystem Permissions......................................... 17 3.3 Configuring Zope............................................. 17 3.4 Running Zope.............................................. 18 3.5 Running Zope (plone.recipe.zope2instance install)........................... 20 3.6 Logging In To Zope........................................... 21 3.7 Special access user accounts....................................... 22 3.8 Troubleshooting............................................. 22 3.9 Using alternative WSGI server software................................. 22 3.10 Debugging Zope applications under WSGI............................... 26 3.11 Zope configuration reference....................................... 27 4 Migrating between Zope versions 37 4.1 From Zope 2 to Zope 4 or 5....................................... 37 4.2 Migration from Zope 4 to Zope 5.0................................... 49 5 Maintainer information 51 5.1 Release process.............................................. 51 5.2 Maintaining the Zope documentation.................................. 53 6 Change log 55 6.1 5.3.1 (unreleased)............................................ 55 6.2 5.3 (2021-07-31)............................................. 55 6.3 5.2.1 (2021-06-08)............................................ 55 6.4 5.2 (2021-05-21)............................................. 56 6.5 5.1.2 (2021-03-02)............................................ 56 i 6.6 5.1.1 (2021-02-10)............................................ 56 6.7 5.1 (2020-11-12)............................................. 56 6.8 5.0 (2020-10-08)............................................. 57 6.9 5.0a2 (2020-04-24)............................................ 58 6.10 5.0a1 (2020-02-28)............................................ 58 7 The Zope Book 61 7.1 Preface.................................................. 61 7.2 Introducing Zope............................................. 64 7.3 Zope Concepts and Architecture..................................... 69 7.4 Installing and Starting Zope....................................... 74 7.5 Object Orientation............................................ 89 7.6 Using the Zope Management Interface................................. 93 7.7 Using Basic Zope Objects........................................ 101 7.8 Acquisition................................................ 116 7.9 Basic Zope Scripting........................................... 119 7.10 Using Zope Page Templates....................................... 131 7.11 Creating Basic Zope Applications.................................... 144 7.12 Users and Security............................................ 156 7.13 Advanced Page Templates........................................ 175 7.14 Advanced Zope Scripting........................................ 194 7.15 Zope Services.............................................. 215 7.16 Basic DTML............................................... 220 7.17 Advanced DTML............................................. 242 7.18 Searching and Categorizing Content................................... 264 7.19 Relational Database Connectivity.................................... 289 7.20 Virtual Hosting Services......................................... 310 7.21 Session Management........................................... 316 7.22 Scalability and ZEO........................................... 339 7.23 Managing Zope Objects Using External Tools.............................. 351 7.24 Maintaining Zope............................................ 355 7.25 Appendix A: DTML Reference..................................... 365 7.26 Appendix B: API Reference....................................... 388 7.27 Appendix C: Zope Page Templates Reference.............................. 388 7.28 Appendix D: Zope Resources...................................... 410 7.29 Appendix E: DTML Name Lookup Rules................................ 411 7.30 Contributions............................................... 412 8 Zope Developer’s Guide 415 8.1 Introduction............................................... 415 8.2 Getting Started.............................................. 416 8.3 Components and Interfaces....................................... 421 8.4 Object Publishing............................................ 426 8.5 Zope Products.............................................. 445 8.6 ZODB Persistent Components...................................... 464 8.7 Acquisition................................................ 472 8.8 Security.................................................. 478 8.9 Testing and Debugging.......................................... 496 8.10 Appendix A: Zope Core Permissions.................................. 506 ii Zope Documentation, Release 5.3 This is the official home for all Zope documentation. Contents 1 Zope Documentation, Release 5.3 2 Contents CHAPTER 1 What’s new in Zope The article explains the new high-level features and changes found in Zope. You can have a look at the detailed change log to learn about all minor new features and bugs being solved in the latest release. The Zope development roadmap on www.zope.org explains which versions are supported and for how long. Attention: If you are upgrading from Zope 2, make sure you study the From Zope 2 to Zope 4 or 5 documentation • What’s new in Zope 5 – Added support for Python 3.9 – Dropped support for Python 2 – Dropped support for ZServer • What’s new in Zope 4 – Restored sane version numbering – Extended Python version support – WSGI as the new default server type – View component Acquisition changes – Page Templates now rendered by Chameleon – Lower memory consumption at runtime – Simplified encoding configuration – Restyled Zope Management Interface (ZMI) 3 Zope Documentation, Release 5.3 1.1 What’s new in Zope 5 1.1.1 Added support for Python 3.9 Python 3.9 is now fully supported by Zope 5. 1.1.2 Dropped support for Python 2 Zope 5 supports Python 3 only, versions 3.6 up through 3.9. All support code and special casing for Python 2, including the use of the six package, have been removed. 1.1.3 Dropped support for ZServer As ZServer only supports Python 2, its integration has been removed. Only WSGI is now supported for web service. 1.2 What’s new in Zope 4 1.2.1 Restored sane version numbering Version numbers for Zope have been confusing in the past. The original Zope project iterated through version one to two up to version 2.13. In parallel a separate project was launched using the name Zope 3. Zope 3 wasn’t a new version of the original Zope project and in hindsight should have used a different project name. These days this effort is known as BlueBream. In order to avoid confusion between the separate Zope 3 project and a new version of this project, it was decided to skip ahead and use Zope 4.0 as the next version number. The increase in the major part of the version also indicates the number of backwards incompatible changes found in this release. 1.2.2 Extended Python version support Zope 4 supports Python 2.7 and Python 3 versions 3.5 up to 3.8. The Python 3 support currently covers the core dependencies shipped with Zope and is limited to the new WSGI based publisher. Migrating an existing ZODB to Python 3 is not an automated process. You have to update to Zope 4 first, see From Zope 2 to Zope 4 or 5. 1.2.3 WSGI as the new default server type Zope 2.13 first gained support for running Zope as a WSGI application, using any WSGI capable web server instead of the built-in ZServer. Zope 4.0 takes this one step further and uses WSGI as the default setup. Functional testing (testbrowser) support also uses the new WSGI publisher. The ZServer based publisher got moved into its own optional project. So if you rely on ZServer features, like FTP, zdaemon or zopectl support, please make sure to install ZServer and use its mkzopeinstance script to create a Zope instance. 4 Chapter 1. What’s new in Zope Zope Documentation, Release 5.3 The ZServer project also includes limited functional testing support in the ZServer.Testing sub-package. test- browser support is exclusively available based on the WSGI publisher, as a result of a switch from the unmaintained mechanize project to WebTest. By default Zope only ships with a new mkwsgiinstance script which creates a Zope instance configured to run as a WSGI application. The example configuration uses the waitress web server, but Zope can be run using any WSGI capable web server. To make running Zope easier, a new runwsgi command line script got added, which can read a PasteDeploy con- figuration and create and run the WSGI pipeline specified in it. By default such a configuration is created in the etc/zope.ini file. The runwsgi script supports both -v / --verbose and -d / --debug arguments to print out more information on the console. The debug argument enables Zope’s debug mode and disables the catch-all part of the httpexceptions