org.mmbase.framework.basic
Interface UrlConverter

All Superinterfaces:
Serializable
All Known Implementing Classes:
BasicUrlConverter, BlockUrlConverter, ChainedUrlConverter, DirectoryUrlConverter, MMBaseUrlConverter, MyNewsUrlConverter

public interface UrlConverter
extends Serializable

Responsible for the proper handling of urls within the basic framework BasicFramework. You should implement UrlConverter if you want to create and resolve your own user-friendly links within BasicFramework. You can configure several UrlConverters in 'config/framework.xml'. They will be chained one after another.

Since:
MMBase-1.9
Version:
$Id: UrlConverter.java 40303 2009-12-26 15:58:15Z michiel $
Author:
Michiel Meeuwissen
To Do:
EXPERIMENTAL

Method Summary
 int getDefaultWeight()
           
 Url getInternalUrl(String path, Map<String,?> params, Parameters frameworkParameters)
          See Framework.getInternalUrl(String, Map, Parameters).
 Parameter<?>[] getParameterDefinition()
          An URLConverter can add parameters to it's parent Framework.
 Url getProcessUrl(String path, Map<String,?> parameters, Parameters frameworkParameters, boolean escapeAmps)
           
 Url getUrl(String path, Map<String,?> parameters, Parameters frameworkParameters, boolean escapeAmps)
          See Framework.getUrl(String, Map, Parameters, boolean).
 boolean isFilteredMode(Parameters frameworkParameters)
          The state of rendering will be determined (request.getRequestUri) and we will return if the current URL is managed by this UrlConverter
 

Method Detail

getParameterDefinition

Parameter<?>[] getParameterDefinition()
An URLConverter can add parameters to it's parent Framework. If the parameter is already defined in the Framework, the framework will of course ignore the one requested to be defined by this UrlConverter.


isFilteredMode

boolean isFilteredMode(Parameters frameworkParameters)
                       throws FrameworkException
The state of rendering will be determined (request.getRequestUri) and we will return if the current URL is managed by this UrlConverter

Throws:
FrameworkException

getDefaultWeight

int getDefaultWeight()

getUrl

Url getUrl(String path,
           Map<String,?> parameters,
           Parameters frameworkParameters,
           boolean escapeAmps)
           throws FrameworkException
See Framework.getUrl(String, Map, Parameters, boolean). But it can also return null which mean, 'I don't know.'

Parameters:
path - The path (generally a relative URL) to create an URL for.
parameters - Parameters The parameters to be passed to the page, as specified e.g. with mm:param -tags
frameworkParameters - The parameters that are required by the framework
escapeAmps - true if parameters should be added with an escaped & (&amp;). You should escape & when a URL is exposed (i.e. in HTML), but not if the url is for some reason called directly.
Returns:
An URL relative to the root of this web application (i.e. without a context path). Url.NOT if not determinable.
Throws:
FrameworkException - thrown when something goes wrong in the Framework

getProcessUrl

Url getProcessUrl(String path,
                  Map<String,?> parameters,
                  Parameters frameworkParameters,
                  boolean escapeAmps)
                  throws FrameworkException
Returns:
An URL relative to the root of this web application (i.e. without a context path). Never null
Throws:
FrameworkException

getInternalUrl

Url getInternalUrl(String path,
                   Map<String,?> params,
                   Parameters frameworkParameters)
                   throws FrameworkException
See Framework.getInternalUrl(String, Map, Parameters).

Parameters:
path - The page (e.g. image/css) provided by the component to create an URL for
params - Extra parameters for that path
frameworkParameters - The parameters that are required by the framework, such as the 'request' and 'cloud' objects
Returns:
A valid internal URL, or Url.NOT if nothing framework specific could be determined (this would make it possible to 'chain' frameworks).
Throws:
FrameworkException - thrown when something goes wrong in the Framework


MMBase 2.0-SNAPSHOT - null