Upayavira wrote
Sylvain Wallez wrote:
Upayavira wrote:to include
<snip/>
If relevant, I've started extending the MountTableMatcher
sitemaps mountedthe code from the host selector. This means that you can set up virtual hosts in the matchtable.xml file, and have
Don't know/don't mind. I'd be happy to have a HostTableMatcher that extends/works with the MountTableMatcher. My desire/need is to see a system that enables me to do host based matching. I could happily have: <map:match type="host-table"> .... </map:match> <map:match type="mount-table"> ... </map:match>based upon hostname.
Mmmh... is it good to mix prefix-based and host-based mounts in a
single matcher?
Instead of using a host-header specific approach you could also opt to do a more general match on a user defined parameter. I use that approach in my sitemaps as well:
<map:select type="parameter"> <!-- o.a.c.selecting.ParameterSelector --> <map:parameter name="parameter-selector-test" value="{request:serverName}" /> <map:when test="myhost"> ... </map:when> ... </map:select>
This means you match on any string that is obtainable from an input module.
I imagine the syntax in this case to be something like:
<mount-table>
<mount pattern-to-match="myhost" value-to-compare="{request:serverName}" src="..."
uri-prefix=""
/>
<mount pattern-to-match="woody-samples" value-to-compare="{requestURI}" src="..." uri-prefix="woody-samples" />
<mount-table>
Notice that you would also be able to do a 'normal' mount match.
Maybe we could even say that when pattern-to-match and value-to-compare attributes are missing the implementation defaults to using the uri-prefix to match against.
Hey, hold on! Are the above use cases _really_ useful? We should not reinvent a "sitemap lite" language for the sake of the genericity of mount tables!
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects } Orixo, the opensource XML business alliance - http://www.orixo.com
