public abstract class BlockUrlConverter extends Object implements UrlConverter
| Modifier and Type | Field and Description |
|---|---|
protected Map<Component,Set<Block>> |
blocks |
protected Set<Component> |
components |
protected BasicFramework |
framework |
| Constructor and Description |
|---|
BlockUrlConverter(BasicFramework fw) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBlock(Block b)
Explicitly add a block to make sure this BlockUrlConverter is only about that block.
|
protected void |
addComponent(Component comp)
Explicitly add a block to make sure this BlockUrlConverter is only about that block.
|
Block |
getBlock(String path,
Parameters frameworkParameters)
Determins for which block an URL will be generated.
|
protected Collection<Block> |
getBlocks(Component c)
The blocks for which this UrlConverter can produce a 'nice' url.
|
protected Collection<Component> |
getComponents()
The components for which this UrlConverter can produce a 'nice' url.
|
int |
getDefaultWeight() |
protected Block |
getExplicitBlock(String path,
Parameters frameworkParameters)
This proposal implemention simply uses
Framework.COMPONENT and Framework.BLOCK framework parameters to determin the explicit block for getUrl(java.lang.String, java.util.Map<java.lang.String, ?>, org.mmbase.util.functions.Parameters, boolean, boolean),
which may often be what you want. |
protected abstract Url |
getFilteredInternalUrl(String path,
Map<String,?> params,
Parameters frameworkParameters)
When implementing this method you can assume that you don't have to return
Url.NOT. |
Url |
getInternalUrl(String path,
Map<String,?> params,
Parameters frameworkParameters)
|
protected abstract Url |
getNiceUrl(Block block,
Parameters blockParameters,
Parameters frameworkParameters,
boolean action)
When implementing this method, you can already assume that the url must be 'nice', iow that we
are actually rendering in the 'realm' of this UrlConverter, and you can straightforwardly,
withough any checking, produce the URL.
|
Parameter[] |
getParameterDefinition()
Block url converters add an explicit 'component' and 'block' framework parameters
|
Url |
getProcessUrl(String path,
Map<String,?> parameters,
Parameters frameworkParameters,
boolean escapeAmps) |
protected State |
getState(Parameters frameworkParameters) |
Url |
getUrl(String path,
Map<String,?> parameters,
Parameters frameworkParameters,
boolean escapeAmps)
|
protected Url |
getUrl(String path,
Map<String,?> parameters,
Parameters frameworkParameters,
boolean escapeAmps,
boolean action)
Parameterized proposal implementation for both
getUrl(java.lang.String, java.util.Map<java.lang.String, ?>, org.mmbase.util.functions.Parameters, boolean, boolean) and getProcessUrl(java.lang.String, java.util.Map<java.lang.String, ?>, org.mmbase.util.functions.Parameters, boolean),
because they will probably be about the same. |
abstract boolean |
isFilteredMode(Parameters frameworkParameters)
Whether the current request already is in the realm of this URL-converter; the url converter
must implement here how it recognizes itself.
|
protected final BasicFramework framework
public BlockUrlConverter(BasicFramework fw)
public Parameter[] getParameterDefinition()
getParameterDefinition in interface UrlConverterprotected void addComponent(Component comp)
protected void addBlock(Block b)
protected Collection<Component> getComponents()
null if it
can do that for any component.protected Collection<Block> getBlocks(Component c)
protected Block getExplicitBlock(String path, Parameters frameworkParameters) throws FrameworkException
Framework.COMPONENT and Framework.BLOCK framework parameters to determin the explicit block for getUrl(java.lang.String, java.util.Map<java.lang.String, ?>, org.mmbase.util.functions.Parameters, boolean, boolean),
which may often be what you want.FrameworkExceptionpublic Block getBlock(String path, Parameters frameworkParameters) throws FrameworkException
null if the current URL is not
managed by this URLConverter.FrameworkExceptionpublic int getDefaultWeight()
getDefaultWeight in interface UrlConverterpublic abstract boolean isFilteredMode(Parameters frameworkParameters) throws FrameworkException
isFilteredMode in interface UrlConverterFrameworkExceptionprotected State getState(Parameters frameworkParameters)
protected final Url getUrl(String path, Map<String,?> parameters, Parameters frameworkParameters, boolean escapeAmps, boolean action) throws FrameworkException
getUrl(java.lang.String, java.util.Map<java.lang.String, ?>, org.mmbase.util.functions.Parameters, boolean, boolean) and getProcessUrl(java.lang.String, java.util.Map<java.lang.String, ?>, org.mmbase.util.functions.Parameters, boolean),
because they will probably be about the same.FrameworkExceptionpublic Url getUrl(String path, Map<String,?> parameters, Parameters frameworkParameters, boolean escapeAmps) throws FrameworkException
UrlConverterFramework.getUrl(String, Map, Parameters, boolean).
But it can also return null which mean, 'I don't know.'getUrl in interface UrlConverterpath - 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 -tagsframeworkParameters - The parameters that are required by the frameworkescapeAmps - true if parameters should be added with an escaped & (&).
You should escape & when a URL is exposed (i.e. in HTML), but not if the url is
for some reason called directly.Url.NOT if not determinable.FrameworkException - thrown when something goes wrong in the Frameworkpublic Url getProcessUrl(String path, Map<String,?> parameters, Parameters frameworkParameters, boolean escapeAmps) throws FrameworkException
getProcessUrl in interface UrlConverternullFrameworkExceptionprotected abstract Url getNiceUrl(Block block, Parameters blockParameters, Parameters frameworkParameters, boolean action) throws FrameworkException
block - Block for which the produce the url forblockParameters - Parameters to use for this block. The implementation may set parameters
to null which were represented in the returning String.frameworkParameters - action - FrameworkExceptionpublic final Url getInternalUrl(String path, Map<String,?> params, Parameters frameworkParameters) throws FrameworkException
UrlConvertergetInternalUrl in interface UrlConverterpath - The page (e.g. image/css) provided by the component to create an URL forparams - Extra parameters for that pathframeworkParameters - The parameters that are required by the framework, such as the
'request' and 'cloud' objectsUrl.NOT if nothing framework specific could be
determined (this would make it possible to 'chain' frameworks).FrameworkException - thrown when something goes wrong in the Frameworkprotected abstract Url getFilteredInternalUrl(String path, Map<String,?> params, Parameters frameworkParameters) throws FrameworkException
Url.NOT. IOW it is certain that the current URL is 'nice' according to this URL
Converter.FrameworkExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}