[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/rotterdam - __init__.py:1.1 add.pt:1.1 configure.zcml:1.1 dialog_macros.pt:1.1 folder_contents.pt:1.1 logo.gif:1.1 mi.gif:1.1 pl.gif:1.1 service_manager.pt:1.1 standardmacros.py:1.1 template.pt:1.1 view_macros.pt:1.1 xmlobject.py:1.1 xmltree.js:1.1 zope3.css:1.1

Jim Fulton jim@zope.com
Thu, 26 Dec 2002 15:20:50 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/skins/rotterdam
In directory cvs.zope.org:/tmp/cvs-serv32541/src/zope/app/browser/skins/rotterdam

Added Files:
	__init__.py add.pt configure.zcml dialog_macros.pt 
	folder_contents.pt logo.gif mi.gif pl.gif service_manager.pt 
	standardmacros.py template.pt view_macros.pt xmlobject.py 
	xmltree.js zope3.css 
Log Message:
Added the rotterdam skin. The way cool new UI done (well, started)
at the Rotterdam sprinathon.

Modified the skin to reflect the grand renaming.

Also refactored the skins and standard mapping interfaces so we no
longer need IStandardMacros just to say that standard macros have a
__getitem__ method. 



=== Added File Zope3/src/zope/app/browser/skins/rotterdam/__init__.py ===
##

=== Added File Zope3/src/zope/app/browser/skins/rotterdam/add.pt ===
<html metal:use-macro="views/standard_macros/page">
<body>

<div metal:fill-slot="body">

<form action="action.html" method="POST">
<table class="TypeListing" cellpadding="3">

  <caption>Add Content</caption>

    <!--
      ** listAddableInfo returns a sequence of mappings, containing:
      **   'id'    : the ID of the addable type
      **   'title' : the title of the addable type
      **   'description'  : the description of the addable type
      -->
    <tbody tal:repeat="info view/addingInfo">

    <tr>

      <td class="Selector">
        <input type="radio" name="type_name"
               tal:attributes="value info/action; id info/action" />
      </td>

      <td class="TypeName">
        <label style="font-weight: bold;"
               tal:attributes="for info/action">
          <span tal:replace="info/title" >Folder</span>
        </label>
        <div class="TypeDescription" tal:content="info/description">
          Folders are generic containers for content, including other
          folders.
        </div>
      </td>
    </tr>

  </tbody>

  <tbody tal:condition="nothing">

    <tr>

      <td class="Selector">
        <input type="radio" name="type_name" value="" />
               
      </td>

      <td class="TypeName">
        <img alt="Folder" src="../../ZMI/www/document_icon.gif" />
        Document
      </td>

    </tr>

    <tr>
      <td class="Selector"><br /></td>
      <td class="TypeDescription">
          Documents are simple textual content.
      </td>
    </tr>

  </tbody>

  <tr>
    <td><br/></td>
    <td>
        <input type="text" name="id" tal:condition="view/namesAccepted" />
        <input type="submit" value=" Add " />
    </td>
  </tr>

</table>
</form>
</div>
</body>
</html>


=== Added File Zope3/src/zope/app/browser/skins/rotterdam/configure.zcml ===
<zopeConfigure
    xmlns='http://namespaces.zope.org/zope'
    xmlns:browser='http://namespaces.zope.org/browser'
>

<browser:skin
    name="Rotterdam" layers="rotterdam default" />

<browser:resource 
    name="zope3.css" file="zope3.css" layer="rotterdam" />

<browser:resource 
    name="xmltree.js" file="xmltree.js" layer="rotterdam" />

<browser:resource
    name="logo.gif" file="logo.gif" layer="rotterdam" />

<browser:resource 
    name="pl.gif" file="pl.gif" layer="rotterdam" />

<browser:resource 
    name="mi.gif" file="mi.gif" layer="rotterdam" />

<browser:view 
    for="zope.app.interfaces.services.service.IServiceManager"
    name="index.html"
    template="service_manager.pt"
    class="zope.app.browser.services.namecomponentconfigurableview.NameComponentConfigurableView"
    permission="zope.ManageServices" 
    layer="rotterdam" 
    />

<browser:view
    for="zope.app.interfaces.container.IReadContainer"
    permission="zope.View"
    factory=".xmlobject.XmlObjectView">
  <browser:page name="children.xml" attribute="children" />
  <browser:page name="singleBranchTree.xml" attribute="singleBranchTree" />
</browser:view>

<!-- below overrides the standard_macros by Rotterdam Skin -->
<browser:view
    name="standard_macros"
    permission="zope.View"
    factory=".standardmacros.StandardMacros"
    layer="rotterdam"
    allowed_interface="zope.interface.common.mapping.IItemMapping" 
    />

<browser:view 
    name="skin_macros"
    permission="zope.View"
    layer="rotterdam"
    template="template.pt" />

<browser:view 
    name="view_macros"
    permission="zope.View"
    layer="rotterdam"
    template="view_macros.pt" />

<browser:view
    name="dialog_macros"
    permission="zope.View"
    layer="rotterdam"
    template="dialog_macros.pt" />

<browser:view
    for="zope.app.interfaces.container.IContentContainer"
    name="+"
    factory="zope.app.browser.container.adding.Adding"
    permission="zope.ManageContent"
    layer="rotterdam"
    allowed_attributes="addingInfo"
    >

    <browser:page name="index.html"  template="add.pt" />
    <browser:page name="action.html" attribute="action" />
</browser:view>

<browser:view
    for="zope.app.interfaces.content.folder.IFolder"
    permission="zope.ManageContent"
    layer="rotterdam"
    factory="zope.app.browser.container.contents.Contents">

  <browser:page name="contents.html"
                 attribute="contents" template="folder_contents.pt" />

</browser:view>


</zopeConfigure>


=== Added File Zope3/src/zope/app/browser/skins/rotterdam/dialog_macros.pt ===
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html metal:define-macro="dialog">
<head metal:use-macro="views/standard_macros/head" />

<body>
  <span metal:use-macro="views/standard_macros/breadcrumbs" />

  <div metal:define-slot="body">
     <p>Body here</p>
  </div>

  <div metal:use-macro="views/standard_macros/footer" />
</body>
</html>



=== Added File Zope3/src/zope/app/browser/skins/rotterdam/folder_contents.pt ===
<html metal:use-macro="views/standard_macros/page">
<head>
<style metal:fill-slot="headers" type="text/css">
</style>
</head>
<body>
<div metal:fill-slot="commonTasks">
Add new content:<br>
    <tal:block repeat="info context/@@+/addingInfo">
    <a href="#" tal:attributes="href string:${request/getURL}?type_name=${info/title};
                                class info/selected" >
    <div tal:attributes="value info/id|default"
            tal:content="info/title">Folder
    </div>
    </a>
    </tal:block>

</div>
<div metal:fill-slot="body">
<div metal:define-macro="contents">

      <table id="sortable" class="listing" summary="Content listing"
             metal:define-macro="contents_table"
             >
    
        <thead> 
          <tr>
            <th>&nbsp;</th>
            <th>Name</th>
            <th>Title</th>
            <th>Size</th>
            <th>Created</th>
            <th>Modified</th>
          </tr>
        </thead>

        <tbody>
  <tr tal:condition="request/type_name|nothing">
  <td></td>
  <td>
  <form name="addForm" action="+/action.html" method="POST">
  <input type="hidden" name="type_name" tal:attributes="value request/type_name">
  <input name="id" value="">
  </form>
  </td>
  <td></td>
  <td></td>
  <td></td>
  </tr>
  <form name="containerContentsForm" method="get" action="." 
        tal:define="container_contents view/listContentInfo"
        tal:condition="container_contents"
        >


        <metal:block tal:repeat="item container_contents">
          <tr tal:define="oddrow repeat/item/odd; url item/url"
              tal:attributes="class python:oddrow and 'even' or 'odd'" > 
            <td>
              <input type="checkbox" class="noborder" name="ids:list" id="#"
                     value="#"
                     tal:attributes="value item/id;
                                     id python: 'cb_'+item['id'];
                                     checked request/ids_checked|nothing;"/>
            </td>
            <td> 
              <a href="#" 
                 tal:attributes="href 
                                 string:${url}/@@SelectedManagementView.html"
                 tal:content="structure item/icon|default"
                 >
              </a> 
              <a href="#" 
                 tal:attributes="href 
                                 string:${url}/@@SelectedManagementView.html"
                 tal:content="item/id"
                 >foo</a> 
            </td>
            <td><span tal:content="item/title|default">&nbsp;</span></td>
            <td><span tal:define="size item/size/size; label item/size/label;"
                      tal:attributes="size size"
                      tal:content="label">&nbsp;</span></td>
            <td><span tal:define="created item/created|default"
                      tal:content="created">&nbsp;</span></td>
            <td><span tal:define="modified item/modified|default"
                      tal:content="modified">&nbsp;</span></td>
          </tr>
        </metal:block>
  <tr>
  <td colspan="6">
        <input type="submit" name="@@removeObjects.html:method" value="Delete"
             tal:attributes="value string:menu_delete_button"
             i18n:attributes="value" /> 
 </td>
 </tr>
  </form>

        </tbody> 
      </table>
      <br />

      <script tal:condition="request/type_name|nothing"><!--
          prettydump('focus', LG_INFO);
          document.addForm.id.focus();
          //-->
      </script>
</div>

</div>
</body>
</html>






=== Added File Zope3/src/zope/app/browser/skins/rotterdam/logo.gif ===
  <Binary-ish file>

=== Added File Zope3/src/zope/app/browser/skins/rotterdam/mi.gif ===
  <Binary-ish file>

=== Added File Zope3/src/zope/app/browser/skins/rotterdam/pl.gif ===
  <Binary-ish file>

=== Added File Zope3/src/zope/app/browser/skins/rotterdam/service_manager.pt ===
<html metal:use-macro="views/standard_macros/page">
  <metal:block fill-slot="itemHelpTitle">
    ServiceManager
  </metal:block>
  <metal:block fill-slot="itemHelp">
    To configure a service, add a service component to a <em>package</em>
    in <a href="Packages">Packages</a> or to the <a
    href="Packages/default">default package</a>. After the component is
    added, add a service configuration that configures the component to
    provide a service.
  </metal:block>

  <body 
    metal:fill-slot="body" 
    tal:define="services view/update">

  <h2>Services configured in this service manager.</h2>
  <p tal:condition="not:services">
    No services have been configured
  </p>

  <div tal:condition="services">
    <form action="." method="post"
      tal:attributes="action request/URL">

      <table width="100%">
        <tr tal:repeat="service services">
          <td valign="top" align="right">
            <a href="Roles"
              tal:content="service/name"
              tal:attributes="href service/name"
              tal:condition="service/active">
              Roles
            </a>
            <span 
              tal:replace="service/name" 
              tal:condition="service/inactive" />
          </td>
          <td tal:content="structure service/view">
          </td>
        </tr>
      </table>

      <input type=submit name="submit_update" value="Update"><br>
    </form>
  </div>
</body>
</html>


=== Added File Zope3/src/zope/app/browser/skins/rotterdam/standardmacros.py ===
from zope.app.browser.skins.basic.standardmacros import StandardMacros

BaseMacros = StandardMacros

class StandardMacros(BaseMacros):
    __implements__ = BaseMacros.__implements__
    macro_pages = ('skin_macros', 'view_macros', 'dialog_macros')



=== Added File Zope3/src/zope/app/browser/skins/rotterdam/template.pt ===
<metal:block define-macro="page"><metal:block define-slot="doctype"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></metal:block>

<html
  xmlns="http://www.w3.org/1999/xhtml"
  xml:lang="en"
  lang="en" >

  <head>

    <title metal:define-slot="title">Z3 UI</title>

    <style type="text/css" 
           media="all"
           tal:content="string: @import url(${context/++resource++zope3.css});">
      @import url(zope3.css);
    </style>

    <metal:block define-slot="style_slot" />
    <metal:block define-slot="ecmascript_slot" />

    <script type="text/javascript" src="xmltree.js" 
            tal:attributes="src string:${context/++resource++xmltree.js}"></script>
  </head>

  <body onload="loadtree('');"
    tal:attributes="onload string:loadtree('${request/URL/1}/', '${request/URL/-1}/');" >

    <div id="global">
      Global elements
    </div>

    <div id="personal">

      <metal:block define-macro="logged_user">
        User:
        <tal:block replace="request/user/getTitle">
          User
        </tal:block>
      </metal:block>

      (Personal elements)

    </div>

    <div id="breadcrumbs"
         metal:define-macro="breadcrumbs"> Location:&nbsp;<tal:block repeat="breadcrumb context/@@absolute_url/breadcrumbs"><a href=""
          tal:condition="repeat/breadcrumb/start"
          tal:content="string:[top]"
          tal:attributes="href string:${breadcrumb/url}/@@SelectedManagementView.html">XXX should not hardcode root folder name string</a><a href=""
           tal:condition="not:repeat/breadcrumb/start"
           tal:content="string:${breadcrumb/name}"
           tal:attributes="
           href string:${breadcrumb/url}/@@SelectedManagementView.html">breadcrumb item</a>/</tal:block></div>


    <div id="navigators">

      <div class="box" id="navigationTree">

        <h3>Navigation</h3>

        <div 
          xmlns="http://www.zope.org/zope3xmltree"
          id="navtreecontents" 
          class="body" 
          onclick="treeclicked(event);" 
          onmouseover="mouseOverTree(event);"
          onmouseout="mouseOutTree(event);"
          >
        </div>

      </div>


      <div class="box" id="commonTasks">

        <h3>Common Tasks</h3>

        <div class="body">

          <div class="content odd">
            testing testing
          </div>

          <metal:block define-slot="commonTasks">

          </metal:block>

          <div class="content even">

            and some more

          </div>

        </div>

      </div>

    </div>


    <div id="content">

      <div class="itemViews"
           metal:define-macro="zmi_tabs">

        <tal:block repeat="view context/@@view_get_menu/zmi_views">

          <a href="" 
            tal:attributes="href view/action;
                            class view/selected;" 
            tal:content="view/title">

            label

          </a>

        </tal:block>

      </div>


      <div class="itemViewsBar">
      &nbsp;
      </div>

      <div class="item">

      <metal:block define-slot="body">

          <table class="listing">

            <thead>

              <th>Test</th>
              <th>Another</th>

            </thead>


            <tbody>

              <tr>

                <td>content</td>
                <td>thingy</td>

              </tr>


              <tr class="even">

                <td>more</td>
                <td>data</td>

              </tr>

            </tbody>

          </table>

      </metal:block>

      </div>


      <div id="messages">

        Status and error messages

        <div id="logger"></div>

      </div>

    </div>


    <div id="context_information">

    <div id="helpers">

      <div class="box" id="itemHelp">

        <h3>

          <metal:block define-slot="itemHelpTitle">
            item help
          </metal:block>

        </h3>

        <div class="body">

          <div class="content odd">

            <metal:block define-slot="itemHelp">
              Lorem ipsum dolor sit amet, consec tetuer adipiscing elit, sed
              diam nonummy nibh euismod tincidunt ut laoreet dolore magna
              aliquam erat volutpat.
            </metal:block>

          </div>

        </div>

      </div>

    </div>


    <div id="inspectors">

      <div class="box" id="metadata">

        <h3>Metadata</h3>

        <div class="body">

          <div class="content odd">
            testing testing
          </div>

          <div class="content even">
            and some more
          </div>

        </div>

      </div>

    </div>

    </div>


    <div id="footer"
      metal:define-macro="footer">
      Powered by Zope
    </div>


  </body>

</html>

</metal:block>



=== Added File Zope3/src/zope/app/browser/skins/rotterdam/view_macros.pt ===
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html metal:define-macro="page">
<head metal:define-macro="head">
  <title 
    metal:define-slot="title"
    tal:content="options/getTitle|view/getTitle|context/getTitle|default"
    >Zope</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <link href="/@@/zopetopBasic.css" rel="stylesheet" type="text/css"
        tal:attributes="href string:/@@/zopetopBasic.css" />
  <link href="/@@/zopetopWidgets.css" rel="stylesheet" type="text/css"
        tal:attributes="href string:/@@/zopetopWidgets.css" />
  <link href="/@@/zopetopStructure.css" rel="stylesheet" type="text/css"
        tal:attributes="href string:/@@/zopetopStructure.css" />
  <div metal:define-slot="headers">
  </div>
</head>
<body>

  <table metal:define-macro="zmi_tabs"><tr>
    <td tal:repeat="view context/@@view_get_menu/zmi_views">
    <a href="" tal:attributes="href view/action" tal:content="view/title">
	label</a>
    <tal:block condition="not: repeat/view/end">'</tal:block>
    </td>
   </tr></table>

  <div metal:define-slot="body">
     <p>Body here</p>
  </div>

  <div metal:define-macro="logged_user">
  <p>User: <span tal:replace="request/user/getTitle">User</span></p>
  </div>

  <div metal:define-macro="footer">
  <p>Powered by Zope</p>
  </div>

</body>
</html>



=== Added File Zope3/src/zope/app/browser/skins/rotterdam/xmlobject.py ===
from zope.publisher.browser import BrowserView
from zope.app.interfaces.container import IReadContainer
from zope.app.traversing import objectName, getParents
from zope.component import queryView

class XmlObjectView(BrowserView):
    """Provide a xml interface for dynamic navigation tree in UI"""

    __used_for__ = IReadContainer

    def children_utility(self):
        """Return an XML document that contains the children of an object."""
        result = []
        container = self.context
        for name in container.keys():
            item = container[name]
            icon = queryView(item, 'zmi_icon', self.request)
            if IReadContainer.isImplementedBy(item):
                result.append(
                    '<collection name="%s" length="%s" icon_url="%s"/>'
                    % (name, len(item), icon.url()))
            else:
                result.append(
                    '<item name="%s" icon_url="%s"/>'
                    % (name, icon.url()))
        return ' '.join(result)

        
    def children(self):
        """ """
        self.request.response.setHeader('Content-Type', 'text/xml')
        return (u'<?xml version="1.0" ?><children> %s </children>'
                % self.children_utility()
                )

    def singleBranchTree(self, root=''):
        """Return an XML document with the siblings and parents of an object.
        
        There is only one branch expanded, in other words, the tree is
        filled with the object, its siblings and its parents with
        their respective siblings.

        """
        result = ''
        oldItem = self.context
        for item in getParents(self.context):
            # skip skin if present
            if item == oldItem:
                    continue
            subItems = []
            for name in item.keys():
                subItem = item[name]
                icon = queryView(subItem, 'zmi_icon', self.request)
                if IReadContainer.isImplementedBy(subItem):
                    if oldItem and subItem == oldItem:
                        subItems.append(
                            '<collection name="%s" length="%s" '
                            'icon_url="%s">%s</collection>'
                            % (name, len(subItem), icon.url(), result)
                            )
                    else:
                        subItems.append(
                            '<collection name="%s" length="%s" '
                            'icon_url="%s"/>'
                            % (name, len(subItem), icon.url())
                            )
                else:
                    subItems.append('<item name="%s" />' % name)

            result = ' '.join(subItems)
            oldItem = item

        # do not forget root folder
        icon = queryView(oldItem, 'zmi_icon', self.request)
        result = ('<collection name="%s" length="%s" icon_url="%s" '
                  'isroot="">%s</collection>'
                  % ('', len(oldItem), icon.url(), result)
                  )
        
        self.request.response.setHeader('Content-Type', 'text/xml')
        return u'<?xml version="1.0" ?><children> %s </children>' % result


=== Added File Zope3/src/zope/app/browser/skins/rotterdam/xmltree.js ===
//constants
var ELEMENT_NODE = 1;
var TEXT_NODE = 3;
var COLLECTION = 'COLLECTION';
var TITLE = 'TITLE';
var ICON = 'ICON';
var EXPAND = 'EXPAND';
var XML_CHILDREN_VIEW = 'children.xml';
var SINGLE_BRANCH_TREE_VIEW = 'singleBranchTree.xml';
var CONTENT_VIEW = '@@contents.html';


var LG_DEBUG = 6;
var LG_TRACE_EVENTS = 5;
var LG_TRACE = 4;
var LG_INFO = 3;
var LG_NOLOG = 0;


// globals
var baseurl;
var navigationTree;

var loglevel = LG_NOLOG;



//class navigationTreeNode
function navigationTreeNode (domNode) {
        this.childNodes = new Array();
        this.isEmpty = 1;
        this.isCollapsed = 1;
        this.domNode = domNode;
        this.name = '';
        this.parentNode = null;
}

navigationTreeNode.prototype.appendChild = function(node) {
        this.childNodes.push(node);
        this.domNode.appendChild(node.domNode);
        node.parentNode = this;
}

navigationTreeNode.prototype.getName = function() {
        return this.name;
}

navigationTreeNode.prototype.setName = function(name) {
        this.name = name;
        this.domNode.setAttribute("name", name);
}

navigationTreeNode.prototype.collapse = function() {
 	this.isCollapsed = 1;
        changeExpandIcon(this.domNode, "pl.gif"); 
}

navigationTreeNode.prototype.expand = function() {
 	this.isCollapsed = 0;
        changeExpandIcon(this.domNode, "mi.gif"); 
}

navigationTreeNode.prototype.getNodeByName = function(name) {
        var numchildren = this.childNodes.length;
        if (name == this.name) {
                return this;
                }
        else {
                for (var i=0; i< numchildren; i++) {
                        foundChild = this.childNodes[i].getNodeByName(name);
                        if (foundChild) {
                                return foundChild;
                                }
                        }        
                }
        return null;
}

// utilities
function prettydump(s, locallog) {
        // Put the string "s" in a box on the screen as an log message
        if (locallog <= loglevel) {
                var logger = document.getElementById('logger');
  	        var msg = document.createElement('code');
	        var br1 = document.createElement('br');
  	        var br2 = document.createElement('br');
  	        var msg_text = document.createTextNode(s);
  	        msg.appendChild(msg_text);
          	logger.insertBefore(br1, logger.firstChild);
  	        logger.insertBefore(br2, logger.firstChild);
          	logger.insertBefore(msg, logger.firstChild);
	        }
        }


function debug(s) {
        var oldlevel = loglevel;
        loglevel = LG_DEBUG;
        prettydump("Debug : " + s, LG_DEBUG);
        loglevel = oldlevel;
}

// DOM utilities
function getTreeEventTarget(e) {
	var elem;
        if(e.target) {
                // Mozilla uses this
       		if (e.target.nodeType == TEXT_NODE) {
                        elem=e.target.parentNode;
		        }
		else {
		        elem=e.target;
			}
                }
        else {
                // IE uses this
                elem=e.srcElement;
                }
        return elem;
        }

function isCollection(elem) {
	return (checkTagName(elem, COLLECTION));
	}

function isTitle(elem) {
	return (checkTagName(elem, TITLE));
	}

function isIcon(elem) {
	return (checkTagName(elem, ICON));
	}

function isExpand(elem) {
	return (checkTagName(elem, EXPAND));
	}

function checkTagName(elem, tagName) {
	return (elem.tagName.toUpperCase() == tagName);
	}

function toggleExpansion (navTreeNode) {
	prettydump('toggleExpansion', LG_TRACE);
        // If this collection is empty, load it from server
        // todo xxx optimize for the case where collection has null length
        var elem = navTreeNode.domNode;
        if (navTreeNode.isEmpty) {
                var url = baseurl + navTreeNode.name + XML_CHILDREN_VIEW;
                var data = loadtreexml(url);
                addNavigationTreeNodes(data, navTreeNode, 0);
                navTreeNode.isEmpty = 0;
                }
        if (navTreeNode.isCollapsed) {
	 	navTreeNode.expand();
                showChildren(elem);
   		}
        else {
                navTreeNode.collapse();
                hideChildren(elem);
   		}
        } 

function hideChildren(elem) {
        prettydump('hideChildren', LG_TRACE);
        var collections = elem.getElementsByTagName('collection');
        var num = collections.length;
	for (var i = num - 1; i >=0; i--) {
	        collections[i].style.display = 'none';
        	}
        }

function showChildren(elem) {
        prettydump('showChildren', LG_TRACE);
        var collections = elem.getElementsByTagName('collection');
        var num = collections.length;
        for (var i = num - 1; i >=0; i--) {
                var parentColl = getParentCollection(collections[i]);
                var parentNavTreeNode = navigationTree.getNodeByName(parentColl.getAttribute('name'));
                if (! (parentNavTreeNode.isCollapsed)) {
                        collections[i].style.display = 'block';
                        }
                }
        }

function getParentCollection(elem) {
        if (elem.getAttribute('isroot') != null) {
                throw "Root collection has no parent collection"; 
                }
        else {
                return elem.parentNode; 
                }
        }

function changeExpandIcon(elem, icon) {
        var expand = elem.getElementsByTagName('expand')[0];
        expand.style.backgroundImage = 'url("' + baseurl + '@@/' + icon + '")';
        }

//events
function mouseOverTree (e) {
        prettydump('mouseOverTree', LG_TRACE_EVENTS);
        var elem = getTreeEventTarget(e);
        if (elem.id == 'navtree') return;
        if (isTitle(elem)) {
	        elem.style.textDecoration = 'underline';
                var collectionElem = elem.parentNode.parentNode.parentNode;
                window.status = getTargetURL(collectionElem);
	        }
        }

function mouseOutTree (e) {
        prettydump('mouseOutTree', LG_TRACE_EVENTS);
        var elem = getTreeEventTarget(e);
        if (elem.id == 'navtree') return;
        if (isTitle(elem)) {
	        elem.style.textDecoration = 'none';
                window.status = '';
	        }
        }

function treeclicked (e) {
        prettydump('treeclicked', LG_TRACE_EVENTS);
        var elem = getTreeEventTarget(e);
        if (elem.id == 'navtree') return;
        // if node clicked is title elem, change page
        if (isTitle(elem)) {
	        location.href = getTargetURL(elem.parentNode.parentNode.parentNode);
	        }

        // if node clicked is expand elem, toggle expansion
        if (isExpand(elem)) {
                //get collection node
                elem = elem.parentNode;
                var navTreeNode = navigationTree.getNodeByName(elem.getAttribute('name'));
                toggleExpansion(navTreeNode);
                }
        }

// helpers

function getTargetURL(elem) {
        var location_href = baseurl;
	location_href = location_href + elem.getAttribute('name');
	location_href = location_href + CONTENT_VIEW;
        return location_href;
        }


function getControlPrefix() {
        if (getControlPrefix.prefix)
                return getControlPrefix.prefix;
   
        var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
        var o, o2;
        for (var i = 0; i < prefixes.length; i++) {
                try {
                        // try to create the objects
                        o = new ActiveXObject(prefixes[i] + ".XmlHttp");
                        o2 = new ActiveXObject(prefixes[i] + ".XmlDom");
                        return getControlPrefix.prefix = prefixes[i];
                        }
                catch (ex) {};
                }
   
        throw new Error("Could not find an installed XML parser");
        }


// XmlHttp factory
function XmlHttp() {}


XmlHttp.create = function () {
if (window.XMLHttpRequest) {
        var req = new XMLHttpRequest();
         
        // some older versions of Moz did not support the readyState property
        // and the onreadystate event so we patch it!
        if (req.readyState == null) {
                req.readyState = 1;
                req.addEventListener("load", function () {
                                req.readyState = 4;
                                if (typeof req.onreadystatechange == "function")
                                req.onreadystatechange();}, false);
                }
 
                return req;
        }
if (window.ActiveXObject) {
        s = getControlPrefix() + '.XmlHttp';
        return new ActiveXObject(getControlPrefix() + ".XmlHttp");
        }
return;
};


function loadHandler () {
        // process document with dom methods
        alert(this.documentElement.nodeName);
        }

function loadtreexml (url) {
        var xmlHttp = XmlHttp.create(); 
        if (xmlHttp) {
                xmlHttp.open('GET', url, false); 
                xmlHttp.send(null);
                prettydump('Response XML ' + xmlHttp.responseText, LG_INFO);
                var data = xmlHttp.responseXML.documentElement;
                return data;
                }
        else {
                }
        }  

function loadtree (rooturl, thisbaseurl) {
        baseurl = rooturl;  // Global baseurl
  
	var url = thisbaseurl + SINGLE_BRANCH_TREE_VIEW;
        var data = loadtreexml(url);
        if (data) {
                var docNavTree = document.getElementById('navtreecontents');
                addNavigationTreeNodes(data, null, 1);
                docNavTree.appendChild(navigationTree.domNode);
                }
        }


function addNavigationTreeNodes(sourceNode, targetNavTreeNode, deep) {
        // create tree nodes from XML children nodes of sourceNode         
        // and add them to targetNode
        // if deep, create all descendants of sourceNode
        var basename = "";
        if (targetNavTreeNode) {
                basename = targetNavTreeNode.name;
                }
        var items = getCollectionChildNodes(sourceNode);
        var numitems = items.length;
        for (var i=0; i< numitems; i++) {
                var navTreeChild = createNavigationTreeNode(items[i], basename, deep);
                if (targetNavTreeNode) {
                        targetNavTreeNode.appendChild(navTreeChild);
                        }
                }
        }       

function getCollectionChildNodes(elem) {
        // get collection element nodes among childNodes of elem
        var items = elem.childNodes;
        var numitems = items.length;
        var currentItem;
        var result = new Array();
        for (var i = 0; i < numitems; i++) {
                currentItem = items[i];

                if (currentItem.nodeType != ELEMENT_NODE) {
                        continue;
                        }

                if (!isCollection(currentItem)) {
                        continue;
                        }
                result.push(currentItem);
                }
        return result;
        }


function createPresentationNodes(title, icon_url) {
        // create nodes hierarchy for one collection (without children)
        
        // create elem for plus/minus icon
        var expandElem = document.createElement('expand');
        // create elem for item icon
        var iconElem = document.createElement('icon');
        expandElem.appendChild(iconElem);
        iconElem.style.backgroundImage = 'url("' + baseurl + icon_url + '")';
        // create title
        var titleElem = document.createElement('title');
        var newtextnode = document.createTextNode(title);
        
        titleElem.appendChild(newtextnode);
        
        iconElem.appendChild(titleElem);

        return expandElem;
        }

function createNavigationTreeNode(source, basename, deep) {
        var newelem = document.createElement(source.tagName);

        var navTreeNode = new navigationTreeNode(newelem);
        var elemName;
        var elemTitle;
        //XXX should not hardcode root folder name string
        if (source.getAttribute('isroot') != null) {
                elemTitle = '[top]';
                elemName = basename;
                newelem.style.marginLeft = '0px';
                navigationTree = navTreeNode;
                }
        else {
                elemTitle = source.getAttribute('name');
                elemName = basename + elemTitle + '/';
                }
        navTreeNode.setName(elemName);
        
        //could show number of child items
        //var length = source.getAttribute('length');
        //elemTitle = elemTitle + '(' + length + ')';
        
        var icon_url = source.getAttribute('icon_url');  

        
        var expandElem = createPresentationNodes(elemTitle, icon_url);
        newelem.appendChild(expandElem);


        if (deep) {
                var children = getCollectionChildNodes(source);
                var numchildren = children.length;
                for (var i=0; i< numchildren; i++) {
                        var navTreeNodeChild =  createNavigationTreeNode(children[i], navTreeNode.name, deep); 
                        var newchild = navTreeNodeChild.domNode;
                        newelem.appendChild(newchild);
                        navTreeNode.appendChild(navTreeNodeChild);
                        }
                if (numchildren) {
                        navTreeNode.isEmpty = 0;
                        navTreeNode.expand();
                        }
                else {
                        navTreeNode.isEmpty = 1;
                        navTreeNode.collapse();
                        }
                }
        else {
                navTreeNode.isEmpty = 1;
                navTreeNode.collapse();
                }
        return navTreeNode;
        }



=== Added File Zope3/src/zope/app/browser/skins/rotterdam/zope3.css ===
/* 
** Zope3 style sheet for CSS2-capable browsers.
**
*/

/*
* { border: 1px dotted red }
*/


/* Basic Elements */

body {
    font: 75% Verdana, Helvetica, Arial, sans-serif;
    background: White;
    color: Black;
    margin: 0;
    padding: 0;
/* These work in IE only, changes the look of the scrollbar + textareas */
    scrollbar-base-color: #DEE7EC;
    scrollbar-highlight-color: #DEE7EC;
    scrollbar-track-color: #F7F9FA;
    scrollbar-darkshadow-color: #F7F9FA;
    scrollbar-3dlight-color: #8CACBB;
    scrollbar-shadow-color: #8CACBB;
    scrollbar-arrow-color: #436976;
}

table {
    font-size: 100%;
}

a, #navtreecontents title {
	text-decoration: none;
    color: #436976;
    background-color: transparent;
}

table {

}


img {
    border: none;
	vertical-align: middle;
}

p {
    margin: 0.5em 0em 1em 0em;
    text-align: justify;
    line-height: 1.5em;
}

p a {
    text-decoration: underline;
}

p a:visited {
	color: Purple;
    background-color: transparent;
}

p a:active {
	color: Red;
    background-color: transparent;
}

p img {
    border: 0;
    margin: 0;
}


hr {
    clear: both;
    height: 1px;
    color: #8CACBB;
    background-color: transparent;
}


h1, h2, h3, h4, h5, h6 {
    color: Black;
    clear: left;
    font: 100% Verdana, Helvetica, Arial, sans-serif;
    margin: 0;
    padding-top: 1em;
    border-bottom: 1px solid #8CACBB;
}

h1 {
    font-size: 160%;
}

h2 {
    font-size: 150%;
}

h3 {
    font-size: 140%;
}

h4 {
    font-size: 120%;
}

h5 {
    font-size: 100%;
}

h6 {
    font-size: 80%;
}

ul { 
    line-height: 1.5em;
    list-style-image: url("bullet.gif"); 
    margin-left: 2em;
    padding:0;
}

ol {
    line-height: 1.5em;
    margin-left: 2em;
    padding:0;
}

ul a, ol a {
    text-decoration: underline;
}

dl {
}

dt {
    font-weight: bold;    
}

dd {
    line-height: 1.5em;
    margin-bottom: 1em;
}


fieldset {
    border: 1px solid #8cacbb;
    margin: 2em 0em 1em 0em;
    padding: 1em 0em;
}

legend {
    background: White;
    padding: 0.5em;
}


form {
    border: none;
    margin: 0;
}

textarea {
    border: 1px solid #8cacbb;  
    color: Black;
    background-color: white;
    width: 93%;
    padding: 0.1em;
}

input {
    font: 100% Verdana, Helvetica, Arial, sans-serif;
    border: 1px solid #8cacbb;  
    color: Black;
    background-color: white;
    vertical-align: middle;
    margin-bottom: 1px; /* IE bug fix */
    padding: 0.1em;
}

select {
    font: 100% Verdana, Helvetica, Arial, sans-serif;
    border: 1px solid #8cacbb;  
    vertical-align: top;
}

abbr, acronym, .explain {
    border-bottom: 1px dotted Black;
    color: Black;
    background-color: transparent;
    cursor: help;
}

q {
    font-family: Times, "Times New Roman", serif;
    font-style: italic;
    font-size: 120%;
}

blockquote {
    font-family: Times, "Times New Roman", serif;
    font-style: italic;
    font-size: 120%;
}

code {
    font-size: 120%;
    color: Black;
    background-color: #dee7ec;
}

pre {
    font-size: 120%;
    padding: 1em;
    border: 1px solid #8cacbb;
    color: Black;
    background-color: #dee7ec;
}

.netscape4 {
    display: none;
}


/*  Styles for xmltree
*/

#navtreecontents title {
	   display: inline;
	   cursor: pointer;
	   height: 18px;
		 }

#navtreecontents expand {
  	   background-repeat: no-repeat;
  	   padding-left: 15px;
	   display: inline;
	   cursor: pointer;
                }
                 
#navtreecontents icon {
  	   background-repeat: no-repeat;
  	   padding-left: 18px;
	   display: inline;
	   cursor: auto;
                }
                 
#navtreecontents collection {
	   display: block;
	   margin-left: 15px;
/*	   border: red solid 1pt;  */
	   height: auto;
}



/* Structural elements */


#global {
    font-size: 1.2em;
    border-bottom: 1px solid black;
}

#personal {
    border-bottom: 1px solid black;
    text-align: left;
}

#breadcrumbs {
    border-bottom: 1px solid black;
/*    color: blue; */
    padding-bottom: 1px;
    padding-top: 1px;
}

#navigators {
    float: left;
    width: 18%;
}

#content {
    float: left;
    width: 64%;
}

#helpers {
    /*float: left;
    width: 18%;*/
}

#inspectors {
    /*float: left;
    width: 18%;*/
}

#context_information {
    float: left;
    width: 18%;
}

#footer {
    border-bottom: 1px solid black;
    float: none;
    clear: both;
}

div.box {
    background: transparent;
    border-collapse: collapse;
    margin: 2em 1em 0em 1em;
    border: none;
}

div.box h3 {
    background: #DEE7EC;
    border: 1px solid #8CACBB;
    border-style: solid solid none;
    color: Black;
    text-transform: lowercase;
    margin: 0px;
    font-weight: normal;

    padding: 0.1em 1em 0.3em 0.5em;
    height: 1em;
}

div.box h4 {
    background: #DEE7EC;
    border-style: solid solid none;
    border: 1px solid #8CACBB;
    color: Black;
    display: inline;
    font-size: 1em;
    font-weight: normal;
    height: 1em;
    margin: 0px;
    padding: 0px 1em;
    text-transform: lowercase;
}

div.box div.body {
    background: transparent;
    border-collapse: collapse;
    border: 1px solid #8CACBB;
    margin: 0;
    padding: 0.1em 1em 0.3em 0.5em;
}


.itemViews {
    background: transparent;
    border-collapse: collapse;
    border-bottom: 1px solid #74AE0B;
    padding-left: 1em;
    margin-top: 2em;
    white-space: nowrap;
}

.itemViews a {
    background: transparent;
    border: 1px solid #74AE0B;
    color: #578308;
    font-weight: normal;
    margin-right: 0.5em;
    padding: 0em 0.5em;
    text-transform: lowercase;
}

.itemViews a.selected {
    background: #CDE2A7;
    border-bottom: #CDE2A7 1px solid;
    color: #578308;
    font-weight: normal;
}

.itemViews a:hover {
    background-color: #CDE2A7;
    color: #578308;
}

.itemViewsBar {
    background: #CDE2A7;
    border-left: 1px solid #74AE0B;
    border-right: 1px solid #74AE0B;
    color: #578308;
    text-align: right;
    text-transform: lowercase;
}

.item {
    border: 1px solid #74AE0B;
    padding: 10px;
}

table.listing {
    /* The default table for document listings. Contains name, document types, modification times etc in a file-browser-like fashion */
    border-collapse: collapse;
    border-left: 1px solid #8CACBB;
    border-bottom: 1px solid #8CACBB;
    margin: 1em 0em 1em 0em;
    clear: both;
}

table.listing th {
    background: #DEE7EC;
    border-top: 1px solid #8CACBB;
    border-bottom: 1px solid #8CACBB;
    border-right: 1px solid #8CACBB;
    color: Black;
    font-weight: normal;
    padding: 0em 1em 0em 1em;
    text-transform: lowercase;
    white-space: nowrap;
}

table.listing td.top {
    border-left: 1px solid White;
    border-top: 1px solid White ! important;
    border-right: 1px solid White ! important;
    text-align: right ! important;
    padding: 0em 0em 1em 0em;
    /* insane IE row bug workaround */
    position: relative;
    left: -1px;
    top: -1px;
}

table.listing tr.odd {
    /*every second line should be shaded */
    background: transparent;
}

table.listing tr.even {
    background: #F7F9FA;
}

table.listing td {
    border-right: 1px solid #8CACBB;
    padding: 0em 1em;
    text-align: left;
}

/*table.listing a:hover { */
a:hover {
    text-decoration: underline;
}

table.listing img {
	vertical-align: middle;
}








div.message {
    background: #FFCE7B;
    border: 1px solid #FFA500;
    color: Black;
    font: bold 80% Verdana, Helvetica, Arial, sans-serif;
    margin: 2em 0em 1em 0em;
    padding: 0.5em 1em;
    vertical-align: middle;
}

div.message a {
	color: Black;
    text-decoration: underline;
}