<!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 could access the catalog as
follows:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> afolder =
context.restrictedTraverse('folderA/folderB/'+someLocalFolder)
# pass 'someLocalFolder' as a parameter</FONT></DIV>
<DIV> catalog = afolder.Catalog # assuming
you have named your ZCatalog 'Catalog'</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Note: If this script is accessing a
folder & 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 on the script</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>hth</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jonathan</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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 <suresh_vv@...><BR><BR>>1. Are you using
"container" rather than "context" in your script? <BR>>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><div
align="center" tal:condition="here/hasSearchEngine"><BR><BR>I changed it
thus:<BR><BR><div align="center"
tal:condition="here/hasSearchEngine(mycontext)"><BR><BR>I tested the
following script with "mycontext" as a passed parameter:<BR><BR>return
0<BR><BR>catalog = ''<BR>try:<BR> catalog =
getattr(mycontext,
mycontext.superValues('ZCatalog')[0].id)<BR>except:<BR>
pass<BR> <BR>if catalog:<BR> 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
-
Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**
No cross posts or HTML encoding! **<BR>(Related lists -
<BR> http://mail.zope.org/mailman/listinfo/zope-announce<BR> http://mail.zope.org/mailman/listinfo/zope-dev
)<BR></BLOCKQUOTE></BODY></HTML>