public class BasicFramework extends Framework
UrlConverters. It is
configured in 'config/framework.xml'. The order in which the UrlConverters
are configured is the order in which they are processed.| Modifier and Type | Field and Description |
|---|---|
static Parameter<String> |
ACTION |
protected LocalizedString |
description |
protected UrlConverter |
fallbackConverter |
static String |
NAMESPACE |
protected Map<Setting<?>,Object> |
settingValues |
static String |
XSD |
BLOCK, COMPONENT, COMPONENT_CLASS_KEY, COMPONENT_CURRENTUSER_KEY, COMPONENT_ID_KEY, COMPONENT_INCLUDEPATH_KEY, N| Constructor and Description |
|---|
BasicFramework() |
BasicFramework(Element el) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure(Element el)
Configures the framework by reading its config file 'config/framework.xml'
containing a list with UrlConverters.
|
Parameters |
createParameters()
Return a Parameters object that needs to be passed on to the getUrl() call.
|
Parameters |
createSettingValueParameters() |
protected String |
getComponentClass() |
String |
getInternalUrl(String page,
Map<String,?> params,
Parameters frameworkParameters)
Generates an URL to a resource to be called and included by a renderer.
|
protected String |
getKey(Setting<?> setting) |
protected Map<String,Object> |
getMap(State state,
Map<String,Object> params) |
String |
getName()
Return the name of the framework
|
Parameter<?>[] |
getParameterDefinition() |
protected String |
getPrefix(State state) |
String |
getProcessUrl(String path,
Map<String,?> parameters,
Parameters frameworkParameters,
boolean escapeAmps) |
Block |
getRenderingBlock(Parameters frameworkParameters)
Returns the block, which is currently rendering, or
null |
<C> C |
getSettingValue(Setting<C> setting,
Parameters parameters)
|
String |
getUrl(String path,
Map<String,?> parameters,
Parameters frameworkParameters,
boolean escapeAmps)
Return a (possibly modified) URL for a given path.
|
String |
getUserBuilder()
Return the builder name that is used to store users.
|
Node |
getUserNode(Parameters frameworkParameters)
Return an MMBase Node for the user currently using the framework.
|
<C> C |
loadSettingValue(Setting<C> setting) |
boolean |
makeRelativeUrl() |
Map<String,Object> |
prefix(State state,
Map<String,Object> params) |
void |
process(Processor processor,
Parameters blockParameters,
Parameters frameworkParameters)
I think in the basic framework this method is never called explicitely, because processing is
done implicitely by the render
|
void |
render(Renderer renderer,
Parameters blockParameters,
Parameters frameworkParameters,
Writer w,
WindowState windowState)
Basic Framework implicitely also processes, i'm not sure if we should require any framework
to do that (perhaps we could say, that the render method must process, if that is necessary,
and not yet done).
|
<C> void |
saveSettingValue(Setting<C> setting,
C value) |
protected void |
setBlockParametersForProcess(State state,
Parameters blockParameters) |
protected void |
setBlockParametersForRender(State state,
Parameters blockParameters) |
<C> C |
setSettingValue(Setting<C> setting,
Parameters parameters,
C value)
|
String |
toString() |
getInstancepublic static final String XSD
public static final String NAMESPACE
protected final UrlConverter fallbackConverter
protected final LocalizedString description
public BasicFramework(Element el)
public BasicFramework()
public String getUrl(String path, Map<String,?> parameters, Parameters frameworkParameters, boolean escapeAmps) throws FrameworkException
FrameworkgetUrl in class Frameworkpath - The path (generally a relative URL) to create an URL for.parameters - Parameters The parameters to be passed to the pageframeworkParameters - 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.null.FrameworkException - thrown when something goes wrong in the Frameworkpublic String getProcessUrl(String path, Map<String,?> parameters, Parameters frameworkParameters, boolean escapeAmps) throws FrameworkException
getProcessUrl in class FrameworkFrameworkExceptionpublic String getInternalUrl(String page, Map<String,?> params, Parameters frameworkParameters) throws FrameworkException
FrameworkJspRenderer,
who calls the resource using the RequestDispatcher.
This method allows for frameworks to do some filtering on URLs (such as pretty URLs).
You should generally not call this method unless you write a Renderer that depends on code or
data from external resources.getInternalUrl in class Frameworkpage - 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' objectsnull if nothing framework specific could be
determined (this would make it possible to 'chain' frameworks).FrameworkException - thrown when something goes wrong in the Frameworkpublic String getName()
Frameworkprotected void configure(Element el)
public Block getRenderingBlock(Parameters frameworkParameters)
FrameworknullgetRenderingBlock in class Frameworkpublic Parameter<?>[] getParameterDefinition()
getParameterDefinition in class Frameworkpublic Parameters createParameters()
FrameworkParameter.REQUEST and Parameter.RESPONSE. So it is
recommended that those parameters are supported by the framework.
The MMBase taglib component tag will e.g. auto-fill those parameters. Other parameters can be
added using 'mm:frameworkparameter'
A framework may create a different or expanded list of parameters, but is responsible for filling them properly.
If the framework does not use the MMBase taglib for rendering of components, it needs to provide it's own mechanism to
fill the above parameters with default values (such as through a servlet or portlet).createParameters in class Frameworkpublic boolean makeRelativeUrl()
protected void setBlockParametersForRender(State state, Parameters blockParameters)
protected void setBlockParametersForProcess(State state, Parameters blockParameters)
protected String getComponentClass()
public void render(Renderer renderer, Parameters blockParameters, Parameters frameworkParameters, Writer w, WindowState windowState) throws FrameworkException
render in class Frameworkrenderer - the Renderer used to produce the content. This parameter is obtained using Block.getRenderer(org.mmbase.framework.Renderer.Type)blockParameters - The parameters specific for the call of this renderer's blockframeworkParameters - The parameters that are required by the framework, such as the 'request' and 'cloud' objectsw - The writer where the code generated by the renderer is to be written (such as the jspWriter)windowState - the window state in which the content should be renderedFrameworkException - when the renderer failed to create content or could not write data to the writerpublic void process(Processor processor, Parameters blockParameters, Parameters frameworkParameters) throws FrameworkException
process in class Frameworkprocessor - the Processor used to produce the content. This parameter is obtained using Block.getProcessor()blockParameters - The parameters specific for the call of this renderer's block.frameworkParameters - The parameters that are required by the framework, such as the 'request' and 'cloud' objects.FrameworkException - when the process failed to runpublic Node getUserNode(Parameters frameworkParameters)
FrameworkBasicFramework, so based on MMBase security only, and
using a Parameter.CLOUD as a framework parameter. It can be implemented differently,
if the framework chooses not to use MMBase security to distinguish between users.getUserNode in class FrameworkframeworkParameters - The parameters that are required by the framework, such as the 'request' and 'cloud' objects.public String getUserBuilder()
FrameworkgetUserBuilder in class Frameworkpublic Parameters createSettingValueParameters()
createSettingValueParameters in class FrameworkFramework.getSettingValue(Setting, Parameters),
Framework.setSettingValue(Setting, Parameters, Object)public <C> C getSettingValue(Setting<C> setting, Parameters parameters)
FrameworkSetting (which is
always associated with a certain Component.
The framework can (and should) return the default values of the Setting if it does not know
what to do. It can also administrate overridden values, e.g. in its own configuration file.
Using the 'parameters' (created with Framework.createSettingValueParameters(), the Framework can also
implement context specific values for a setting. It can e.g. use a request object, and store
user specific value as cookies.getSettingValue in class Frameworkpublic <C> C setSettingValue(Setting<C> setting, Parameters parameters, C value)
FrameworkFramework.getSettingValue(org.mmbase.framework.Setting<C>, org.mmbase.util.functions.Parameters). Depending on the framework, the set value may not necessarily be persistent.setSettingValue in class Frameworkpublic <C> C loadSettingValue(Setting<C> setting)
public <C> void saveSettingValue(Setting<C> setting, C value)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}