<DIV>Hi everybody,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp; The task I am trying to accomplish is to be able to call an object(it could<BR>be a dtml method, python script, php document, etc), given its path as a string<BR>parameter.</DIV>
<DIV>&nbsp;&nbsp; Let's say my directory structure looks like this:</DIV>
<DIV>/-+-Plone-+-homepage <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +-reports-+-Site1 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +-Site2-+-myObject <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +-... <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +-... </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; I need to call myObject, which path is '/Plone/reports/Site2/', from any<BR>other directory within the directory structure, but at this time I'm using<BR>homepage.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Browsing the mailing list I found that I could use restrictedTraverse, so<BR>I created an External Method getObject under the homepage directory with the<BR>following code:</DIV>
<DIV>&nbsp;</DIV>
<DIV>def getObject( self ):</DIV>
<DIV>&nbsp;&nbsp;&nbsp; return self.restrictedTraverse('/Plone/reports/Site2/myObject')</DIV>
<DIV><BR>myObject in this case is a php document that contains: </DIV>
<DIV>&lt;?php</DIV>
<DIV>include "<A href="http://2ksvr/ploneSupp/lines.php?wk=2002-06-01">http://2ksvr/ploneSupp/lines.php?wk=2002-06-01</A>";</DIV>
<DIV>?&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>Now using the External Method from the homepage's index_html:</DIV>
<DIV>&lt;dtml-var getObject&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>This is what I get, instead of the chart that this object displays:<BR>&lt;?php include "<A href="http://2ksvr/ploneSupp/lines.php?wk=2002-06-01">http://2ksvr/ploneSupp/lines.php?wk=2002-06-01</A>"; ?&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>I also tried creating a python script with the following code:</DIV>
<DIV>return container.restrictedTraverse('/Plone/pig_reports/test_farrowing/crChart')</DIV>
<DIV>&nbsp;</DIV>
<DIV>but the script returns this:</DIV>
<DIV>&amp;lt;?php</DIV>
<DIV>include &amp;quot;http://2ksvr/ploneSupp/lines.php?wk=2002-06-01&amp;quot;;</DIV>
<DIV>?&amp;gt;</DIV>
<DIV><BR>What&nbsp;am I&nbsp;doing wrong? Any ideas or help is more than welcome.</DIV>
<DIV>Thanks,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ruben Montejano.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; email: <A href="mailto:rubemontejano@yahoo.com">rubemontejano@yahoo.com</A><BR></DIV><BR><BR>----------------------------------------------------<br>Ruben Montejano.<br>phone: (309) 837-2318<br>email:   rubemontejano@yahoo.com<p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=21260/*http://photos.yahoo.com">New Yahoo! Photos - easier uploading and sharing</a>