Author: bree
Date: Thu Apr 20 12:15:56 2006
New Revision: 2911

Modified:
   azax/branches/plugin/browser/kukitresponse.pt
   azax/branches/plugin/commands.py
Log:
Fix (XML) rendering of the commands for Zope2.9

Note: We don't use proper views for Five. As our context object
is not even a proper Zope content. There would be a way to:

- use ZopeTwoPageTemplateFile
- and, make the object to be proper zope content.

This would be two much ado for nothing, so we just use barefoot
rendering but as a consequence no path expression, only python:
is available from the page template.

I also needed to set up manually request.debug, this could
probably have been avoided if I use the proper view class
or the proper page template class.


Modified: azax/branches/plugin/browser/kukitresponse.pt
==============================================================================
--- azax/branches/plugin/browser/kukitresponse.pt       (original)
+++ azax/branches/plugin/browser/kukitresponse.pt       Thu Apr 20 12:15:56 2006
@@ -5,15 +5,15 @@
       xmlns:metal="http://xml.zope.org/namespaces/metal";
       xmlns:i18n="http://xml.zope.org/namespaces/i18n";><body>
 <kukit:command tal:repeat="command context"
-               selector="div#demo" name="setHtmlAsChild" 
-        selectorType=""
-               tal:attributes="selector command/getSelector;
-                                           name command/getName;
-                                           selectorType 
command/getSelectorType | default">
-       <kukit:param tal:repeat="param command/params" name="html"
-                       tal:attributes="name param/name"
-                       tal:content="structure param/content">
-               <h1 xmlns="http://www.w3.org/1999/xhtml";>it worked</h1>
-       </kukit:param>
+     selector="div#demo" name="setHtmlAsChild" 
+     selectorType=""
+     tal:attributes="selector python: command.getSelector();
+                     name python: command.getName();
+                     selectorType python: command.getSelectorType()">
+    <kukit:param tal:repeat="param python: command.params" name="html"
+            tal:attributes="name python: param.name"
+            tal:content="structure python: param.content">
+        <h1 xmlns="http://www.w3.org/1999/xhtml";>it worked</h1>
+    </kukit:param>
 </kukit:command>
 </body></html>

Modified: azax/branches/plugin/commands.py
==============================================================================
--- azax/branches/plugin/commands.py    (original)
+++ azax/branches/plugin/commands.py    Thu Apr 20 12:15:56 2006
@@ -89,8 +89,21 @@
     def __init__(self, context, request):
         self.context = context
         self.request = request
+        # XXX From Zope2.9 we need this.
+        # Note: We don't use proper views for Five. As our context object
+        # is not even a proper Zope content. There would be a way to:
+        #
+        # - use ZopeTwoPageTemplateFile
+        # - and, make the object to be proper zope content.
+        #
+        # This would be two much ado for nothing, so we just use barefoot
+        # rendering but as a consequence no path expression, only python:
+        # is available from the page template.
+        if not hasattr(self.request, 'debug'):
+            self.request.debug = None
     
     # XML output gets rendered via a page template
+    # XXX note: barefoot rendering, use python: only after zope2.9
     render = ViewPageTemplateFile('browser/kukitresponse.pt', 
content_type='text/xml;charset=utf-8')
 
 #    def render(self):
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to