<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE type=text/css>DIV {
        MARGIN: 0px
}
</STYLE>

<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>In your script you&nbsp;could access the catalog as 
follows:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; afolder = 
context.restrictedTraverse('folderA/folderB/'+someLocalFolder)&nbsp;&nbsp;&nbsp; 
# pass 'someLocalFolder' as a parameter</FONT></DIV>
<DIV>&nbsp;&nbsp;&nbsp; catalog = afolder.Catalog&nbsp;&nbsp;&nbsp; # assuming 
you have named your ZCatalog 'Catalog'</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Note: If this script&nbsp;is accessing&nbsp;a 
folder &amp; catalog that is outside of the scope of the permissioned user (ie. 
not in the path that that user has permissions for), you will need to set a 
proxy role&nbsp;on the script</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>hth</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Jonathan</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=javier_subervi@yahoo.com 
  href="mailto:javier_subervi@yahoo.com">Javier Subervi</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=zope@zope.org 
  href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, December 12, 2006 8:57 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Zope] Re: Preserving 
  Context</DIV>
  <DIV><BR></DIV>
  <DIV 
  style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
  <DIV>From: Suresh V &lt;suresh_vv@...&gt;<BR><BR>&gt;1. Are you using 
  "container" rather than "context" in your script? <BR>&gt;2. You can pass your 
  context as a "mycontext" parameter to your script.<BR><BR>I have this line of 
  code in my page template for handling the 404 errors:<BR><BR>&lt;div 
  align="center" tal:condition="here/hasSearchEngine"&gt;<BR><BR>I changed it 
  thus:<BR><BR>&lt;div align="center" 
  tal:condition="here/hasSearchEngine(mycontext)"&gt;<BR><BR>I tested the 
  following script with "mycontext" as a passed parameter:<BR><BR>return 
  0<BR><BR>catalog = ''<BR>try:<BR>&nbsp;&nbsp;&nbsp; catalog = 
  getattr(mycontext, 
  mycontext.superValues('ZCatalog')[0].id)<BR>except:<BR>&nbsp;&nbsp;&nbsp; 
  pass<BR>&nbsp;&nbsp;&nbsp; <BR>if catalog:<BR>&nbsp;&nbsp;&nbsp; return 
  1<BR><BR>This threw an error concerning 
  "mycontext".<BR>TIA,<BR>Javier<BR></DIV></DIV><BR>
  <HR SIZE=1>
  Cheap Talk? <A 
  href="http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com">Check 
  out</A> Yahoo! Messenger's low PC-to-Phone call rates.
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Zope maillist&nbsp; 
  -&nbsp; 
  Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**&nbsp;&nbsp; 
  No cross posts or HTML encoding!&nbsp; **<BR>(Related lists - 
  <BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-announce<BR>&nbsp;http://mail.zope.org/mailman/listinfo/zope-dev 
  )<BR></BLOCKQUOTE></BODY></HTML>