<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi St&eacute;phane.<br>
<br>
Check out
<a class="moz-txt-link-freetext" href="http://www.zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx">http://www.zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx</a><br>
<br>
See the heading "Traversal methods" where this is explained.<br>
<br>
<br>
<br>
Martijn.<br>
<blockquote
 cite="mid:93b142540803260547v753880fdk378828004e8bc168@mail.gmail.com"
 type="cite">Great, I should test this code tonight !<br>
some more question : id don't understand the two different usage&nbsp; of
__getitem__<br>
and __bobo_traverse__. __bobo_traverse__ seems to be a way to control <br>
url walk and __getitem__ control the way attributs can be load by zope.<br>
  <br>
If I change the URL when I use __bobo_traverse__ it works, and if I
change the way<br>
I'm searching attributs in zope object tree it works too. Is it correct
?<br>
  <span style="font-family: monospace;"><br>
  <br>
  </span>
  <div><span class="gmail_quote">2008/3/26, Martijn Jacobs &lt;<a
 moz-do-not-send="true" href="mailto:martijn@fourdigits.nl">martijn@fourdigits.nl</a>&gt;:</span>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff" text="#000000"><br>
If you have a zope product you can do something like this indeed : <br>
    <br>
    <tt>class MyContainer(Folder):<br>
&nbsp;&nbsp; """My Folderish Product"""<br>
    <br>
&nbsp;&nbsp; def mydoc_xls(self, REQUEST=None):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; """My new xls method"""<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return "My new xls method"<br>
    <br>
&nbsp;&nbsp; def __getitem__(self, key):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; """Check for mydoc.xls, then return mydoc_xls"""<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if key == 'mydoc.xls':<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.mydoc_xls<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return super(Folder, self).__getitem__(key)</tt><br>
    <br>
    <br>
    <br>
    <blockquote type="cite">
      <div><span class="e" id="q_118ea5fd68aa856b_1">Hi!<br>
Hey, Tres, could you point us to a web example or a web page with more
information about that technique?<br>
I'm very interested on it and the technique that was introduced
sometime ago about how to return a string as __bobo_traverse__ response
but the example was uncompleted (for me at least)<br>
      <br>
This kind of information was very useful for many of us but there are
no good tutorial or how-to<br>
      <br>
Thanks a lot!<br>
      <br>
      <div><span class="gmail_quote">2008/3/26, Tres Seaver &lt;<a
 moz-do-not-send="true" href="mailto:tseaver@palladion.com"
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tseaver@palladion.com</a>&gt;:</span>
      <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">-----BEGIN
PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
        <br>
        <br>
Martijn Jacobs wrote:<br>
&gt; Maybe a simple solution&nbsp;&nbsp;:<br>
&gt;<br>
&gt; Do you use apache as a frontend for your zope? If you do you can
rewrite<br>
&gt; the incoming url's for example like this :<br>
&gt;<br>
&gt; RewriteEngine On<br>
&gt; RewriteRule ^/folder/mydoc.xls(.*)<br>
&gt; <a moz-do-not-send="true"
 href="http://localhost:8080/VirtualHostBase/http/myIntranet/object_in_zope/VirtualHostRoot/mydoc_xls$1"
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://localhost:8080/VirtualHostBase/http/myIntranet/object_in_zope/VirtualHostRoot/mydoc_xls$1</a><br>
&gt; [L,P]<br>
        <br>
        <br>
Or add a '__getitem__' to your class that looks for that key and returns<br>
the right method.<br>
        <br>
        <br>
Tres.<br>
- --<br>
===================================================================<br>
Tres Seaver&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+1 540-429-0999&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a moz-do-not-send="true"
 href="mailto:tseaver@palladion.com" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">tseaver@palladion.com</a><br>
Palladion Software&nbsp;&nbsp; "Excellence by Design"&nbsp;&nbsp;&nbsp;&nbsp;<a moz-do-not-send="true"
 href="http://palladion.com" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">http://palladion.com</a><br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.6 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a moz-do-not-send="true"
 href="http://enigmail.mozdev.org" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">http://enigmail.mozdev.org</a><br>
        <br>
iD8DBQFH6ZfK+gerLs4ltQ4RAgdjAJ9bwmIjAbqkG1YKUyrgbKSG47FlXgCdHW+P<br>
GzL6mjcA1K8t9Q/5Y75tfF4=<br>
=mySN<br>
-----END PGP SIGNATURE-----<br>
        <br>
        <br>
_______________________________________________<br>
Zope maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a moz-do-not-send="true" href="mailto:Zope@zope.org"
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Zope@zope.org</a><br>
        <a moz-do-not-send="true"
 href="http://mail.zope.org/mailman/listinfo/zope" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope</a><br>
**&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp;&nbsp;**<br>
(Related lists -<br>
&nbsp;&nbsp;<a moz-do-not-send="true"
 href="http://mail.zope.org/mailman/listinfo/zope-announce"
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
&nbsp;&nbsp;<a moz-do-not-send="true"
 href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope-dev</a>
)<br>
      </blockquote>
      </div>
      <br>
      <br clear="all">
      <br>
-- <br>
Mis Cosas<br>
      <a moz-do-not-send="true" href="http://blogs.sistes.net/Garito"
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://blogs.sistes.net/Garito</a><br>
Zope Smart Manager<br>
      <a moz-do-not-send="true"
 href="http://blogs.sistes.net/Garito/670" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">http://blogs.sistes.net/Garito/670</a>
      </span></div>
      <pre><hr size="4" width="90%"><span class="q">
_______________________________________________
Zope maillist  -  <a moz-do-not-send="true" href="mailto:Zope@zope.org"
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Zope@zope.org</a>

<a moz-do-not-send="true"
 href="http://mail.zope.org/mailman/listinfo/zope" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope</a>
**   No cross posts or HTML encoding!  **
(Related lists - 

 <a moz-do-not-send="true"
 href="http://mail.zope.org/mailman/listinfo/zope-announce"
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope-announce</a>
 <a moz-do-not-send="true"
 href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope-dev</a> )

  </span></pre>
    </blockquote>
    <br>
    <br>
    <pre cols="72">-- 
Martijn Jacobs
Four Digits, Internet Solutions

a: Willemsplein 15-1 6811 KB Arnhem NL 
kvk: 091621370000 | btw: 8161.22.234.B01<span class="q">
e-mail: <a moz-do-not-send="true" href="mailto:martijn@fourdigits.nl"
 target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">martijn@fourdigits.nl</a> | web: <a
 moz-do-not-send="true" href="http://www.fourdigits.nl" target="_blank"
 onclick="return top.js.OpenExtLink(window,event,this)">http://www.fourdigits.nl</a>

tel: +31 (0)26 44 22 700 | fax: +31 (0)84 22 06 117 
</span></pre>
    </div>
    <br>
_______________________________________________<br>
Zope maillist &nbsp;- &nbsp;<a moz-do-not-send="true"
 onclick="return top.js.OpenExtLink(window,event,this)"
 href="mailto:Zope@zope.org">Zope@zope.org</a><br>
    <a moz-do-not-send="true"
 onclick="return top.js.OpenExtLink(window,event,this)"
 href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>
** &nbsp; No cross posts or HTML encoding! &nbsp;**<br>
(Related lists -<br>
&nbsp;<a moz-do-not-send="true"
 onclick="return top.js.OpenExtLink(window,event,this)"
 href="http://mail.zope.org/mailman/listinfo/zope-announce"
 target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
&nbsp;<a moz-do-not-send="true"
 onclick="return top.js.OpenExtLink(window,event,this)"
 href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a>
)<br>
    <br>
  </blockquote>
  </div>
  <br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Martijn Jacobs
Four Digits, Internet Solutions

a: Willemsplein 15-1 6811 KB Arnhem NL 
kvk: 091621370000 | btw: 8161.22.234.B01
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:martijn@fourdigits.nl">martijn@fourdigits.nl</a> | web: <a class="moz-txt-link-freetext" href="http://www.fourdigits.nl">http://www.fourdigits.nl</a>
tel: +31 (0)26 44 22 700 | fax: +31 (0)84 22 06 117 
</pre>
</body>
</html>