Hi Åke,
On Nov 23, 2009, at 6:52 PM, Åke Argéus wrote:
23 nov 2009 kl. 08.52 skrev Matteo Pelucco:
Åke Argéus ha scritto:
The way we handled this was making a custom virtualURIFilter that
handles responses of the type moved: as well as redirect: and
forward:.
This opened up the whole power of things like regexp-
virtualurimappings.
Oh, yes, it is a nice and powerful thing.
But how can you handle the response within a virtual uri mapping?
A "standard" virtual uri mapping simply redirect towards an
internal page...
The steps I miss are:
1) How can I retrieve the response inside a virtual uri mapping?
2) Is it safe to close the response (after having set the right
header infos) within a virtual uri mapping?
Well. In the virtualURIfilter you can most certaintly do whatever
you want with the response, and it has worked for us to send a 301
instead of 302 if the virtualurimapping returns moved; instead of
redirect:.
At least for now we have no cases where we are really interested in
checking anything in the request in our virtualurimappings though it
has crossed my mind that we might end up there.
Not sure what the best way to do that is though. It's quite possible
to extend the virtualurifilter even further and add the ability to
load a special customized version of virtualurimapping that takes a
request in it's active methods, and when looping though all the
existing virtualurimappings you can just do an instanceof to check
for this special class of virtualurimapping and act accordingly.
This is a bigger reimplementation of the virtualurifilter, but not
impossibly big, and shouldn't break a lot of things. You should
still try to stay within the basic style and framework of the
existing virualurifilter and could thereby keep the old functions
while extending it with your own style of virtualurimappings and
possible response-prefixes.
VirtualUrimappings could be one of the most powerful features in
magnolia, and it's very flexible, and isn't impossible to extend,
though I've thought of submitting a patch to make it more extendable
or powerful.
We'd love to see such improvements in the main code base; you're not
the only in need of such features ! Feel free to send patches over
indeed ! ;)
Cheers,
-g
/Åke
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------
----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------