[ 
https://issues.apache.org/jira/browse/LABS-373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12729481#action_12729481
 ] 

Simone Gianni commented on LABS-373:
------------------------------------

URL rewriting in Magma happens using the URLRewritingStream. It captures the 
data flow Magma is sending to the browser and rewrites URLs based on "where" in 
the code the data is coming from. This way, the developer can use "relative" 
urls, which are relative to the handler or the package, and have them properly 
translated by magma in correct "server relative" urls, depending on how the 
application was composed.

This works quite well, but the current implementation assumes the flow of data 
is either binary (so no processing at all) or HTML. If it is HTML, then it uses 
common HTML markup to find out what to rewrite and what not, for example <* 
href="zzz" *> means that zzz has to be rewritten. 

Now, Magma is evolving to support more kind of data, like javascripts, XML 
(like RSS/Atom) etc.. In these formats, different filtering rules must apply to 
support URL rewriting. 

So the current implementation should be split in a base implementation, 
containing all the rewriting machinery, and in different "matching" subclasses, 
one matching parts to rewrite in HTML, one matching parts to rewrite in RSS 
etc.. To avoid reinventing the wheel every time, some intermediate sublcasses 
(like generic "markup matchers") could be implemented and then configured for 
special cases of different XMLs.

Since this functionality is used on every output magma sends, it is very 
important to keep an eye open on performance. It's better to have a 
non-completely-extensible system that performs very well, than a configurable 
one that performs bad.

> [web] Make URL rewriting more extensible, to support rewriting URLs in XML 
> (like RSS feeds) and not only HTML
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: LABS-373
>                 URL: https://issues.apache.org/jira/browse/LABS-373
>             Project: Labs
>          Issue Type: New Feature
>          Components: Magma
>    Affects Versions: Current
>            Reporter: Simone Gianni
>             Fix For: Current
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to