cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <>
Subject Re: Rewriting links in js files
Date Fri, 02 Feb 2007 13:47:12 GMT
Daniel Fagerstrom napisaƂ(a):
> Grzegorz Kossakowski skrev:
>> Hi,
>> Yes, it's me n-th time ;)
>> I would like to discuss link rewriting in js files and other text
>> resources (css for example). Obviosuly, soon or later, there will be
>> need (actually it already is, in Forms) to store some paths in JS files.
>> That means that we have to take care of rewriting links in this kind of
>> resources.
>> My proposal is to introduce new reader for this task. It would scan
>> whole content of file for valid URLs to rewrite, and do the job. I
>> think, it could be easily achieved by use of some regexps. Of course,
>> this new reader would implement caching because rewriting of some big
>> files would be quite time-consuming.
>> I haven't looked into the code of LinkRewritingTransformer so I'm not
>> sure if it's code could be reused. Even if I had to write it from
>> scratch I'm enough motivated but need to be sure that my work is not
>> waste of time.
>> Do you have any thoughts? Other options?
> I agree with that we need a rewriting transformer. For the actual
> implementation I don't think there is much to reuse from the
> LinkRewritingTransformer. There is a large difference in scanning SAX
> and a stream, for attributes. Furthermore I would propose making it
> specialized for rewriting the servlet protocol, so that the only
> configuration parameter is what attributes to rewrite.
I don't understand, I was asking about reader for rewriting links in js
files. There is no room for transformer and there are no attributes thus
we have to use regexps, right?

Writing specialized link rewriting transformer only for servlet: links
would make sense, but now my priority is to make all these refactorings
usable. Then we could polish details.

Grzegorz Kossakowski

View raw message