You are not logged in Log in Join
You are here: Home » Members » shalabh » Mozilla » The Zope IDE Experiment » ZIDE: Under the Hood

Log in
Name

Password

 
 

Background

Gather some basic knowledge about RDF and XUL, and how they can be used in Zope (unless you already have). Links follow:-

From zope.org: Look at everything under The Zope Mozilla Initiative
From mozilla.org: RDF in mozilla | The XPToolkit Project.

How it works

File List

This is a list of all the files (objects) and a brief description about what each does:-

ObjectDescription
thisitemRDF Produces a snippet of RDF for the object in context. This RDF contains one Description element which descibes this object only. Even when the object is a folder, the RDF does not contain information about the contained objects.
contents.rdf Produces an XML-RDF document for this object which includes all the contained objects as well. Useful only in context of folderish objects. Uses 'thisitemRDF' to generate snippets of information about contained objects.
You can look at the RDF produced by this for any object by pointing your (non-mozilla) browser to http://my.zopeinstall.com/path/to/object/contents.rdf
zide.xul The XUL file defining the user interface.
zide.js The javascript file.
itemiconcss Produces a snippet of CSS which identifies an icon with a tree-item of specific id. Recursive so that it produces the CSS for all folderish objects under the one in context.
main.css Produces a CSS StyleSheet with formatting options. Includes the icon image definition produced by 'itemiconcss'.
itemiconcss Produces a snippet of CSS which identifies an icon with a tree-item of specific id. Recursive so that it produces the CSS for all folderish objects under the one in context.

In addition, two required files from Management tree in Mozilla : tree.rdf and itemRDF are used to produce RDF for all folderish objects for the tree-view. itemRDF is recursive and produces RDF snippet for contents of the entire subtree below the object in context. tree.rdf wraps up itemRDF of the root folder. itemRDF differs from thisitemRDF as itemRDF is recursive, i.e includes itself for all its folderish contained objects.

Working

Hopefully, now you have some idea about how the thing works (assuming you've read the File List descriptions).

Mozilla loads up zide.xul which has two main widgets. A tree on the left (call this zm-treeview) and a tree on the right for showing the contets list (call this zm-contentsview). The zm-treeview widget has http://zoperoot/tree.rdf as its datasource. This never changes. The datasource for zm-contentsview is initially set at http://zoperoot/contents.rdf. When the user clicks on treeitem in zm-treeview, code in zide.js changes the datasource of zm-contentsview to http://zoperoot/path_of_selected_folder/contents.rdf. Mozilla magic does the rest.

Design Flaws

  1. The two widgets use some common data but use different data sources :tree.rdf and a set of contents.rdf. These contain common information but produced separately. It is possible for a widget to use multiple data sources and for differnt widgets to use the same data source, hence data should not be replicated by two different data sources.
  2. The stylesheet identifies icons for a tree with the 'id' attribute. They should be identified with 'class' or 'type' information.

The Future

To Do List
  1. Fix design flaw #1: One way to do this is that the folder-view tree also use the contents.rdf data sources. It can load up the root contents.rdf initially and then keep adding data sources of subfolders as the user expands them.
  2. Functionality: Double-click folder items in the contents-view list to open the folder and also set focus in tree-view.
  3. Functionality: Right-click items in any view for viewing detailed properties about the object in another box.
  4. Investigation: Find out how to get mozilla to refresh a data source so that if the source data has changed, the changes are reflected in the widget.
Possible Directions
  • The xul, css and js files can be moved to the 'chrome' folder in the mozilla tree, instead of keeping them in the zope installation.