Developer's Guide

  • Docs Home
  • Community Home

1. Overview of the Zenoss UI Technologies

The Zenoss user interface is built on top of Zope. Zope provides a framework on which progressively more sophisticated functionality can be built. (NB: As this introduction is necessarily brief, it should not be treated as technically correct in every detail, but as being generally believable.) You can layer the user interface using multiple technologies, as well as mix and match:

  • HyperText Markup Language (HTML)

  • Cascading Style Sheets (CSS)

  • Zope 2, Zope Page Templates (ZPT) and the Template Attribute Language (TAL)

  • ZPT and Macro Expansion for TAL (METAL)

  • JavaScript/AJAX

  • Yahoo User Interface (YUI) Library and Mochikit

1.1. HyperText Markup Language (HTML)

HTML is the most basic formatting language available on the Web, and some version of HTML is understood by every Web browser. HTML is in practice a sloppy variant of eXtensible Markup Language (XML) which divides up a page into elements (tags such as title, head or h3) and content (for example, the things that you actually care about).

If you are converting an existing Web page, verify it by using the free HTML validation service at:

http://validator.w3.org/

1.2. Cascading Style Sheets (CSS)

Web browsers take HTML and convert elements like h1 (heading at level 1) and convert them into what each browser thinks is appropriate for that element. That 'each browser' part means that the way that the page displays is different on each browser. Style sheets are a way for the web page designer to tell the browser that a certain element should have a certain style. As an example the h1 element could be styled "Arial, 20pt, neon lime green and make it blink". (Use the power responsibly! :)

The 'cascading' part of CSS means that stylesheets can build on each other. Practically, that means that the order in which you load CSS information can lead to different results.

1.3. Zope 2, ZPT and TAL

Zope 2 is essentially a Web server with brains. The brains part are the Python programming language and the object-oriented database (ZODB), which are used to create Web pages in a structured way.

Note

There is a Zope 1 and also a Zope 3. Zope 1 is dead, and a large portion of the Zope community is migrating to or has migrated from Zope 3. Zope 2 and Zope 3 are quite different, and a considerable amount of effort would be required in order to convert Zenoss to Zope 3. Keep it in mind when looking at Zope material that you need Zope 2.

Zope Page Templates are in essence HTML pages which are well-formed (ie not sloppy HTML where you only need to care about creating a starting element) with extra XML attributes (ie the bits after the element name in-between the < and > characters). The extra XML bits (attributes) are not a part of any HTML standard and are ignored by HTML editors, meaning that ZPT pages live happily with HTML. These attributes and the programming functionality that they deliver are called the Template Attribute Language (TAL).

The TAL attributes allow you, the web page creator, to add dynamic content using information from inside the Zope database (ZODB). From a Zenoss perspective, this allows you to write a query that you can use to build a table, or show different items depending on what objects or devices exist in a particular state. In other words, TAL is the Zope way of accomplishing what you would normally need to do in a CGI inside of a plain web server like Apache.

It should be noted that inside of TAL it is also possible to use a restricted subset of Python. The restrictions include not being able to load certain standard libraries, as well as operations like reading and writing to disk. This is done intentionally for security reasons.

1.4. ZPT and Macro Expansion for TAL (METAL)

TAL is the programming language of Zope, allowing you to use parts of the database and programmatically work with data. This is good, but because TAL is hidden away inside of HTML, there's no way to reuse blocks of HTML and TAL for your site just by using TAL. In order to re-use chunks of HTML and TAL in an easy-to-use fashion.

1.5. JavaScript / AJAX

Let's get one thing out of the way: Java and JavaScript only share the 'Java' part, and that's only for marketing reasons. Really. They're totally different. Technically, JavaScript is actually called ECMAScript, but that's something that's much worse than JavaScript so everyone calls it JavaScript.

JavaScript can be written directly on the web page inside of a script element anywhere in an HTML page, or it can be stored on a server and accessed from a script element using the name specified in the src attribute.

So what's the AJAX part? Originally, AJAX was shorthand for "Asynchronous JavaScript And XML", a set of techniques for writing JavaScript. So AJAX is a state of mind rather than a standard. Generally, something is considered AJAX if it uses the JavaScript XMLHttpRequest() function to retrieve data from a server and presents the returned XML document in a interactive way to the user.

1.6. JavaScript libraries: YUI and MochiKit

There are a number of classes to make life programming in JavaScript easier. The ones that are implemented in Zenoss are:

Yahoo User Interface (YUI)

YUI is a collection of CSS templates and JavaScript utilities that create a cross browser-compatible toolkit. This is quite an achievement considering the many issues with how each browser implements (or doesn't) different features.

MochiKit

MochiKit provides a set of low-level facilities to perform GUI functions.