The Zope Management Interface (ZMI)

     

When you installed the Plone package, you also created a manager account, used not only for the management of Plone, but also for authenticating yourself as the manager of the Zope application server itself. The Zope Management Interface (ZMI) is the web-based environment that presents itself to you when you access http:// zopeserver :8080/manage , as shown in Figure B.1.

Figure B.1. The Root folder Zope Management Interface.
graphics/ap02fig01.jpg

Note

The view in Figure B.1 is of the Root folder of Zope. This is the starting point of the application, so to speak. You will see this view upon logging in or when you click on the Root Folder link in the navigation pane.


What might look to you like a web-based document tree is actually a representation of the Zope object hierarchy. Objects in Zope are stored in the Zope Object Database (ZODB), also known as the really important file called Data.fs that you want to make sure you never delete from your filesystem. The ZMI is a window into the ZODB; folder objects are shown, as are document objects within the folders, objects that are snippets of text or Python scripting, and so forth.

In Zope, everything is an object, and in the ZMI, every object is a manageable element. Selecting a check box next to a folder icon and clicking the Rename button takes you to a form that modifies the attribute of that folder object. It might seem to you that you're simply changing the name of something, and although that's true, you can get fancy and refer to it as modifying an attribute of an object whose state has now changed.

The Zope Management Interface is frame based, which is not the greatest usability feature in a website, but it actually works quite well in this sort of administrative environment. These are the three frames :

  • Navigator frame , the leftmost frame. It is used to expand and contract the overall object hierarchy.

  • Workspace frame , the rightmost frame. It is used to display the different views of the object you have selected from the Navigator frame. Any actions that you perform occur in this Workspace frame; this includes adding, removing, and renaming products; performing security tasks ; administering the databases and other products; and so forth.

  • Status frame , the top frame. It simply displays the name of the logged-in user and provides a few quick links, such as Set Preferences or Logout, specific to the user and the ZMI.

The following subsections provide a more detailed look at each frame in the ZMI and show you some basic tasks that greatly improve the quality of life for web application managers who use Zope.

The ZMI Navigator Frame

The leftmost frame in the ZMI is the Navigator frame. This frame shows the object hierarchy of your Zope installation, and all elements are clickable. Figure B.2 shows an example of the elements in a navigation frame.

Figure B.2. Example of the ZMI Navigator frame.
graphics/ap02fig02.jpg

The Root folder is where all things begin; it's the topmost container element in the Zope object hierarchy and holds all other elements. Clicking the Root folder populates the Workspace frame with the folders and files that live inside it, many of which are part of the Navigator frame already because they are high-level folders. Control Panel, Plone, and myPlone are examples of folders in this figure.

Any time you see a plus mark next to a folder, you can click on it to expand its contents within the Navigator frame. Similarly, a minus mark indicates that the folder is expanded; clicking on that mark contracts it back to its closed state. Expanding a folder does not show its contents in the Workspace frame. Only clicking on an item in the Navigation frame populates the Workspace frame with something meaningful.

The ZMI Workspace Frame

The rightmost frame in the ZMI is the Workspace frame, and all the fun happens in this frame. The Workspace frame shows you all the information about the element you have clicked in the Navigation frame, and it enables you to perform requested actions initiated in either the Navigation frame or the Workspace frame. Figure B.3 shows an example of the elements in the Workspace frame after clicking on the Root folder in the Navigation frame.

Figure B.3. Example of the ZMI Workspace frame.
graphics/ap02fig03.jpg

In the body of the Workspace frame, you can see the individual objects that are present within the Root folder object. For example, the error_log object is part of the Root folder. Clicking on the error_log object populates the Workspace frame with the configuration options for this object, such as how many exceptions to keep in the log.

Across the top of the Workspace frame are several tabs. Each of these tabs performs a specific task on the object you are viewing. For example, if you clicked on the Root folder in the Navigation frame, the tabs in the Workspace Frame are relevant to the Root folder object. Similarly, after you select the error_log object from the Workspace Frame, the actions following those tabs are relevant to that object.

The Status Frame

The Status frame is quite simple, as shown in Figure B.4.

Figure B.4. Example of the ZMI Status frame.
graphics/ap02fig04.jpg

Besides displaying the name of the logged-in user, the drop-down menu provides a few useful quick links:

  • Zope Quick Start ” Displays the appropriately named Quick Start page. The Quick Start page has numerous links to the main Zope site, Zope documentation, and much more.

  • Set Preferences ” Enables you to modify the frames and some of the other template elements used in the ZMI.

  • Logout ” Logs you out of Zope and the ZMI.

With the third of the three frames out of the way, the next section provides some insight to working with the objects displayed in the ZMI.

Working with Objects in the ZMI

Adding objects to your Zope instance is so easy that it's almost an absolute joy to do. With the ZMI open and the Workspace frame in front of you, look for the drop-down list with the Add button next to it. This is called the Add List, and it's your quick tool for adding almost anything you can think of to your Zope instance. Want to add a folder object, an image object, a Plone object, a blog, or a wiki? You can do it all from this drop-down list.

To test the process of adding an object via the ZMI, click on the Root folder in the Navigation pane; then select Folder from the drop-down list and, in the Workspace pane, press the Add button. This adds a folder within the Root folder. The Workspace pane now contains a form so that you can add information about your new folder object, as shown in Figure B.5.

Figure B.5. Adding a folder object via the ZMI.
graphics/ap02fig05.gif

This form shows two attributes that need to be populated with values: Id and Title . In this example, the folder object has an Id attribute value of test_folder and a Title attribute value of Test Folder . After you press the Add button, this object is created and placed in the object hierarchy. You now can navigate to it via the Navigation frame.

Clicking the test_folder object in the Navigation frame populates the Workspace frame with its contents, of which there are none. However, if you select DTML Document from the Add list and press the Add button, the Workspace frame is populated with the form used to add a DTML Document object.

Tip

A DTML Document is an object that can hold HTML, XML, plain text or structured text, and DTML scripting tags. For more information on DTML, read Appendix A, "DTML Reference," of The Zope Book : http://zope.org/Documentation/Books/ZopeBook/2_6Edition/AppendixA.stx.


The possible attributes for a DTML object are Id and Title . The File field is present for ease of use, if you want to import data from an existing file. Enter an Id for your DTML object, such as testdoc.html , and a Title , such as Test Title. This is the second form in two examples that required an Id attribute, and for good reason: The Id becomes part of the URL to the item. In this example, I've created a sample DTML Document object inside a folder object, as shown in Figure B.6. The URL to this object is http://zopeserver/test_folder/testdoc.html. Notice the use of the Id attributes for each object.

Figure B.6. Successfully adding a DTML Document object.
graphics/ap02fig06.gif

You will notice that although I didn't perform an action in the ZMI related to entering text into this DTML Document object, there is indeed a title and a string of text present in the object. This is part of the standard template for the object. To actually edit the object, expand the test_folder object in the Navigation frame and then click on the testdoc.html object in the Workspace frame. You will see a form with a text area in which you can type the content for this object, in any of the markup types discussed previously.

The process of modifying objects is as easy as the process of adding them. In fact, the format is quite similar, in that you have a form field labeled with the attribute name prepopulated with the existing information. So, if you click on the test_folder object in the Navigation frame and then select the Properties tab within the Workspace frame, you see a field called Title populated with the string Test Folder . The Id is not modifiable in this view; you change the Id through the Rename action.

The Rename action is available to you in the Workspace frame, such as when you click the test_folder object in the Navigation frame and see the list of objects within the Workspace frame. Selecting the check box next to the testdoc.html DTML object and then pressing the Rename button displays a form that enables you to change the Id attribute of that object.

When viewing objects in a list such as the one described earlier, other important actions are available to you:

  • Cut places the selected object on the Clipboard for pasting later. The object is not removed from its existing location until it is pasted somewhere else.

  • Copy places the selected object on the Clipboard for pasting later.

  • Paste places cut or copied objects into their new locations. The name copy_of_ objectname is used if you paste an element in the same location as the original item. You can't have two objects with the same Id attribute in the same location ”in Zope or in any directory structure.

  • Delete removes objects completely.

You can cut, copy, delete, and rename objects anywhere except the Control Panel, the browser_id_manager object, and the temp_folder object. Other items in the Root folder can be cut, copied, removed, or renamed , but it's not recommended unless you know what you're doing and have a good reason to make the changes. If you want to play around with Zope, make a bunch of folders and have at it.

The next section covers a very important aspect of content management, the value of the Undo feature.

Undoing Actions

How many times have you yelled "Undo! Undo!" after inadvertently deleting something, as if yelling the command would magically fix the error? With the ZMI, you can Undo any action (even an Undo action) without the yelling, and with success. In Figure B.7, I have accessed the Undo tab within the Workspace frame after selecting the Root folder from the Navigation frame. As such, all of the Undo-able actions listed are Zope-wide.

Figure B.7. The list of actions that can be undone.
graphics/ap02fig07.jpg

Tip

Had I selected the Undo tab after selecting just temp_folder from the Navigation frame, I would have seen only the actions that were performed on the temp_folder object.


If you select the fourth item in the list:

 

 /test_folder/addDTMLDocument by jcmeloni 

and press the Undo button, the action is undone. Because this action was to add the DTML Document object called testdoc.html , undoing the action removes the document. If you decide that wasn't what you wanted to do, you can also undo the Undo action.

When you perform an Undo action, it is logged just like any other action. As such, it is an entry that is available for selection under the Undo tab. If you select it and press the Undo button, it reverts the object to the state before the Undo occurred. In other words, the DTML Document object called testdoc.html reappears.

The Undo action has its limitations: You cannot undo an action when a subsequent action depends on it, and you can go only one step backward at a time when the actions were performed in the same object. In addition, you can select the entire series of actions and press the Undo button, to achieve the same result.

The Undo feature is useful when multiple people are modifying the same content, and perhaps someone has placed content into an object that shouldn't be there. Not only can you undo the action, but you also can use the History feature to see who added the bad content and when.

Object History

The history of an object shows the time and type of actions performed on an object, as well as who performed the actions. Figure B.8 shows the history of the DTML Document object called testdoc.html .

Figure B.8. The history of an object.
graphics/ap02fig08.gif

This history shows that the object was first created, then renamed, and then edited. At this point, you could select any one of the actions and press the Copy to Present button, which essentially reverts the state of the object to the state it was in before the selected action was completed.

If you're not entirely sure of the changes that have been made, or if you simply want to compare two different versions of the object, you can select two revisions and press the Compare button. This action shows a diff between the versions (see Figure B.9). You then can decide whether the state should be reverted or whether you simply want to make a few edits to the current version.

Figure B.9. Diff between revisions.
graphics/ap02fig09.gif

Note

A diff shows the difference between two items. New lines are preceded by a plus sign (+), while lines that have been removed are preceded by a minus sign ([nd]). Any changes within a line are noted with an exclamation point (!).


Here ends the quick trip through the Zope Management Interface. The ZMI is by far one of the best management interfaces out there in terms of ease of use and number of tasks performed ”not to mention the price (or lack thereof). The final section of this appendix points you in the right direction to find more information about Zope.



Plone Content Management Essentials
Plone Content Management Essentials
ISBN: 0672326876
EAN: 2147483647
Year: 2003
Pages: 107
Authors: Julie Meloni

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net