org.mmbase.framework
Class Block

java.lang.Object
  extended by org.mmbase.framework.Block

public class Block
extends Object

A Block is a representation of a page within a component. It has two renderers, 'head' and 'body', and a processor. Blocks can be configured in a Component. A typical block configuration - this one is the 'applications' block (the former 'Applications' admin page) which is one of the core components - looks like this:

<block name="applications" classification="mmbase.admin" mimetype="text/html">
<title xml:lang="en">Applications</title>
<title xml:lang="nl">Applicaties</title>
<description xml:lang="en">Shows an overview of all MMBase apps1 applications</description>
<body jsp="applications.jspx">
<param name="application" type="String" />
</body>
</block>

An aspect of a block is rendered using one of it's Renderers, of which one can be obtained using getRenderer(org.mmbase.framework.Renderer.Type).

Since:
MMBase-1.9
Version:
$Id: Block.java 41989 2010-04-20 16:45:39Z michiel $
Author:
Johannes Verelst, Michiel Meeuwissen

Nested Class Summary
(package private) static class Block.BlockContainer
          A wrapper class for a certain block in a type, which defined its weighted place in between it's child block of the same type.
static class Block.Type
          Every block can be assigned a hierarchal 'Type', which can classify it.
 
Field Summary
protected  Parameter[] paramDefinition
           
protected  Parameter[] specific
           
 
Constructor Summary
Block(String name, String mimetype, Component parent, String cla)
           
 
Method Summary
(package private)  void addParameters(Parameter... params)
           
 Parameters createParameters()
          Before rendering, it may have to be fed with certain parameters.
 Block.Type[] getClassification()
          Returns the 'classification' of this block.
 Block.Type[] getClassification(String filter)
           
 Component getComponent()
           
 LocalizedString getDescription()
          Description for this block.
 String getMimeType()
          Mimetype for this block.
 String getName()
          Name for this block.
 Processor getProcessor()
           
 Renderer getRenderer(Renderer.Type type)
           
(package private)  Map<Renderer.Type,Renderer> getRenderers()
          All renderers assiociated with this Block.
 LocalizedString getTitle()
          A localized title for this block.
(package private)  Renderer putRenderer(Renderer.Type type, Renderer renderer)
           
(package private)  Processor setProcessor(Processor p)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

specific

protected Parameter[] specific

paramDefinition

protected Parameter[] paramDefinition
Constructor Detail

Block

public Block(String name,
             String mimetype,
             Component parent,
             String cla)
Method Detail

getName

public String getName()
Name for this block. Never null. The name identifies the block uniquely (between the blocks of its component).


getTitle

public LocalizedString getTitle()
A localized title for this block.


getMimeType

public String getMimeType()
Mimetype for this block. E.g. "text/html".


getClassification

public Block.Type[] getClassification()
Returns the 'classification' of this block. For example the blocks classified as 'mmbase.admin' are presented in the mmbase admin-pages.


getClassification

public Block.Type[] getClassification(String filter)
To Do:
This method is not yet implemented.

getDescription

public LocalizedString getDescription()
Description for this block. Never null


getRenderers

Map<Renderer.Type,Renderer> getRenderers()
All renderers assiociated with this Block. This is not a public method (it is used to create the block). Use #getRenderer(Renderer.Type).


getRenderer

public Renderer getRenderer(Renderer.Type type)
Returns:
A renderer for the given Render type. Never null

getProcessor

public Processor getProcessor()
Returns:
The processor associated with this block. Never null

addParameters

void addParameters(Parameter... params)

createParameters

public Parameters createParameters()
Before rendering, it may have to be fed with certain parameters. Obtain a parameters object which this method, fill it, and feed it back into Renderer.render(org.mmbase.util.functions.Parameters, java.io.Writer, org.mmbase.framework.RenderHints).


getComponent

public Component getComponent()
Returns:
the Component from which this block is a part.

toString

public String toString()
Overrides:
toString in class Object

setProcessor

Processor setProcessor(Processor p)

putRenderer

Renderer putRenderer(Renderer.Type type,
                     Renderer renderer)


MMBase 2.0-SNAPSHOT - null