Zope: Wikis

  
  
  

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

Encyclopedia

From Wikipedia, the free encyclopedia

Zope 2
Developer(s) Zope Corporation
Initial release 1998 (1998)
Stable release 2.12.2 / 2009-12-22; 22 days ago
Written in Python
Operating system Cross-platform
Development status Active
Type web application server
License Zope Public License
Website http://zope2.zope.org/
Zope 3
Developer(s) Zope Corporation
Initial release 2004 (2004)
Stable release 3.4 / 2009-01-30; 11 months ago
Written in Python
Operating system Cross-platform
Development status Unmaintained
Type web application server
License Zope Public License
Website http://www.zope.org/

Zope is a free and open-source, object-oriented web application server written in the Python programming language. Zope stands for "Z Object Publishing Environment." It can be almost fully managed with a web-based user interface. Zope publishes on the web Python objects that are typically persisted in an object database, ZODB. Basic object types, such as documents, images, and page templates, are available for the user to create and manage through the web. Specialized object types, such as wikis, blogs, and photo galleries, are available as third-party add-ons (called products), and there is a thriving community of small businesses creating custom web applications as Zope products. The most well known Zope application is the content management system Plone, which runs on Zope 2.

There are two major generations of the software in use today. As of December 2009, Zope 2.12.1 is the latest stable release of Zope 2 codebase, and Zope 3.4.0 is the latest release of Zope 3. Zope is distributed under the terms of the Zope Public License, a free software license.

Contents

History

The Zope Corporation was formed in 1995 in Fredericksburg, VA under the name Digital Creations, as a joint venture with InfiNet (a joint newspaper chain venture). The company developed a classified advertisement engine for the Internet, then in 1997 became an independently owned private company. At the behest of its largest investor, Opticality Ventures, Zope Corporation released its software as free software, concentrating on providing premier customization services. The company's software engineers are led by CTO Jim Fulton. PythonLabs, creators of Python, became part of the company in the year 2000 (Python founder Guido van Rossum left Zope Corp in 2003[1]).

What is now known as Zope 2 started off with the merger of three separate software products – Bobo, Document Template, and BoboPOS – into the Principia application server. The authoring company, Digital Creations, re-released their flagship product as free and open-source software in 1998, influenced by their venture capitalist, Hadar Pedhazur. This product was renamed "Zope" with this release.

In November 2004, Zope 3 was released. Zope 3 is a complete rewrite that preserves only the original ZODB object database and the ZPT templating engine. The design of Zope 3 is driven by the needs of large companies, the clients of Zope Corporation, for complex business schemas. It is directly intended for enterprise web application development using the newest development paradigms. Zope 3 is, however, not compatible with Zope 2, so you cannot run Zope 2 applications on Zope 3. Therefore, an effort (called Five) to merge the new Zope 3 paradigms into Zope 2 has been ongoing since Zope 2.8. Its aim is to allow developers to write applications and libraries that run under both Zope 3 and Zope 2.

Technical features

A Zope website is composed of objects in an object database as opposed to files, as is usual with many other web server systems. This approach allows users to harness the advantages of object technologies, such as encapsulation. Zope maps URLs to objects using the containment hierarchy of such objects; methods are considered to be contained in their objects as well.

Zope comes with the Zope Object Database, which transparently persists (Python) objects in a transactional database.

One particularly innovative feature of Zope is its widespread use of acquisition. Acquisition is a technique parallel to class inheritance, in which objects "inherit" behavior from their context in a composition hierarchy, as opposed to their class in a class hierarchy. This allows certain ways to structure source code that are otherwise harder to accomplish, and can encourage application decomposition. A common use is in structuring the way layout elements are used in a web page. Acquisition as implemented in Zope 2 is also perceived as a source of bugs, as it enables many unexpected behaviours. In Zope 3 the use of acquisition has been made explicit. You only acquire data if you explicitly say that it is the acquired data you want.

Zope provides several mechanisms for HTML templating: Dynamic Template Markup Language (DTML), and Zope Page Templates (ZPT). DTML is a tag-based language which allows implementation of simple scripting in the templates. DTML has provisions for variable inclusion, conditions, and loops. However, DTML has major drawbacks: DTML tags interspersed with HTML form non-valid HTML documents, and careless inclusion of logic into templates results in very unreadable code. ZPT is a technology that fixes these shortcomings. ZPT templates can be either well-formed XML documents or HTML documents, in which all special markup is presented as attributes in the TAL (Template Attribute Language) namespace. ZPT offers just a very limited set of tools for conditional inclusion and repetition of XML elements, thus the templates are usually quite simple, with most logic implemented in Python code. One significant advantage of ZPT templates is that they can be edited in most graphical HTML editors. ZPT also offers direct support for internationalization.

Zope 2 is the base behind the Plone, and Silva content management systems, as well as the base behind ERP5 open source enterprise resource planning.

Zope 3

Zope 2 has proven itself as a useful framework for web applications development, but its use revealed some shortcomings. To name a few, creating Zope 2 products involves copying a lot of boilerplate code – "magic" code – that just has to be there, and the built-in management interface is difficult to modify or replace. Zope 3 is a rewrite of the software that attempts to address these shortcomings while retaining the advantages of Zope that led to its popularity. Zope 3 is based on a component architecture that makes it easy to mix software components of various origins written in Python. Zope 3 is not aiming for backwards compatibility with Zope 2. Instead the Zope 3 component architecture has been backported to Zope 2, and with each release, Zope 2 is gaining more and more of Zope 3's architecture while retaining compatibility with earlier Zope 2 technologies. Also many Zope platforms such as Plone are going through the same type of piece by piece rewriting.

Although originally intended as a replacement for Zope 2, Zope 3 has instead been re-focused on providing multiple independent infrastructure components, while other projects like Zope 2, Grok and lately repoze.bfg would become one project focused on providing web application server frameworks based on Zope 3 components. An ancillary goal is to reduce confusion about what exactly "Zope" is.

The first production release of the new software, Zope X3 3.0.0, was released on November 6, 2004. The current production release, Zope 3.4.0, was released on January 30, 2009. The main effort for Zope 3.4.0 was so called "Eggification", the splitting up of all the separate pieces of Zope 3 in to separate packages, usable and releasable separately. This means new versions of Zope 3 is released almost continuously. Developers tend to use the last version of all packages and simply fix the versions on release. Official releases has therefore become less useful, and the last official release is still 3.4.0. And although it's almost a year old, this should not be misunderstood as that the software isn't developed and bugfixed.

Grok

In 2006 the Grok project was started by a number of Zope 3 developers who wanted to make Zope 3 technology more agile in use and more accessible to newcomers. Grok has since then seen regular releases and its core technology (Martian, grokcore.component) is also finding uptake in other Zope 3 and Zope 2 based projects.

Five and the Future of Zope

The Five project is a Zope 2 extension that allows usage of Zope 3 technologies within Zope 2, hence the name Five, as 2 + 3 = Five.

Originally released separately, Five has become an integral part of the main line of Zope 2 development. Five 1.0 was integrated with Zope 2 starting with Zope 2.8.0. Each successive Zope 2 release has integrated more of the features of Zope 3. Starting with Zope 2.12 Zope 2 has also been "eggified" and is now using the same separate Python packages as Zope 3 is using. This further enables a gradual transition where you use less Zope 2 modules and more Zope 3 modules in the software, a path planned for the Zope 2 based Plone content management system.

Zope Page Templates

As mentioned previously, Zope Page Templates are themselves XHTML documents which means they can be viewed and edited using normal HTML editors or XHTML compliant tools (a big advantage compared to other template languages used for web applications). Templates can also be checked for XHTML compliance so you can be fairly confident that they will automatically expand into proper XHTML.

However, these page templates are not meant to be rendered as is. Instead they are marked up with additional elements and attributes in special XML namespaces (see below). This additional information is used to describe how the page template should ultimately be processed.

Here are some basic examples. To conditionally include a particular element, like a div element, simply add the tal:condition attribute to the element as follows:

<div tal:condition="...">
  ...
</div>

To control what appears inside an element, use the tal:content attribute like this:

<h1><span tal:content="..."/></h1>
...

Finally, to introduce or replace values of attributes use the tal:attributes attribute as follows: The power of python could also be utilised to dynamically alter the href at runtime.

<a href="" tal:attributes="href python:'http://someurl.com/%s'%someobject">...</a>

This is a very cursory explanation of Zope Page Templates. The behavior of Zope Page Templates is almost completely described by a template language, fixed on TAL, TALES, and METAL specifications:

Zope Management Interface

The Zope application server features a web-based management interface that enables an administrative user to change many aspects about the way Zope behaves. It was this ease of customizability that gave Zope both its popularity and its infamous shortcomings described above.

See also

References

  1. ^ Guido van Rossum Leaves Zope.com

External links


Wikibooks

Up to date as of January 23, 2010

From Wikibooks, the open-content textbooks collection

Zope is an open source Web server built on top of Python. It is most commonly used for the content management systems Plone and CPS and the enterprise resource planning system ERP5. This textbook will help you install and operate a Zope server.

Contents

Installation

Zope Win32 binaries and source code can be downloaded at the Zope Web site.

Windows

From the above page, download the file Zope-x.x.x-x-win32-x86.exe, where "x.x.x-x" is the version of Zope you want, such as 2.7.2-0. When the file is finished downloading, execute it. An installer should begin running.

A welcome screen should pop up. Click "Next", and after reading the Zope Public License, click "Next" again. This brings you to a prompt asking you for a Zope site name. You can select any alphanumeric name you wish, although "Zope" is a reasonable default.

You will then be asked to confirm the installation directory (by default C:\Program Files\Zope), and select an administrator username and password. For security reasons, it is highly recommended that you change these from the initial settings, as the Zope administration interface can be accessed over the Internet!

After clicking "Next" on this final screen, Zope will install itself into the specified directory and ask whether you want it to run as a service or if you would like to start it manually. If the system is not Windows NT–based (this includes Windows 2000 and XP), the only choice will be to run it manually.

Unix and Linux

Debian/Ubuntu using Debian packages

Get the zopex.x package, where "x.x" is the version of Zope.

After downloading and installing, there is no instance of Zope running or runnable yet; the Debian package provides a tool for configuring instances, dzhandle, which can be run from the shell. dzhandle can be used to make and remove Zope instances and to configure existing instances. To run it, you might need to be root.

To create a new instance, this syntax is used:

dzhandle -z <zope-version> make-instance -m <mode> -t <technique> -r <restartmode> -u <initialusername:password> [--service-user <system user> --service-port <port>] <instance name>

For further information, consult the dzhandle manpage.

This can be used to start an instance:

dzhandle zopectl <instance name> start

Building from source

After downloading the Zope source code, switch users to root using the su command. Change directories to the location in which you saved the archive, and untar the archive:

$ tar zxf Zope-x.x.x-x.tgz

where "x.x.x-x" is the version of Zope you downloaded, such as 2.7.2-0.

Change into the directory created by the archive extraction (usually Zope-x.x.x-x) and run the ./configure script. Assuming that you have the Python interpreter, the installation will be configured and the script will then ask you to run make. Execute the command,

does make ask questions during install?

and then make install.

By default, the Zope binary directory will be /opt/Zope-x.x, and the Zope data directory will be /usr/local/zope.

Getting Started

start Zope

Zope initially runs on port 8080 (9673 on Debian systems due to a port conflict). Therefore, you can test your server by opening your favorite Web browser and typing "http://localhost:8080/" into its location box. A Zope introductory page should load. If you get a "connection refused" error, make sure that Zope is actually started (a simple Ctrl-Alt-Del on Windows or ps aux on Unix and Linux should be enough for you to determine whether or not it is running).

The first thing you will want to do is log on to the Zope Management Interface, which is linked to near the bottom of the page. You will be asked for your administrative username and password, and then given access.

Using Zope with Apache

There are two methods of forwarding Zope information through Apache: mod_proxy and mod_rewrite. Some more notes are here.








Got something to say? Make a comment.
Your name
Your email address
Message