Chapter 1: Introducing Zope

This chapter explains what Zope is and who it's for. It describes in broad strokes what you can do with Zope. You also learn about the differences between Zope and other web application servers.

What Is Zope?

Zope is a framework for building web applications. A web application is a computer program that users access with a web browser over the Internet. You can also think of a web application as a dynamic web site that provides not only static information to users but lets them use dynamic tools to work with an application.

Web applications are everywhere, and web users work with them all the time. Common examples of web applications are sites that let you search the web, like Yahoo, collaborate on projects, like SourceForge, or communicate with other people over e-mail, like HotMail. All of these kinds of applications can be developed with Zope.

So what do you get when you download Zope? You actually get a lot of things. Zope consists of several different components that work together to help you build web applications. Zope comes with:

A Web server
Zope comes with a built in web server that serves content to you and your users. Of course, you may already have an existing web server, such as Apache or Microsoft IIS and you may not want to use Zope's. Not to worry, Zope works with these web servers also, and any other web server that supports the Common Gateway Interface (CGI).
A Web based interface
When you build web applications with Zope, you use your web browser to interact with the Zope management interface. This interface is a development environment that lets you do things like create web pages, add images and documents, connect to external relational databases and write scripts in different languages.
An object database
When you work with Zope, you are mostly working with objects that are stored in Zope's object database. Zope's management interface provides a simple, familiar way to manage objects that resembles the way many common file managers work.
Relational integration
You don't have to store your information in Zope's object database if you don't want to, because Zope works with other relational databases such as Oracle, PostgreSQL, Sybase, MySQL and many others.
Scripting language support
Zope allows you to write web applications in a number of different languages, like Python, Perl, and Zope's own Document Template Markup Language (DTML).

These are just some of the compelling features that have made Zope so popular for developing web applications. Perhaps Zope's best feature of all is its friendly, open source license. This means that not only is Zope free of cost for you to download, but you are also free to use Zope in your own products and applications without paying royalties or usage fees. Zope's open source license also means that all of the "source code" for Zope is available for you to look at, understand, and extend. Zope does not lock you into a proprietary solution that could hold you and your web users hostage.

From a business perspective, there are three key ideas to understanding what Zope can do for you: powerful collaboration, simple content management, and web components. The following sections are mostly oriented towards business people making decisions about Zope, so if you are interested in jumping right in, skip to the next chapter, Using Zope.

Powerful Collaboration

Years ago, Zope's core technologies were designed by Zope Corporation for an Internet Service Provider that provided web pages for newspapers. These newspapers in turn wanted to provide web pages for their customers. To scale in this environment, Zope was designed to safely delegate control to different groups of users at any level in the web site. Safely delegating control means considering these things:

  1. Presenting information in an easy to understand way. Most people understand clicking on folders better than issuing database commands, so Zope uses an interface that resembles a simple file manager, like Microsoft Windows Explorer and other popular file managers.
  2. Command line tools can be difficult to use and people are generally more comfortable using web browsers, so Zope was designed to be used almost exclusively through a web browser.
  3. Collaborative environments require tools to allow users to recover from their mistakes and to work without interfering with each other, so Zope has Undo, Versions, and other tools to help people work safely together.

These features make Zope an ideal environment for programming and authoring web content by groups and sub-groups of users.

Simple Content Management

Many web applications are traditionally built in three layers. Data and other information is stored in databases, the programs that drive the behavior of the application are stored in files in one location, and the HTML and other layout and presentation information is stored somewhere else.

While this has advantages, it also has disadvantages. Different kinds of tools and expertise must be used to work with the different components. All the different components may need to have their own kind of security and maintenance concerns. Many of these kinds of tools are not manageable from a web browser or from simple command line or GUI tools like FTP.

In Zope, all of these components are brought together into one coherent system. All require a common set of services: security, web-based management, searching, clustering, syndication and others. By bringing together all of these concepts into one manageable system, Zope enables you to use one set of skills and one set of tools to develop complex web applications. In addition, centralizing our model means Zope can more easily work with other external tools, like relational databases, GUI web editors, and other systems that can inter-operate with Zope.

Web Components

The Web is a growing, dynamic platform. The web has evolved enough standards and APIs that creators of services, products, and technology can think in terms of the web as an architectural model to develop their applications around, instead of just a means of distributing static HTML documents to users.

Evidence of this is sprouting up in many locations. Microsoft's .NET architecture envisions a world of web components running on remote systems, providing specific services to applications around the world. Frontier, by UserLand Software, pioneered a simple web services protocol called XML-RPC to allow web components to communicate with each other (Zope also works with XML-RPC, which is discussed in Chapter 10, "Advanced Zope Scripting"). With web components, the model of a person sitting in front of the browser is no longer the only model of the web.

Zope History

In 1996 Jim Fulton, the CTO of Zope Corporation and Python guru, was drafted to teach a class on CGI programming, despite not knowing much about the subject. Jim studied all of the existing documentation on CGI on his way to the class. On the way back from the class, Jim considered what he didn't like about traditional CGI based programming environments: its fragility, lack of object-orientation, and how it exposes web server details. From these initial musings, the core of Zope was written on the plane flight back from the class.

Zope Corporation went on to release three open source software packages to support web publishing, Bobo, Document Template, and BoboPOS. These package were written in Python. They have evolved into core components of Zope providing the web ORB (Object Request Broker), DTML scripting language, and object database. Zope is still mostly written in Python with a few performance-critical sections in C.

Back then, Zope Corporation had developed a commercial application server based on their three open source components. This product was called Principia. In Novermber of 1998, investor Hadar Pedhazur convinced Zope Corporation to open source Principia. This became Zope, which was given its own home at Zope.org.

Who Can Benefit from Zope?

It takes a lot of people working together to create web services. To manage and coordinate these people on large-scale sites can be a difficult task. We've identified some common roles in this scenario to be aware of:

Zope is a platform upon which Site Developers create services to be turned over to Site Designers and Business Users, and Component Developers distribute new products and services for Zope users world wide.

Zope can install Zope products that are focused on different audiences. For instance, Squishdot is a popular weblog, written in Zope, that is useful right out of the box. Squishdot users won't necessarily see that Zope is underneath. Other Zope products, such as Zope Corporation's Content Management Framework, take the same approach, targeting audiences that need not know of Zope's existence underneath.

How Can You Benefit From Zope?

We've looked at the Zope philosophy and architecture, now let's survey some of of the applications of Zope. All sites solve different problems, but many sites tackle a set of common issues daily. Here are some of the main uses of Zope:

To Present Dynamic Content
You want to tailor your web site's presentation to its users, integrate information in databases and provide users with searching. You'd also like to make your web site automate and facilitate your business processes. Can your web site react intelligently to visitors in order to provide a compelling experience? Zope allows you to make every page dynamic. It comes with facilities for personalization, integrating information in databases and searching.
To Manage your Web Site
A small web site is easy to manage, but a web site that serves thousands of documents, images and files needs to provide powerful management tools. Can you manage your site's data, business logic and presentation all in one place? Can you keep up with your content, or is it getting out of hand? Zope gives you simple and powerful tools for handling gigabytes of web content. You can manage your logic, presentation and data all from your web browser.
To Secure Your Web Site
When you deal with more than a handful of web users, security becomes very important. It is crucial to organize users and be able to safely delegate tasks to them. For example, folks in your engineering department may need to be able to manage their web pages and business logic, designers may need to update site templates, and database administrators need to manage database queries. Can your system handle thousands of users, perhaps linked to your existing LDAP or other user databases with flexible security rules? Zope allows you to scale your site to thousands of site managers and millions of visitors. You can simply control security policies and safely delegate control to others.
To Provide Network Services
Right now most web sites serve users, but soon web sites will need to serve remote computer programs and other web sites. For example, you'd like to make your news items automatically available to wire service web sites. Or maybe you want to make products for sale on your site automatically searchable from a product comparison site. Can you leverage your existing data and business logic to create network services or will you have to start over from scratch? Zope's built-in support for networking makes every Zope site a network service. Your business logic and data can be accessed over the web via HTTP and XML-RPC.
To Integrate Diverse Content
Your content is strewn all over the place, in relational databases, files, web sites, FTP archives, XML. Can you unify your data into one coherent application? Does your system support web standards so that you can integrate content from legacy systems and new systems that you will add in the future? Zope supports web standards allowing you to use your existing data, infrastructure and filesystems.
To Provide Scalability
So you struck it rich and now you're getting more hits than you ever imagined. Now you need to handle a dramatically greater level of traffic than before. Can you move your site to a different database and server platform and spread the load across multiple servers? Can your web site grow to handle your success? Zope allows your web applications to scale across as many machines as necessary to handle your load. Zope makes it possible to maintain a small site that can turn into a huge site overnight based on its "ZEO" technology (see Chapter 13, "Scalability and ZEO" for more details).

What Zope Gives You

Let's take a closer look at the Zope features that allow you to build and manage dynamic web sites.

Unique Management Environment
The first thing you'll notice about Zope is that it lets you manage your site's data, logic, and presentation right in your web browser. This means that Zope is easy to use and is remotely administrable. Zope lets you collaborate with others to interactively develop your web site.
Built-in Tools
Zope comes with site management tools, a web server, a search engine, database connectivity, security and collaboration services, and more. Out of the box, Zope gives you everything you need to build a powerful web site.
Open Standards Support
Zope excels at gluing together diverse data because of its support for open standards. Zope supports Internet standards including SQL, ODBC, XML, DOM, FTP, HTTP, FastCGI, XML-RPC, SOAP, and more.
Open Source Licensing
With Zope you don't just get an application, you get the source and a community. Since Zope is open source you are not held hostage by a single vendor; you're free to use, distribute and adapt Zope to fit your needs. Zope also benefits from an active user and developer community. The community improves Zope's support, audits Zope's security, fixes bugs, and adds features.
Extensibility
Zope can be extended in many directions. Third party applications can be easily created and distributed. The Zope community has produced hundreds of Zope add-ons for everything from credit card processing to web discussions.

Zope Alternatives

There are many tools available to help you build web applications. Early in the history of the web, simple web applications were built almost exclusively with CGI programs written in Perl or other languages. Now there are a host of options ranging from open source frameworks like PHP, to commercial options such as Allaire's Cold Fusion, Java application servers, and Vignette's Story Server.

Zope offers a unique mix of features, some similar to, and some very different from, features offered by other web application tools. Zope is easy to use, open source, powerful, and provides support for many different kinds of applications. Here is a short list of common web tool drawbacks and Zope's advantages:

Zope Community

Zope was one of the first tools of its kind to become open source. Since opening up the code to Zope, the user base has grown tremendously.

The Zope community consists of Zope users and developers. Many of the community members are professionals such as consultants, developers and web masters, investing their time and money into supporting Zope. Others are students and curious hackers, learning how to use a cool new tool. The community gets together occasionally at conferences but spends most of its time discussing Zope on the many Zope mailing lists and web sites. You can find out more about the many Zope-related mailing lists at http://www.zope.org/Resources/MailingLists.

Now that you've learned about Zope's features and history, it's time to start using it. In the next chapter you'll learn how to get up and running with Zope. Since Zope is free, you can download the latest version, and begin working immediately.