Update of /var/cvs/documentation/backenddevelopers
In directory james.mmbase.org:/tmp/cvs-serv11959
Modified Files:
components.xml
Log Message:
updated docs a bit, some spellchecking.
See also: http://cvs.mmbase.org/viewcvs/documentation/backenddevelopers
Index: components.xml
===================================================================
RCS file: /var/cvs/documentation/backenddevelopers/components.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- components.xml 4 Jun 2007 19:40:18 -0000 1.14
+++ components.xml 25 Apr 2008 15:59:46 -0000 1.15
@@ -3,7 +3,7 @@
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
<article class="specification">
<articleinfo>
- <title>Component Framework</title>
+ <title>The MMBase Component Framework</title>
<date>2007-02-09</date>
@@ -18,7 +18,7 @@
</author>
<author>
- <firstname>Henk Hangyi</firstname>
+ <firstname>Henk</firstname>
<surname>Hangyi</surname>
</author>
@@ -32,6 +32,17 @@
<revhistory>
<revision>
+ <revnumber>[0.3]</revnumber>
+
+ <date>[2008-04-25]</date>
+
+ <authorinitials>[AvT]</authorinitials>
+
+ <revremark>[Spellchecking, updates a bit to reflect beta
+ release]</revremark>
+ </revision>
+
+ <revision>
<revnumber>[0.2]</revnumber>
<date>[2007-02-09 ]</date>
@@ -54,7 +65,7 @@
</revhistory>
<abstract>
- <para>This document describes the MMBase component framework.</para>
+ <para>This document describes the MMBase Component Framework.</para>
</abstract>
<legalnotice>
@@ -72,41 +83,47 @@
<section id="introduction">
<title>Introduction</title>
- <para>The component framework adds component based development to MMBase.
- To start appreciating component based development, lets turn to an example
- of integrating a poll component into your website. In the MMBase releases
- prior to 1.9, you had to include the poll.jsp into your jsp page. The most
- difficult part was that you had to change the url generated by the poll
- such that the answer provided by the user was posted to the right page.
- Moreover, the url also had to contain all other necessary information
- needed for other functionality on that same page. You also had to change
- the layout of poll.jsp so that the layout fits the layout of your website.
- By using the component framework the poll component can be integrated
- without the need to make a change to the component itself. The information
- to post the answer of the user to the right page is taken care of by the
- component framework and the layout of the poll follows the layout of the
- website automatically by means of the default css classes.</para>
+ <para>The MMBase Component Framework adds component based development to
+ MMBase. Components are applications or pieces of functionality that can be
+ plugged into a typical MMBase installation. Currently the most examples of
+ components can be found in the MMBase admin pages. These pages are
+ completely rewritten as components and blocks.</para>
+
+ <para>To start appreciating component based development, lets turn to an
+ example of integrating a poll component into your website. In the MMBase
+ releases prior to 1.9 you had to include the poll.jsp into your jsp. The
+ most difficult part was that you had to change the url generated by the
+ poll such that the answer provided by the user was posted to the right
+ page. Moreover, the url also had to contain all other necessary
+ information needed for other functionality on that same page. Besides that
+ you had to change the layout of poll.jsp so that the layout fits the
+ layout of your website. By using the component framework the poll
+ component can be integrated without the need to make a change to the
+ component itself. The information to post the answer of the user to the
+ right page is taken care of by the component framework and the layout of
+ the poll follows the layout of the website automatically by means of the
+ default css classes.</para>
- <para>Standardisation of the way components interact with one another is
+ <para>Standardization of the way components interact with one another is
another advantage of component based development. For instance you might
want the votes on the poll to be registered in the users profile of the
community component. In MMBase releases prior to 1.9 you had to "hardcode"
the presence of the community component in your website. Within the
component framework the poll component can simply ask whether the
- community component is present. More general in the component framework,
- components are aware of eachother presence and can respond to each others
- events. (TODO: is this already implemented ??)</para>
-
- <para>Of course if it is only a poll that has to be integrated, the
- overhead of using component based development is much larger than the gain
- from reusing the component without any change. However most component for
- instance in Didactor consists of 50+ templates. Imagine what it would mean
- if you could reuse such a component without the need to review and change
- all of these templates.</para>
+ community component is present.<!-- More general in the component
framework,
+ components are aware of each-other presence and can respond to each others
+ events. (TODO: is this already implemented ??) --></para>
+
+ <para>If only a poll has to be integrated, the overhead of using component
+ based development is much larger than the gain from reusing the component
+ without any change. However most components, for instance in Didactor,
+ consists of 50+ templates. Imagine what it if you could reuse such a
+ component without the need to review and change all of these
+ templates.</para>
<para>Components can be accessed from jsp-pages directly or be used in a
portlet engine / portal service. For use in jsp-pages MMBase offers tags
- in the MMBase taglibrary which put the components into action and render
+ in the MMBase tag library which put the components into action and render
their content into the pages of a website. When using a portlet engine and
portal service, like the CMS Container, this engine takes care of
analyzing the client request, make the selected portlets execute, render
@@ -114,50 +131,76 @@
</section>
<section id="hello_world">
- <title>Hello World!</title>
+ <title>"Hello World!" (or rather "Welcome")</title>
<para>Lets start with a simple example. The following configuration file
- for component "core" defines one block "components". This block has one
- renderer that can be used in the html <body> tag.</para>
+ snipet is from the component 'core' and defines one block named "welcome".
+ This block has one renderer that is used in the html <body>
+ tag.</para>
<note>
- <para>This file can be found in /config/components/core.xml. (see
- MMB-1391, the files for the MMBase core should be moved to /mmbase/core/
- )</para>
+ <para>This example can be found in '/config/components/core.xml'.</para>
</note>
- <programlisting><?xml version="1.0" encoding="UTF-8"?>
-<component
- name="core"
- defaultblock="components"
- xmlns="http://www.mmbase.org/xmlns/component"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.mmbase.org/xmlns/component
- http://www.mmbase.org/xmlns/component.xsd">
- <description xml:lang="en">MMBase core components</description>
- <block name="components" mimetype="text/html">
- <body jsp="/mmbase/admin/components.jspx" />
- </block>
-</component></programlisting>
-
- <para>The jsp-include "/mmbase/admin/components.jspx" could look
- like:</para>
+ <programlisting><block name="welcome"
+ classification="mmbase.about:10"
+ mimetype="text/html">
+ <title xml:lang="en">Welcome</title>
+ <description xml:lang="en">Shows welcome page for MMBase admin
pages</description>
+ <body jsp="about.jspx" />
+</block></programlisting>
+
+ <para>Its jsp, the block, which can found in
+ '/mmbase/admin/components/core' looks as follows (its a bit simplified to
+ make it easier to read):</para>
- <programlisting><?xml version="1.0"?>
-<div xmlns="http://www.w3.org/1999/xhtml"
+ <programlisting><mm:cloud
xmlns:jsp="http://java.sun.com/JSP/Page"
xmlns:mm="http://www.mmbase.org/mmbase-taglib-2.0">
- <jsp:output doctype-root-element="html" doctype-public="-//W3C//DTD XHTML
1.0 Strict//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
- <mm:content type="text/html" language="en" expires="0">
- <h1>Components admin page</h1>
- Hello World!
- </mm:content>
-</div></programlisting>
-
- <para>To render this, a jsp-page has to contain the following tag:</para>
+ <jsp:output omit-xml-declaration="true" />
+ <div class="mm_c mm_c_core mm_c_b_welcome">
+ <h2>Welcome to MMBase</h2>
+ <h3>You are running <mm:cloudinfo type="mmbaseversion"
/></h3>
+ <p>With some more text here...</p>
+ </div>
+</mm:cloud></programlisting>
+
+ <para>To render this block, a jsp-page should contain the following
+ tag:</para>
+
+ <programlisting><mm:component name="core" block="welcome"
/></programlisting>
+ </section>
+
+ <para>That's all.</para>
+
+ <para>A more complicated one is for example one of the blocks of the MMBase
+ cache with which you can interact. It enables you to disable, clear or show
+ the several MMBase caches.</para>
+
+ <programlisting><block name="cache"
+ classification="mmbase.tools"
+ mimetype="text/html">
+ <title xml:lang="en">Caches</title>
+ <description xml:lang="en">This tools hows the performance of the
various MMBase
+ caches. You can also (temporary) turn on/off the cache here. For a persistant
+ change you should change caches.xml.</description>
+ <head>
+ <class name="org.mmbase.framework.StringRenderer">
+ <param name="string"><![CDATA[<link rel="stylesheet"
href="{REQUEST.getContextPath}/mmbase/components/core/cache/style.css"
type="text/css" />]]></param>
+ </class>
+ </head>
+ <body jsp="cache/index.jspx">
+ <param name="active" type="String" />
+ <param name="cache" type="String" />
+ <param name="clear" type="String" />
+ <param name="rs_active" type="String" />
+ <param name="rs_show" type="String" />
+ <param name="rs_name" type="String" />
+ </body>
+</block></programlisting>
- <programlisting><mm:component name="core" block="components"
render="body" /></programlisting>
- </section>
+ <para>This block contains a css that needs to live in the head of the html
+ page. It also contains several parameters.</para>
<section id="configuration">
<title>Configuration of a component</title>
@@ -169,7 +212,7 @@
config files are stored inside the mmbase.jar.</para>
<para>The core of a component is the component.xml. It specifies the
- blocks in the component and the renderes within each block. The following
+ blocks in the component and the renders within each block. The following
example provides the ecards.xml for an ecard component.</para>
<programlisting><?xml version="1.0" encoding="UTF-8"?>
@@ -197,8 +240,8 @@
</block>
</component></programlisting>
- <para>In the above example most renderes are jsp-includes. It is also
- possible to use java classes as renderer, for example <process
+ <para>In the above example most renderers are jsp-includes. It is also
+ possible to use Java classes as renderer, for example <process
class="org.mmbase.ecards.Send" />.</para>
<para>The information available to the jsp files are the request
@@ -221,15 +264,15 @@
<para>In the "Hello World" example the following tag was used:</para>
- <programlisting><mm:component name="core" block="components"
render="body" /></programlisting>
+ <programlisting><mm:component name="core" block="welcome"
/></programlisting>
<para>The default block to be used by <mm:component /> when the
block attribute is omitted, can be specified by using the defaultblock
attribute of the <component /> tag at the beginning of the
component's configuration file. In the "Hello World" example it is
- defaultblock="components". If no defaultblock is specified the first
- block is considered to be the default block. The default renderer is
- body. By using the defaults the tag could be rewritten to:</para>
+ defaultblock="welcome". If no defaultblock is specified the first block
+ is considered to be the default block. The default renderer is body. By
+ using the defaults the tag could be rewritten to:</para>
<programlisting><mm:component name="core" /></programlisting>
@@ -266,7 +309,7 @@
contain:</para>
<programlisting><div
- class="mm_c mm_c_ecard mm_c_b_home ${requestScope.componentClassName}"
+ class="mm_c mm_c_core mm_c_b_welcome ${requestScope.componentClassName}"
id="${requestScope.componentId}"
></programlisting>
@@ -288,7 +331,7 @@
<para>The mimetype can be used to indicate that the component is
rendering special file types like images, attachments, etc. In the
example above we could have used mimetype="application/xhtml+xml". Where
- Firefox interpretes this filetype correctly and will check the validity
+ Firefox interprets this filetype correctly and will check the validity
of the page, the present versions of Internet Explorer will prompt the
user to download this page. Because of this IE bug it is better to use
"text/html".</para>
@@ -304,11 +347,11 @@
</section>
<section>
- <title>Absolutive and relative position of jsp-includes</title>
+ <title>Absolute and relative position of jsp-includes</title>
<para>In the Hello World example at the beginning of this chapter the
jsp include "/mmbase/admin/components.jspx" is positioned absolute to
- the root of the webapplication. By setting the request parameter
+ the root of the web application. By setting the request parameter
doMakeRelative to true, the jsp include can be positioned relative to
the jsp page that contains the <mm:component /> tag. TODO is this
functionality necessary for the component framework, see also
@@ -365,7 +408,7 @@
<para>A framework is an implementation of
org.mmbase.framework.Framework. By implementing the method
- Framework.getUrl() the behaviour of <mm:url /> and <mm:include
+ Framework.getUrl() the behavior of <mm:url /> and <mm:include
/> can be changed. This can be used to change the layout and the
includes used in the page, based on the parameters passed to that
page.</para>
@@ -674,7 +717,7 @@
portlet depends on the objectmodel of the CMS Container it is not
possible to rewrite it to an MMBase component, that can be reused
outside the CMS Container. Only portlets that do not depend explicitly
- on the objectmodel of the CMS Container can be rewriten into components.
+ on the objectmodel of the CMS Container can be rewritten into components.
The present version of the CMS Container in the MMBase CVS does not
contain examples of such portlets. But don't get worried: portlets like
calender, playlist, etc. which are now being developed will be added as
@@ -793,7 +836,7 @@
<title>The CMS Container</title>
<para>The CMS Container contains several portlets, which all can be
- viewed as seperate applications. These portlets can be found in
+ viewed as separate applications. These portlets can be found in
/contributions/CMSContainer/cmsc. For the CMS Container the Maven
preferred way of storing files is used. The files of these portlets are
stored in the following directories:</para>
@@ -1026,7 +1069,7 @@
</note>
<note>
- <para>The editwizards are stored in a seperate directory. In this way
+ <para>The editwizards are stored in a separate directory. In this way
the build process itself can move the editwizards to the directory
where the target application expects them.</para>
</note>
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs