| java.lang.Object org.mmbase.framework.Framework
All known Subclasses: org.mmbase.framework.basic.BasicFramework,
Framework | abstract public class Framework (Code) | | A framework displays and processes components.
The Framework as UrlConverter must never return null , iow, it should
always know how to do this.
author: Johannes Verelst author: Pierre van Rooden version: $Id: Framework.java,v 1.47 2008/02/24 10:46:20 michiel Exp $ since: MMBase-1.9 |
Method Summary | |
abstract public Parameters | createParameters() Return a Parameters object that needs to be passed on to the getUrl() call.
Many components will be implemented as servlets, so will not work if the framework does not
at least include
Parameter.REQUEST and
Parameter.RESPONSE . | abstract public Parameters | createSettingValueParameters() | abstract public Block | getBlock(Parameters frameworkParameters) Returns the block which is specified by framework parameters. | public static Framework | getInstance() | abstract public String | getInternalUrl(String path, Map<String, Object> params, Parameters frameworkParameters) Generates an URL to a resource to be called and included by a renderer.
Typically, this generates a URL to a jsp, called by a renderer such as the
JspRenderer ,
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.
Parameters: path - The page (e.g. | abstract public String | getName() | abstract public Parameter[] | getParameterDefinition() | abstract public String | getProcessUrl(String path, Map<String, Object> parameters, Parameters frameworkParameters, boolean escapeAmps) | abstract public Block | getRenderingBlock(Parameters frameworkParameters) | abstract public C | getSettingValue(Setting<C> setting, Parameters parameters) Retrieves the value as configured by this framework for a certain
Setting (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. | abstract public String | getUrl(String path, Map<String, Object> parameters, Parameters frameworkParameters, boolean escapeAmps) Return a (possibly modified) URL for a given path.
This method is called (for example) from within the mm:url tag, and can be exposed to the outside world.
I.e. | abstract public String | getUserBuilder() Return the builder name that is used to store users. | abstract public Node | getUserNode(Parameters frameworkParameters) Return an MMBase Node for the user currently using the framework. | abstract public void | process(Processor processor, Parameters blockParameters, Parameters frameworkParameters) Processes a block. | abstract public void | render(Renderer renderer, Parameters blockParameters, Parameters frameworkParameters, Writer w, Renderer.WindowState state) Render content (such as HTML or XML) using a Renderer obtained from a component's block.
The framework decides on a (extra) class for the div which is to be rendered, which is put on
the request as
Framework.COMPONENT_CLASS_KEY .
Parameters: renderer - the Renderer used to produce the content. | abstract public C | setSettingValue(Setting<C> setting, Parameters parameters, C value) See
Framework.getSettingValue . |
COMPONENT_CLASS_KEY | final public static String COMPONENT_CLASS_KEY(Code) | | CSS-class to be used on block. T
|
COMPONENT_ID_KEY | final public static String COMPONENT_ID_KEY(Code) | | CSS-id to be used on block
|
N | final public static Parameter<Node> N(Code) | | A framework must be able to provide a node to the rendered blocks. This parameter could
indicate _which_ node.
|
framework | static Framework framework(Code) | | Reference to the Framework singleton.
since: MMBase-1.9 |
createParameters | abstract public Parameters createParameters()(Code) | | Return a Parameters object that needs to be passed on to the getUrl() call.
Many components will be implemented as servlets, so will not work if the framework does not
at least include
Parameter.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).
|
getBlock | abstract public Block getBlock(Parameters frameworkParameters)(Code) | | Returns the block which is specified by framework parameters.
|
getInstance | public static Framework getInstance()(Code) | | Return the framework, or null if there is no framework defined in mmbaseroot.xml
the framework |
getInternalUrl | abstract public String getInternalUrl(String path, Map<String, Object> params, Parameters frameworkParameters) throws FrameworkException(Code) | | Generates an URL to a resource to be called and included by a renderer.
Typically, this generates a URL to a jsp, called by a renderer such as the
JspRenderer ,
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.
Parameters: path - The page (e.g. image/css) provided by the component to create an URL for Parameters: params - Extra parameters for that path Parameters: frameworkParameters - The parameters that are required by the framework, such as the'request' and 'cloud' objects A valid interal URL, or null if nothing framework specific could bedetermined (this would make it possible to 'chain' frameworks). |
getName | abstract public String getName()(Code) | | Return the name of the framework
|
getParameterDefinition | abstract public Parameter[] getParameterDefinition()(Code) | | |
getSettingValue | abstract public C getSettingValue(Setting<C> setting, Parameters parameters)(Code) | | Retrieves the value as configured by this framework for a certain
Setting (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 adminstrate 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.
|
getUrl | abstract public String getUrl(String path, Map<String, Object> parameters, Parameters frameworkParameters, boolean escapeAmps) throws FrameworkException(Code) | | Return a (possibly modified) URL for a given path.
This method is called (for example) from within the mm:url tag, and can be exposed to the outside world.
I.e. when within a components's head you use
<mm:url page="/css/style.css" />,
this method is called to determine the proper url (i.e., relative to the framework or component base).
If you need treefile/leaffile type of functionality in your framework, you can implement that
here in your code.
Parameters: path - The path (generally a relative URL) to create an URL for. Parameters: parameters - Parameters The parameters to be passed to the page Parameters: frameworkParameters - The parameters that are required by the framework Parameters: escapeAmps - 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 isfor some reason called directly. An URL relative to the root of this web application (i.e. withouth a context path), |
getUserBuilder | abstract public String getUserBuilder()(Code) | | Return the builder name that is used to store users. This will return the name of the nodemanager that returns
the nodes from the getUserNode() method.
throws: UnsupportedOperationException - |
getUserNode | abstract public Node getUserNode(Parameters frameworkParameters)(Code) | | Return an MMBase Node for the user currently using the framework. It is recommended that this
is implemented as is done in
BasicFramework , 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.
|
process | abstract public void process(Processor processor, Parameters blockParameters, Parameters frameworkParameters) throws FrameworkException(Code) | | Processes a block. This method can change or se state information and should be called prior to rendering a component's block.
A process does not generate content.
Parameters: processor - the Processor used to produce the content. This parameter is obtained using Block.getProcessor Parameters: blockParameters - The parameters specific for the call of this renderer's block. Parameters: frameworkParameters - The parameters that are required by the framework, such as the 'request' and 'cloud' objects. throws: FrameworkException - when the process failed to run |
render | abstract public void render(Renderer renderer, Parameters blockParameters, Parameters frameworkParameters, Writer w, Renderer.WindowState state) throws FrameworkException(Code) | | Render content (such as HTML or XML) using a Renderer obtained from a component's block.
The framework decides on a (extra) class for the div which is to be rendered, which is put on
the request as
Framework.COMPONENT_CLASS_KEY .
Parameters: renderer - the Renderer used to produce the content. This parameter is obtained using Block.getRenderer Parameters: blockParameters - The parameters specific for the call of this renderer's block Parameters: frameworkParameters - The parameters that are required by the framework, such as the 'request' and 'cloud' objects Parameters: w - The writer where the code generated by the renderer is to be written (such as the jspWriter) Parameters: state - the window state in which the content should be rendered throws: FrameworkException - when the renderer failed to create content or could not write data to the writer |
|
|