[Zope] return value treated as dtml?
Ted holden
medved at fcc.net
Fri Oct 24 10:40:20 EDT 2003
On Friday 24 October 2003 00:51, Dylan Reinhardt wrote:
>...
> Perhaps you could provide an example of the problem you're trying to
> solve & we can take a whack at the easiest way to solve it?
> Dylan
Again, thanks. I pretty much gave up on using zclasses and products at least
for the time being, and I've actually gotten something like 98% of the
application working; there's just the one little detail left.
This is a text indexing and retrieval methodology and the assumption is that
an organization has a directory containing text files or some sort of files
with ascii text in them, which it wishes to make available to users over the
web. This might consist of large numbers of html files as is the usual case,
or it could just as easily consist of two or three large or gigantic files,
possibly several gigabytes.
The user enters a search term, and the application returns a list of hits in
the form of file-name/byte-offset pairs, e.g.:
Verified hits
* /home/bear/Text/SHAKE/MACBETH 71680
* /home/bear/Text/POE/ANNABEL 0
* /home/bear/Text/POE/ELDORADO 0
Now, once that screen comes up (is returned by the application and displayed),
I'd like to have the user be able to click on one of the lines and thereby
execute a method which would read a couple of thousand bytes around the
indicated byte offset in the given file, and display them.
The problem is that once a screen like that returns, you're outside the
confines of zope and dtml. Inside a dtml method, something like:
<a href=<dtml-call 'function('arg1', 'arg2')"> > first hit </a><br>
works well enough. That's basically the kind of effect I need.
I'm guessing at this point that the best shot might be to write the list of
hits to a file, and then return a handle to a dtml file which would pick up
the list of hits from the file and do the right things with them, and include
the user's name or id in the name of the hit file to keep users separate.
The question at that point would be whether an external method could return
the handle of a dtml method created within Zope or whether something like
dtmlfile could work outside of zclasses. That's just a guess; I'd be glad
to hear any suggestions.
Ted
More information about the Zope
mailing list