On Wed, 2006-02-01 at 14:35 -0500, Bob Harner wrote: > 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.)
I don't quite agree with that, instead I think there should be a clear contract about what an internal link is. (Right now the contract is /pubid/area/doc-url) What happens with an internal link like ../foo when you move the document containing this link? Or what happens with a link like http://host/context-prefix/foo when you deploy the document on a different host, or with a different context-prefix? > > 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). Basically, I agree here. But since Lenya knows only about document urls, it's not so easy to implement. The way I wanted to handle this is to pass the correct base url to the xsl instead of the current $root parameter. WDYT? > Please, this sort of functionality is very important to making the CMS > appear stable and reliable. I'll help where I can. Thanks for offering your help, it's appreciated! Currently I'm not sure which way to go. I hope that we will soon have unique IDs for Lenya documents. This will change the whole link handling anyway. Josias > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
