| java.lang.Object sunlabs.brazil.handler.MapPage
MapPage | public class MapPage (Code) | | Utility class to rewrite links inside of web pages so they appear to
come from a different site.
author: Stephen Uhler version: 1.10, 05/25/99 |
Constructor Summary | |
public | MapPage(String prefix) Create a site mapper. |
Method Summary | |
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 Parameters: value - The prefix to replace it with. | 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 matchFull tcl8.0-style regexps are supported Parameters: replacement - The prefix to replace it with. | public void | addTag(String name, String attribute) add a tag/attribute pair to the rewrite list. | public String | convertHtml(String content) Rewrite all the url's in this document. | public String | convertString(String fix) Rewrite a url inside a tag parameter. | public void | log(String message) | public int | mapCount() | public void | setMap(Hashtable map) Set the map table for cross-linked sites. | public void | setPrefix(String prefix) Change the prefix that will replace the leading "/" in a URL. |
log | public static boolean log(Code) | | |
tagMap | public Hashtable tagMap(Code) | | Initialized to all tag/attribute pairs whose attribute values are
considered for rewriting.
|
MapPage | public MapPage(String prefix)(Code) | | Create a site mapper. The following table maps all the entity/attribute
combinations that are (or could be) URL's to (possibly) rewrite.
Parameters: prefix - Every link starting with "/" has the leadingslash replaced by prefix . If prefix isnull, then only fully qualified url's areconsidered for rewriting. |
addMapEntry | public void addMapEntry(String name, String value)(Code) | | Add or remove an item to the map table
Parameters: name - The prefix of the url to match Parameters: value - The prefix to replace it with. If null, remove the prefix |
addPatternEntry | public void addPatternEntry(String pattern, String replacement)(Code) | | Add or remove an item to the pattern table
Parameters: pattern - The prefix pattern of the url to matchFull tcl8.0-style regexps are supported Parameters: replacement - The prefix to replace it with. If null, remove the prefix. \n's are replaced by thecorrosponding sub-matches in the namePatterns are stored in a vector, with each pattern taking 3concecutive elements: the pattern, the replacement rule, andthe 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 |
addTag | public void addTag(String name, String attribute)(Code) | | add a tag/attribute pair to the rewrite list.
If the attribute is null, remove the tag.
|
convertHtml | public String convertHtml(String content)(Code) | | Rewrite all the url's in this document. This is accomplished
via repeated calls to
MapPage.convertString .
Parameters: content - The HTML to be processed. |
convertString | public String convertString(String fix)(Code) | | Rewrite a url inside a tag parameter.
Parameters: fix - The value of the tag to be rewritten (fixed) null of the existing value is OK,otherwise the new value is returned |
mapCount | public int mapCount()(Code) | | How many tags have been mapped?
|
setMap | public void setMap(Hashtable map)(Code) | | 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.
|
setPrefix | public void setPrefix(String prefix)(Code) | | Change the prefix that will replace the leading "/" in a URL.
|
|
|