Create a site mapper. The following table maps all the entity/attribute
combinations that are (or could be) URL's to (possibly) rewrite.
Every link starting with "/" has the leading slash replaced by this
prefix.
Set the map table for cross-linked sites.
Foreach key in the table that matches a URL, replace the key
portion of the url with the key's value.
addMapEntry
public void addMapEntry(String name,
String value)
Add or remove an item to the map table
Parameters:
name - The prefix of the url to match
value - The prefix to replace it with. If null,
remove the prefix
addPatternEntry
public void addPatternEntry(String pattern,
String replacement)
Add or remove an item to the pattern table
Parameters:
pattern - The prefix pattern of the url to match
Full tcl8.0-style regexps are supported
replacement - The prefix to replace it with. If null,
remove the prefix. \n's are replaced by the
corrosponding sub-matches in the name
Patterns are stored in a vector, with each pattern taking 3
concecutive elements: the pattern, the replacement rule, and
the compiled expression. This way they are searched in order.
Sample usage:
http://www.([^.]*).com/ /site/\1/
will replace the url: http://www.foo.com/a/b.html with
/site/foo/a/b.html