[Yanel-dev] Using query strings to match [WAS: Re: [HEADS UP] ResourceManager and ResourceConfigurationMap class may die soon; resource-types' URL matching (e.g. on request parameters)

Michael Wechner michael.wechner at wyona.com
Wed Jul 20 15:26:11 CEST 2011


Hi

Am 18.07.11 14:41, schrieb Michael Wechner:
> Hi
>
> I have implemented this patch of Guillaume, whereas did some 
> modification to it.
>
> The next steps are:
>
> - Develop another matcher implementation which allows to use query 
> strings for mapping

I have developed another matcher which allows now to use query strings

src/core/java/org/wyona/yanel/core/ResourceConfigurationMapV2.java

It's not perfect yet, but for playing it should work fine. One currently 
has to enable it by changing:

Index: src/core/java/org/wyona/yanel/core/ResourceManager.java
===================================================================
--- src/core/java/org/wyona/yanel/core/ResourceManager.java    (revision 
59475)
+++ src/core/java/org/wyona/yanel/core/ResourceManager.java    (working 
copy)
@@ -47,8 +47,8 @@
       */
      public ResourceManager() {
          rtRegistry = new ResourceTypeRegistry();
-        resourceTypeMatcher = new ResourceTypeDefaultMatcher();
-        // TODO: Make resource matcher configurable: 
resourceTypeMatcher = new ResourceTypeMatcherV1ImplV2();
+        //resourceTypeMatcher = new ResourceTypeDefaultMatcher();
+        resourceTypeMatcher = new ResourceTypeMatcherV1ImplV2();
      }

One can dow now stuff like for example:

<matcher pattern="/**.jpg?scale=mobile" rcpath="/scale-image_yanel-rc.xml"/>

whereas for requests/URLs containing query strings, but the pattern 
contains no question mark the matching
should still work, which means it is backwards compatible.

We need to do more testing before enabling this new version for good (or 
as mentioning below, make it at least configurable, such that one can 
easily switch back).

Also we need to discuss about POST parameters, etc. Also see previous 
threads:

http://lists.wyona.org/pipermail/yanel-development/2009-December/004235.html
http://lists.wyona.org/pipermail/yanel-development/2009-December/004194.html

Also we can think about further re-factoring of

http://lists.wyona.org/pipermail/yanel-development/2009-July/003844.html

whereas we quickly get into discussions re access control as well ;-)

Thanks

Michael

> - Make matcher configurable per yanel and per realm
>



More information about the Yanel-development mailing list