| java.lang.Object org.jamwiki.utils.InterWikiHandler
InterWikiHandler | public class InterWikiHandler (Code) | | Class for controlling inter-wiki links. An interwiki link is a link that is
specified using a namespace that is then resolved into an external link, such
as "Wikipedia:Main Page", which would resolve to
"http://en.wikipedia.org/wiki/Main_Page". The mappings of namespace values to
URL patterns are persisted in WEB-INF/classes/interwiki.properties.
|
Method Summary | |
public static String | formatInterWiki(String namespace, String value) Retrieve an inter-wiki mapping for the given namespace and use the value
parameter to create a URL to that wiki. | public static boolean | isInterWiki(String namespace) Return true if there is an inter-wiki mapping for the given namespace.
Parameters: namespace - The inter-wiki link namespace corresponding to the keyvalue in the interwiki.properties file. |
formatInterWiki | public static String formatInterWiki(String namespace, String value)(Code) | | Retrieve an inter-wiki mapping for the given namespace and use the value
parameter to create a URL to that wiki. For example, a namespace of
"wikipedia" and a value of "Main Page" will resolve to a the URL
"http://en.wikipedia.org/wiki/Main_Page".
Parameters: namespace - The inter-wiki link namespace corresponding to the keyvalue in the interwiki.properties file. This link is compared in acase-insensitive manner. Parameters: value - The page or topic name that is being linked to. Returns a formatted URL that links to the page specified by thenamespace and value. If no namespace mapping is present then a stringthat combines the namespace and value is returned, such as"namespace:value". |
isInterWiki | public static boolean isInterWiki(String namespace)(Code) | | Return true if there is an inter-wiki mapping for the given namespace.
Parameters: namespace - The inter-wiki link namespace corresponding to the keyvalue in the interwiki.properties file. This link is compared in acase-insensitive manner. true if an inter-wiki mapping exists, false otherwise. |
|
|