[Zope-dev] How to enhance Zope URI resolver to understand URNs?

hnorris norris hnorrisalt@yahoo.com
Mon, 3 Dec 2001 13:44:46 -0800 (PST)


(using friend's email, please reply to
cstrong@arielpartners.com )

We are putting together a website using Zope.
All of our content is stored in XML documents.
The documents have links in them, some of which are
specified using URNs.

The cross links from one local document to another are
specified using URNs
instead of URLs so that the content remains
context-agnostic.  In this way, we can map the URN to
different URLs depending on the
particular Zope instance.   We don't want the content
to "know" about
the particular layout of the ZODB, or even that it
happens to be inside Zope at all!
(some of our clients use Apache Cocoon, or some other
technology)

There are three ways I can think of for making this
work:

1) Our XSLT transformer could reference a map
somewhere
and turn the URNs to URLs in the resulting HTML.

2) Our XSLT Transformer could leave the URNs alone,
and
the Zope URI Resolution mechanism could be enhanced
with
a lookup table that would map a URN to a URL.  Of
course,
the resolver would be programmed in python with full
access to the
power of acquisition... [:-)]

3) We could use acquisition directly, but there are
two drawbacks
a) it still requires knowledge of the layout of the
ZODB -- that is,
if something is in a particular sub-branch, you might
have to
use several <dtml-with> statements to make it work. 
That violates separation
of concerns.   b) we then have to emulate acquisiton
in non-Zope environments.

Thoughts, anyone?

TIA!

--Craeg


__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com