Feature suggestion: (optional) config for oxf:xhtml-rewrite and oxf:html-rewrite

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Feature suggestion: (optional) config for oxf:xhtml-rewrite and oxf:html-rewrite

Eric van der Vlist
Hi,

I found out that an easy way to develop and publish PresentationServer
based site is to develop them in subdirectories of the "resources"
directory of a standard PresentationServer install and to use Apache's
proxy features to do the binding with the outside world.

For instance; my http://apiculteurs.info/ is developed as an
"apiculteurs" subdirectory and the mapping is done as:

ProxyPass / http://localhost:8280/orbeon/apiculteurs/
ProxyPassReverse / http://localhost:8280/orbeon/apiculteurs/

These directives do not deal with URL rewriting in the (X)HTML sources
and to cope with that issue, I have been using mod-proxy-html:

SetOutputFilter proxy-html
ProxyHTMLURLMap /orbeon/apiculteurs/ /

This output filter has some downsides: it rewrites the document and its
HTTP headers as defined by your configuration without taking care of the
headers that came from the server.

That means that if you take the pain in PresentationServer to serve
application/xhtml+xml to browsers that accept this media type and
text/html to the others, this won't survive passing through
mod-proxy-html.

To work around that, we could do this rewriting in PresentationServer
itself, based on the "Via" HTTP header.

This can be done in XSLT, but we could also leverage on your brand new
oxf:xhtml-rewrite and oxf:html-rewrite processors if they could accept
some kind of configuration input to control the rewriting that needs to
be performed.

What do you think?

Thanks,

Eric
--
Le premier annuaire des apiculteurs 100% XML!
                                                http://apiculteurs.info/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Feature suggestion: (optional) config for oxf:xhtml-rewrite and oxf:html-rewrite

Erik Bruchez
Administrator
Eric,

I was not familiar with that header. FYI, here is the spec:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.45

Yes this could be done. Right now, rewriting is done purely based on the
Servlet-returned protocol, host, port, etc. A configuration for those
processor could look like:

<config>
   <rewrite-base>[servlet|via-header]</rewrite-base>
</config>

Or something along those lines.

I added an RFE, but I don't know if we will have time to work on this here:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=304020&group_id=168&atid=350210

However, could this not be solved at the Apache or connector level? I.e.
could not mod_proxy or similar pass adequate information further down
the chain? I am just trying to see if there would not be another
solution to the rewriting problem, but I have to say I haven't thought
much about this issue!

-Erik

Eric van der Vlist wrote:

> Hi,
>
> I found out that an easy way to develop and publish PresentationServer
> based site is to develop them in subdirectories of the "resources"
> directory of a standard PresentationServer install and to use Apache's
> proxy features to do the binding with the outside world.
>
> For instance; my http://apiculteurs.info/ is developed as an
> "apiculteurs" subdirectory and the mapping is done as:
>
> ProxyPass / http://localhost:8280/orbeon/apiculteurs/
> ProxyPassReverse / http://localhost:8280/orbeon/apiculteurs/
>
> These directives do not deal with URL rewriting in the (X)HTML sources
> and to cope with that issue, I have been using mod-proxy-html:
>
> SetOutputFilter proxy-html
> ProxyHTMLURLMap /orbeon/apiculteurs/ /
>
> This output filter has some downsides: it rewrites the document and its
> HTTP headers as defined by your configuration without taking care of the
> headers that came from the server.
>
> That means that if you take the pain in PresentationServer to serve
> application/xhtml+xml to browsers that accept this media type and
> text/html to the others, this won't survive passing through
> mod-proxy-html.
>
> To work around that, we could do this rewriting in PresentationServer
> itself, based on the "Via" HTTP header.
>
> This can be done in XSLT, but we could also leverage on your brand new
> oxf:xhtml-rewrite and oxf:html-rewrite processors if they could accept
> some kind of configuration input to control the rewriting that needs to
> be performed.
>
> What do you think?
>
> Thanks,
>
> Eric
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Feature suggestion: (optional) config for oxf:xhtml-rewrite and oxf:html-rewrite

Erik Bruchez
Administrator
Erik Bruchez wrote:

>> This can be done in XSLT, but we could also leverage on your brand new
>> oxf:xhtml-rewrite and oxf:html-rewrite processors if they could accept
>> some kind of configuration input to control the rewriting that needs to
>> be performed.

As food for thought: you could instanciate multiple OXFServlet in your
web.xml, each one with a different page-flow.xml, and then have
different servlet mappings for each of those. I don't know if this would
help your rewriting issues at all.

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Feature suggestion: (optional) config for oxf:xhtml-rewrite and oxf:html-rewrite

Eric van der Vlist
Hi Erik,

On ven, 2005-09-02 at 17:47 -0700, Erik Bruchez wrote:

> Erik Bruchez wrote:
>
> >> This can be done in XSLT, but we could also leverage on your brand new
> >> oxf:xhtml-rewrite and oxf:html-rewrite processors if they could accept
> >> some kind of configuration input to control the rewriting that needs to
> >> be performed.
>
> As food for thought: you could instanciate multiple OXFServlet in your
> web.xml, each one with a different page-flow.xml, and then have
> different servlet mappings for each of those. I don't know if this would
> help your rewriting issues at all.
What I have done right now as a workaround is to use the "normal" path
with oxf:xhtml-rewrite or oxf:html-rewrite that do the real hard job and
after these processors check if there is a Via: header from my proxy and
when that's the case go through a very simple XSLT transformation that
does the final adaptation.

That doesn't seem terribly elegant, that wouldn't catch complex
rewritings like those that would be needed in Javascript or CSS, but
that seems to be working very well up to now...

Eric

>
> -Erik

--
Weblog:
                 http://eric.van-der-vlist.com/blog?t=category&a=English
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Feature suggestion: (optional) config for oxf:xhtml-rewrite and oxf:html-rewrite

Eric van der Vlist
In reply to this post by Erik Bruchez
On ven, 2005-09-02 at 17:23 -0700, Erik Bruchez wrote:

> Eric,
>
> I was not familiar with that header. FYI, here is the spec:
>
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.45
>
> Yes this could be done. Right now, rewriting is done purely based on the
> Servlet-returned protocol, host, port, etc. A configuration for those
> processor could look like:
>
> <config>
>    <rewrite-base>[servlet|via-header]</rewrite-base>
> </config>
>
> Or something along those lines.
>
> I added an RFE, but I don't know if we will have time to work on this here:
>
> http://forge.objectweb.org/tracker/index.php?func=detail&aid=304020&group_id=168&atid=350210
>
> However, could this not be solved at the Apache or connector level? I.e.
> could not mod_proxy or similar pass adequate information further down
> the chain?
Yes, that would make sense and maybe I should suggest this as a feature
request for mod_proxy_html...

PresentationServer is so flexible that I have acquired a tendency to
think it can solve all my problems :-) !

Eric  
--
Did you know it? Python has now a Relax NG (partial) implementation.
                                          http://advogato.org/proj/xvif/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
(ISO) RELAX NG   ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Feature suggestion: (optional) config for oxf:xhtml-rewrite and oxf:html-rewrite

Erik Bruchez
Administrator
In reply to this post by Eric van der Vlist
Eric van der Vlist wrote:

> Hi Erik,
>
> On ven, 2005-09-02 at 17:47 -0700, Erik Bruchez wrote:
>
>>Erik Bruchez wrote:
>>
>>
>>>>This can be done in XSLT, but we could also leverage on your brand new
>>>>oxf:xhtml-rewrite and oxf:html-rewrite processors if they could accept
>>>>some kind of configuration input to control the rewriting that needs to
>>>>be performed.
>>
>>As food for thought: you could instanciate multiple OXFServlet in your
>>web.xml, each one with a different page-flow.xml, and then have
>>different servlet mappings for each of those. I don't know if this would
>>help your rewriting issues at all.
>
>
> What I have done right now as a workaround is to use the "normal" path
> with oxf:xhtml-rewrite or oxf:html-rewrite that do the real hard job and
> after these processors check if there is a Via: header from my proxy and
> when that's the case go through a very simple XSLT transformation that
> does the final adaptation.
>
> That doesn't seem terribly elegant, that wouldn't catch complex
> rewritings like those that would be needed in Javascript or CSS, but
> that seems to be working very well up to now...
Glad you found a workaround :-) The main drawback I see if the
performance hit of yet another XSLT tranformation in the epilogue, other
than that it is a good solution.

-Erik



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws