<!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 root folder you could have a script that
accesses the ZCatalog which can be called from any subfolder and can tell
where it was called from... try the following: create a python script
(tst) in your root folder that contains the following code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>return str(traverse_subpath)<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>then invoke this script file as
followings:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>http:/your.web.site/tst</FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>http:/your.web.site/tst/folderA</FONT></DIV>
<DIV>
<DIV><FONT face=Arial
size=2>http:/your.web.site/tst/folderB/folderC</FONT></DIV>
<DIV> </DIV>
<DIV>(substitute your own subfolders as required)</DIV>
<DIV> </DIV>
<DIV>This may get you what you are looking for.</DIV>
<DIV> </DIV>
<DIV>Alternatively, if you need more control over the parameters that are
getting sent to the script file in the root folder, then you could create a
script file in each subfolder which calls the 'root script' with the necessary
'localized' parameters.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Jonathan</DIV></DIV></DIV></FONT>
<DIV><FONT face=Arial size=2></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 11:55
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: Jonathan <dev101@...><BR>&&<BR>From: Suresh V
<suresh_vv@...><BR><BR>>In your script you could access the catalog
as follows:<BR>> <BR>> afolder =
context.restrictedTraverse('folderA/folderB/'+someLocalFolder)
# pass 'someLocalFolder' as a parameter<BR>> catalog =
afolder.Catalog # assuming you have named your ZCatalog
'Catalog'<BR><BR>The problem with this, is that this script is used at the
base of a portal with several different Web sites, therefore, the root folder
of each is different.<BR><BR>>And where is mycontext defined? You will need
a tal:define="mycontext here" or something.<BR><BR>I added the
following:<BR><BR><div align="center"
<BR> tal:define="mycontext
here"<BR>
tal:condition="here/hasSearchEngine(mycontext)"><BR><BR>...but that didn't
seem to help any:<BR><BR>Error Type: KeyError<BR>Error Value:
'hasSearchEngine(mycontext)'<BR><BR>Concerning your comment about the except,
this script was written by an employee of mine. I'm now picking up where he
left off. I cleaned it up ;)<BR>TIA,<BR>Javier<BR></DIV></DIV><BR>
<HR SIZE=1>
Want to start your own business? Learn how on <A
href="http://us.rd.yahoo.com/evt=41244/*http://smallbusiness.yahoo.com/r-index">Yahoo!
Small Business.</A>
<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>