[Zope] Improve linking strategies?

Oliver Wrede owrede@khm.de
Tue, 15 Feb 2000 14:29:49 +0100


I think link-handling for editorial staff is rather cruel in Zope! So I was
thinking about a beginner-level mechanism.

If I have a table (e.g. an SQL database) with Title and URL information, I'd
like to replace all listed titles in a text with an URL.


Example for a table:

1, "MyText", "http://www.mylink.org", NULL
2, "YourText", "http://www.yourlink.org", "<a
href=\"http://www.yourlink.org\" target=\"_blank\">Other Place</a>"


Example for a text:

When it comes to "MyLink" ist should go to "YourLink".


Destianted output:

When it comes to <a href="http://www.mylink.org">MyLink</a> it should go to
<a href="http://www.yourlink.org" target="_blank">Other Place</a>.



What steps does a newbie like me have to take, to get this working?

I can think that far:

a) I may need some kind of external script written in Python
b) I will have to make a list of all phrases in "..."-pairs
c) I will have to do a SQL-select on each and string.replace each occurance
d) I will have to be a Zope-wizard, if I want to add this functionality to
existing strcutured-text formatted output....

What I can't think of yet:

1. Is this the right approach?
2. If performance will be lousy.
3. How to I get the Python beast into Zope?
4. How would the Python beast look like?


Any ideas?


Oliver


.. Oliver Wrede
.. owrede@khm.de

.. Academy of Media Arts, Cologne
.. Peter-Welter-Platz 2 . 50676 Koeln, Germany
.. http://www.khm.de
.. ICQ# 6580315
.. PGP 6.0 Fingerprint:
.. 922C FFA2 9A07 5B8E CB2A  10A2 C370 6A62 2232 196C