| com.ecyrd.jspwiki.url.URLConstructor
All known Subclasses: com.ecyrd.jspwiki.url.DefaultURLConstructor,
URLConstructor | public interface URLConstructor (Code) | | Provides an interface through which JSPWiki constructs URLs.
JSPWiki calls the methods of this interface whenever an URL
that points to any JSPWiki internals is required. For example,
if you need to find an URL to the editor page for page "TextFormattingRules",
you would call makeURL( WikiContext.EDIT, "TextFormattingRules", false, null );
author: Janne Jalkanen since: 2.2 |
Method Summary | |
public String | getForwardPage(HttpServletRequest request) Returns information which JSP page should continue handling
this type of request.
Parameters: request - The HTTP Request that was used to end up in this page. | public void | initialize(WikiEngine engine, Properties properties) Initializes. | public String | makeURL(String context, String name, boolean absolute, String parameters) Constructs the URL with a bunch of parameters.
Parameters: context - The request context (@see WikiContext) that you want the URL for Parameters: name - The page name (or in case of WikiContext.NONE, the auxiliary JSP page or resource you want to point at. | public String | parsePage(String context, HttpServletRequest request, String encoding) Should parse the "page" parameter from the actual
request. |
getForwardPage | public String getForwardPage(HttpServletRequest request)(Code) | | Returns information which JSP page should continue handling
this type of request.
Parameters: request - The HTTP Request that was used to end up in this page. "Wiki.jsp", "PageInfo.jsp", etc. Just return the name,JSPWiki will figure out the page. |
initialize | public void initialize(WikiEngine engine, Properties properties)(Code) | | Initializes. Note that the engine is not fully initialized
at this point, so don't do anything fancy here - use lazy
init, if you have to.
Parameters: engine - The WikiEngine that this URLConstructor belongs to Parameters: properties - Properties used to initialize |
makeURL | public String makeURL(String context, String name, boolean absolute, String parameters)(Code) | | Constructs the URL with a bunch of parameters.
Parameters: context - The request context (@see WikiContext) that you want the URL for Parameters: name - The page name (or in case of WikiContext.NONE, the auxiliary JSP page or resource you want to point at. This must be URL encoded. Null is NOT safe. Parameters: absolute - True, if you need an absolute URL. False, if both relative and absoluteURLs are fine. Parameters: parameters - An URL parameter string (these must be URL-encoded, and separated with &) An URL pointing to the resource. Must never return null - throw an InternalWikiExceptionif something goes wrong. |
parsePage | public String parsePage(String context, HttpServletRequest request, String encoding) throws IOException(Code) | | Should parse the "page" parameter from the actual
request. This is essentially the reverse of makeURL() - whenever a request
constructed by calls to makeURL() is passed to this routine, it MUST be
able to parse the resource name (WikiPage, Attachment, other resource) from
the request.
Parameters: context - In which request context the request was made (this shouldhelp in parsing) Parameters: request - The HTTP request that was used when coming here Parameters: encoding - The encoding with which the request was made (UTF-8 or ISO-8859-1). This method must return the name of the resource. throws: IOException - If parsing failes |
|
|