On 2/1/06, Andreas Hartmann <[EMAIL PROTECTED]> wrote:
> Josias Thoeny wrote:
> > Hi,
> >
> > The LinkRewritingTransformer in Lenya-trunk assumes that internal links
> > start with the context-prefix.
> > This looks like a bug to me, because IIRC we have discussed a long time
> > ago that internal links should not contain the context prefix.
>
> You even provided a patch to migrate the content:
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=31157
>
>
> > Furthermore, links added with BXE don't contain this prefix (which is
> > correct IMHO), so they are currently not being rewritten by the
> > transformer.
> >
> > Should I remove the context-prefix stuff from the LinkRewritingTransformer?
>
> +1
>
> -- Andreas
>

On the contrary, I believe that LinkRewritingTransformer should handle
more types of links, not less.  It should transform all types of
relative and absolute URI's and not just the ones that other parts of
Lenya happen to produce.  That includes the following forms:

foo.bar
../foo.bar
dir/foo.bar
dir1/../dir2/foo.bar
/CONTEXT/dir/foo.bar
SCHEME://host.domain.xyz/CONTEXT/dir/foo.bar

where host.domain.xyz matches the current host name.

Editors can (and should be able to) introduce links in a page using
whatever URI syntax is valid (including cut-and-paste from other
sources), and LinkRewritingTransformer should adjust them correctly,
according to the rules the site manager wants.  Some sight managers
want all URI's to start with "/".  Others prefer the use of ../..
links.  There are arguments to be made for each philosophy, and the
CMS shouldn't prohibit either. (There should probably be optional
parameters passed to the transformer to control some behaviors
according to the needs of the site.)

In addition, tags other than <a href="foo"> really need to be handled
also.  I mentioned this in a recent dev post  ("Rewriting
LinkRewritingTransformer") and listed them in a recent user post
("http://mail-archives.apache.org/mod_mbox/lenya-user/200601.mbox/[EMAIL 
PROTECTED]").
 They are:

<img src="foo">
<script src="foo">
<object data="foo">
<meta http-equiv="refresh" content="2;url=foo">
<link href="foo">
<embed src="foo">
<form action="foo">
...and maybe a few others
(In fact, all href attributes of *any* element probably ought to be
rewritten, if we want to be forward-looking).

Please, this sort of functionality is very important to making the CMS
appear stable and reliable.  I'll help where I can.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to