<DIV>Hi everybody,</DIV>
<DIV> </DIV>
<DIV> 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> Let's say my directory structure looks like this:</DIV>
<DIV>/-+-Plone-+-homepage <BR> +-reports-+-Site1 <BR> +-Site2-+-myObject <BR> +-... <BR> +-... </DIV>
<DIV> </DIV>
<DIV> 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> </DIV>
<DIV> 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> </DIV>
<DIV>def getObject( self ):</DIV>
<DIV> return self.restrictedTraverse('/Plone/reports/Site2/myObject')</DIV>
<DIV><BR>myObject in this case is a php document that contains: </DIV>
<DIV><?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>?></DIV>
<DIV> </DIV>
<DIV>Now using the External Method from the homepage's index_html:</DIV>
<DIV><dtml-var getObject></DIV>
<DIV> </DIV>
<DIV>This is what I get, instead of the chart that this object displays:<BR><?php include "<A href="http://2ksvr/ploneSupp/lines.php?wk=2002-06-01">http://2ksvr/ploneSupp/lines.php?wk=2002-06-01</A>"; ?></DIV>
<DIV> </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> </DIV>
<DIV>but the script returns this:</DIV>
<DIV>&lt;?php</DIV>
<DIV>include &quot;http://2ksvr/ploneSupp/lines.php?wk=2002-06-01&quot;;</DIV>
<DIV>?&gt;</DIV>
<DIV><BR>What am I doing wrong? Any ideas or help is more than welcome.</DIV>
<DIV>Thanks,</DIV>
<DIV> </DIV>
<DIV> Ruben Montejano.<BR> 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>