<div dir="ltr">This is like KSS question: why we resolve a question with the first way we find? not the better one? Is the human being. But as Steve Jobs said some time ago: only excelence people don't stop in the first way to resolve a problem<br>
<br>When I meet Zope for the first time I was absolutely impress with it<br>There was nothing better to represent an object universe<br><br>I know that Zopers have their own way (this was discuss some time ago, too) but my ideal scenario will be a minimalism Zope where everything was an URL<br>
<br>In this ideal scenario you could ask for an URL with or without parameters as if you ask for to the browser<br><br>We stop this theme to wait for a Plone2PDF or similar. I hope we could solve this in a simple way (I think if this needs a more complicated solution we will have failed)<br>
<br>I only need to put a link with the PDF download to the current page! (this don't sound to much complicated, isn't it?)<br><br><div class="gmail_quote">2008/10/12 Dieter Maurer <span dir="ltr"><<a href="mailto:dieter@handshake.de">dieter@handshake.de</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Garito wrote at 2008-10-11 16:39 +0200:<br>
<div class="Ih2E3d">>Did you imagine another way to do what I need to do?<br>
<br>
</div>I have not followed intensively "what you need to do".<br>
Thus, what follows may not be adequate.<br>
<br>
When I remember right, then a PageTemplate's namespace is passed<br>
on to a "Script (Python)" when this script binds "namespace".<br>
Thus, this way you get access to the variables defined in the template.<br>
<br>
A simple path "var/s1/.../sn" is roughly requivalent to<br>
<br>
x = var.restricedTraverse("s1/.../sn")<br>
if callable(x): x = x() # "callable" may not be available in "Script (Python)"<br>
<br>
If the path contains "?var", these must be resolved beforehand.<br>
<br>
More complex paths "p1 | p2 | ... pn" are roughly equivalent<br>
to<br>
<br>
exc = None<br>
for p in (p1, p2, ... pn):<br>
try: return path1(p, ...)<br>
except <some standard exceptions>:<br>
exc = sys.exc_info()<br>
if exc is not None: raise exc[0], exc[1], exc[2]<br>
<br>
The most difficult part are for paths where "pn" is not a path<br>
expression but an arbitrary one. In this case, the concrete<br>
TALES implementation will be required for an interpretation.<br>
<br>
<br>
Along this outline, a function "path(path_expr, variable_binding)"<br>
can be defined which roughly behaves like "path(path_expr)" in<br>
a PageTemplate with the current variable binding expressed<br>
as "variable_binding".<br>
<br>
For simple cases, this function could be implemented in untrusted<br>
code. Complex cases will require access to the TALES implementation<br>
and therefore probably trusted code.<br>
<br>
<br>
<br>
--<br>
<font color="#888888">Dieter<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Mis Cosas<br><a href="http://blogs.sistes.net/Garito">http://blogs.sistes.net/Garito</a><br>Zope Smart Manager<br><a href="http://blogs.sistes.net/Garito/670">http://blogs.sistes.net/Garito/670</a><br>
</div>