[Zope3-checkins] CVS: Zope3/src/zope/app/browser/skins/rotterdam - site_management.css:1.2.2.1 configure.zcml:1.18.14.1 template.pt:1.46.6.1 xmlobject.py:1.10.30.1 zope3.css:1.25.12.1

Stuart Bishop zen at shangri-la.dropbear.id.au
Sun Feb 8 22:09:26 EST 2004


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

Modified Files:
      Tag: ozzope-session-branch
	configure.zcml template.pt xmlobject.py zope3.css 
Added Files:
      Tag: ozzope-session-branch
	site_management.css 
Log Message:
Work in progress - API solidifying


=== Added File Zope3/src/zope/app/browser/skins/rotterdam/site_management.css ===
/*
** Customisations for the Site Management view (usage="siteobjectview")
*/

#actions {
    background: #963;
    border-left: 1px solid #963;
    border-right: 1px solid #963;
}

#actions a {
	color: White;
	border-left: 1px dashed white;
}

#actions a:hover {
	color: black;
	background-color: White;
}

#breadcrumbs {
    border-bottom: 1px solid #963;
}

.itemViews {
    border-bottom: 1px solid #963;
}

.itemViews a {
    border: 1px solid #963;
}

.itemViews a.selected {
    background: #963;
    border-bottom: #963 1px solid;
}

.itemViews a:hover {
    background-color: #963;
    color: White;
}


=== Zope3/src/zope/app/browser/skins/rotterdam/configure.zcml 1.18 => 1.18.14.1 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/configure.zcml:1.18	Sat Dec  6 12:03:32 2003
+++ Zope3/src/zope/app/browser/skins/rotterdam/configure.zcml	Sun Feb  8 22:08:53 2004
@@ -9,6 +9,9 @@
   
   <browser:resource 
       name="zope3.css" file="zope3.css" layer="rotterdam" />
+
+  <browser:resource 
+      name="site_management.css" file="site_management.css" layer="rotterdam" />
   
   <browser:resource 
       name="xmltree.js" file="xmltree.js" layer="rotterdam" />


=== Zope3/src/zope/app/browser/skins/rotterdam/template.pt 1.46 => 1.46.6.1 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/template.pt:1.46	Fri Jan 30 08:27:24 2004
+++ Zope3/src/zope/app/browser/skins/rotterdam/template.pt	Sun Feb  8 22:08:53 2004
@@ -3,7 +3,8 @@
 <html xmlns="http://www.w3.org/1999/xhtml"
     xml:lang="en"
     lang="en"
-    i18n:domain="zope">
+    i18n:domain="zope"
+    tal:define="sitemgmt python:'/++etc++site/' in str(request.URL)">
 
   <head>
     <title metal:define-slot="title" i18n:translate="">Z3 UI</title>
@@ -11,6 +12,11 @@
     <style type="text/css" media="all"
            tal:content="string:@import url(${context/++resource++zope3.css});">
       @import url(zope3.css);
+    </style>
+
+    <style type="text/css" media="all" tal:condition="sitemgmt"
+           tal:content="string:@import url(${context/++resource++site_management.css});">
+      @import url(site_management.css);
     </style>
 
     <meta http-equiv="Content-Type"


=== Zope3/src/zope/app/browser/skins/rotterdam/xmlobject.py 1.10 => 1.10.30.1 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/xmlobject.py:1.10	Thu Aug  7 11:55:53 2003
+++ Zope3/src/zope/app/browser/skins/rotterdam/xmlobject.py	Sun Feb  8 22:08:53 2004
@@ -21,12 +21,32 @@
 from zope.app.traversing import getParents, getParent, traverse
 from zope.component import queryView
 from zope.interface import Interface
+from rfc822 import formatdate, time
+from xml.sax.saxutils import quoteattr
+
+def setNoCacheHeaders(response):
+    """Ensure that the tree isn't cached"""
+    response.setHeader('Pragma', 'no-cache')
+    response.setHeader('Cache-Control', 'no-cache')
+    response.setHeader('Expires', formatdate(time.time()-7*86400))#7 days ago
+
+def xmlEscape(format, *args):
+    quotedArgs = [ quoteattr(str(arg)) for arg in args ]
+    return format%tuple(quotedArgs)
+	
+def xmlEscapeWithCData(format, *args):
+    cData = args[-1]
+    quotedArgs = [ quoteattr(str(arg)) for arg in args[:-1] ]
+    quotedArgsWithCData = quotedArgs + [cData]
+    return format%tuple(quotedArgsWithCData)
+	
 
 class ReadContainerXmlObjectView(BrowserView):
     """Provide a xml interface for dynamic navigation tree in UI"""
 
     __used_for__ = IReadContainer
 
+
     def getIconUrl(self, item):
         result = ''
         icon = queryView(item, 'zmi_icon', self.request)
@@ -52,13 +72,13 @@
 
             iconUrl = self.getIconUrl(item)
             if IReadContainer.isImplementedBy(item):
-                result.append(
-                    '<collection name="%s" length="%s" icon_url="%s"/>'
-                    % (name, len(item), iconUrl))
+                result.append(xmlEscape(
+                    '<collection name=%s length=%s icon_url=%s/>',
+                    name, len(item), iconUrl))
             else:
-                result.append(
-                    '<item name="%s" icon_url="%s"/>'
-                    % (name, iconUrl))
+                result.append(xmlEscape(
+                    '<item name=%s icon_url=%s/>',
+                    name, iconUrl))
 
         return ' '.join(result)
 
@@ -67,9 +87,10 @@
         """ """
         container = self.context
         self.request.response.setHeader('Content-Type', 'text/xml')
-        return (u'<?xml version="1.0" ?><children> %s </children>'
-                % self.children_utility(container)
-                )
+        setNoCacheHeaders(self.request.response)
+        res = (u'<?xml version="1.0" ?><children> %s </children>'
+                % self.children_utility(container))
+	return res
 
     def singleBranchTree(self, root=''):
         """Return an XML document with the siblings and parents of an object.
@@ -83,8 +104,8 @@
         oldItem = self.context
         for item in getParents(self.context):
             # skip skin if present
-            if item == oldItem:
-                    continue
+            #if item == oldItem:
+            #        continue
             subItems = []
             if IReadContainer.isImplementedBy(item):
                 keys = list(item.keys())
@@ -97,36 +118,35 @@
             for name in keys:
                 # Only include items we can traverse to
                 subItem = traverse(item, name, None)
-
-                iconUrl = self.getIconUrl(subItem)
                 if IReadContainer.isImplementedBy(subItem):
-                    if oldItem and subItem == oldItem:
-                        subItems.append(
-                            '<collection name="%s" length="%s" '
-                            'icon_url="%s">%s</collection>'
-                            % (name, len(subItem), iconUrl, result)
-                            )
+                    iconUrl = self.getIconUrl(subItem)
+		    # the test below seems to be browken with the ++etc++site case
+                    if subItem == oldItem:
+                        subItems.append(xmlEscapeWithCData(
+                            '<collection name=%s length=%s '
+                            'icon_url=%s>%s</collection>', 
+                            name, len(subItem), iconUrl, result))
                     else:
-                        subItems.append(
-                            '<collection name="%s" length="%s" '
-                            'icon_url="%s"/>'
-                            % (name, len(subItem), iconUrl)
-                            )
+                        subItems.append(xmlEscape(
+                            '<collection name=%s length=%s '
+                            'icon_url=%s/>',
+                            name, len(subItem), iconUrl))
                 else:
-                    subItems.append('<item name="%s" />' % name)
+                    subItems.append(xmlEscape('<item name=%s />', name))
 
             result = ' '.join(subItems)
             oldItem = item
 
         # do not forget root folder
         iconUrl = self.getIconUrl(oldItem)
-        result = ('<collection name="%s" length="%s" icon_url="%s" '
-                  'isroot="">%s</collection>'
-                  % ('', len(oldItem), iconUrl, result)
-                  )
+        result = (xmlEscapeWithCData('<collection name="" length=%s '
+	          'icon_url=%s isroot="">%s</collection>',
+                  len(oldItem), iconUrl, result))
 
         self.request.response.setHeader('Content-Type', 'text/xml')
-        return u'<?xml version="1.0" ?><children> %s </children>' % result
+        setNoCacheHeaders(self.request.response)
+        res= u'<?xml version="1.0" ?><children> %s </children>' % result
+	return res
 
 class XmlObjectView(BrowserView):
     """Provide a xml interface for dynamic navigation tree in UI"""


=== Zope3/src/zope/app/browser/skins/rotterdam/zope3.css 1.25 => 1.25.12.1 ===
--- Zope3/src/zope/app/browser/skins/rotterdam/zope3.css:1.25	Tue Dec  9 08:20:19 2003
+++ Zope3/src/zope/app/browser/skins/rotterdam/zope3.css	Sun Feb  8 22:08:53 2004
@@ -36,6 +36,10 @@
     background-color: transparent;
 }
 
+a[href]:active {
+    text-decoration: underline;
+}
+
 
 table {
 
@@ -52,10 +56,6 @@
     line-height: 1.5em;
 }
 
-p a {
-    text-decoration: underline;
-}
-
 p a:visited {
     color: Purple;
     background-color: transparent;
@@ -126,10 +126,6 @@
     padding:0;
 }
 
-ul a, ol a {
-    text-decoration: underline;
-}
-
 dl {
 }
 
@@ -533,7 +529,6 @@
 
 div.message a {
     color: Black;
-    text-decoration: underline;
 }
 
 /* Style for page error divs.  Use this for displaying errors for a




More information about the Zope3-Checkins mailing list