Author: michiel
Date: 2010-03-01 16:56:43 +0100 (Mon, 01 Mar 2010)
New Revision: 41211

Modified:
   speeltuin/mihxil/portal/trunk/documentation/index.xml
Log:
more documentation

Modified: speeltuin/mihxil/portal/trunk/documentation/index.xml
===================================================================
--- speeltuin/mihxil/portal/trunk/documentation/index.xml       2010-03-01 
14:27:29 UTC (rev 41210)
+++ speeltuin/mihxil/portal/trunk/documentation/index.xml       2010-03-01 
15:56:43 UTC (rev 41211)
@@ -18,23 +18,101 @@
   </articleinfo>
   <section id="introduction">
     <title>Introduction</title>
-    <para>The component provides a simple way to create an MMBase-only 
'portal', i.e. a page which consists of configurable 'blocks' with
-    content, and an 'edit mode' for that page, which allows you to provide an 
editor for each block.</para>
+    <para>
+      The component provides a simple way to create an MMBase-only 'portal', 
i.e. a page which consists of configurable 'blocks' with
+      content, and an 'edit mode' for that page, which allows you to provide 
an editor for each block.
+    </para>
   </section>
   <section id="object_model">
     <title>Object model</title>
+    <para>The core of the object model used is the 'pages' node type. Any 
portal page can be represented by one or more of such objects (for
+    different points in time, a different 'pages' object can be used).
+    </para>
     <para>
+      The actual page is then defined by 'blocks' object which are related to 
such a 'page'.  A 'block' is a straight-forward representation
+      of a 'block' of the MMBase Framework. Often (when the block is made with 
JSP), the actual implementation of the block can be found in
+      /mmbase/components/&lt;name of the component&gt;/&lt;name of the 
block&gt;.jspx. In the MMBase Framework a component can be regarded
+      as a set of blocks, which belong together. The relation which is used to 
link pages to blocks is 'blockposrel'. In this relation the
+      position of the block on the page is stored, together with the size 
(height and width), and the windowstate.
     </para>
+    <para>Content is associated with the block, by relating objects using the 
'cartesianrel' to the page. So cartesianrel only contains
+    coordinated, because that uniquely identies the block in the page
+    </para>
   </section>
 
   <section id="frontend">
     <title>Programming of the frontend</title>
-    <para>
+    <para>To help implemenation the actual portal page, several tags are 
provided. See <ulink
+    url="http://www.mmbase.org/tags/mm/portal/";>mm-portal tags 
documentation.</ulink>. These tags suppose a 'current' node to which the
+    pages object must be related. It is left open what kind of type that 
object is. E.g. in the /Geschiedenis portal of the VPRO everything
+    is related to a 'portal' object.
     </para>
+    <programlisting id="samplejsp"><![CDATA[
+
+      <mm:import externid="showdate">now</mm:import>
+      <mm:node number="${portalnr}">
+        <mm-portal:page id="page" date="${showdate}" />
+      </mm:node>
+
+      <mm:node referid="page">
+        <mm-portal:blocks>
+          <os:cache
+              refresh="${param.flush eq blockposrel.number}"
+              scope="application"
+              key="mmportal/${portalid}/${blockposrel}-${showdate}"
+              groups="mmportal-${portalid}"
+              >
+            <c:catch var="e">
+              <mm:include
+                  debug="xml"
+                  referids="portal,block,blockposrel"
+                  
page="/mmbase/components/${block.component}/${block.name}.jspx" />
+              <!--this is the location for blocks in mmbase 1.9's component 
framework -->
+            </c:catch>
+            <c:if test="${! empty e}">
+              <mm:log>${e}</mm:log>
+              <div class="error"><mm:write value="${e}" /></div>
+              <os:usecached />
+            </c:if>
+          </os:cache>
+        </mm-portal:blocks>
+        </mm:node>
+        ]]>
+    </programlisting>
   </section>
   <section id="editors">
     <title>Editors</title>
-    <para></para>
+    <para>Also, some javascript is provided to relatively easy add links to an 
editor to  the shown blocks.
+    </para>
+    <para>
+      Add the following, or something similar, to the page:
+    </para>
+    <programlisting id="editorjsp"><![CDATA[
+      <c:if test="${! empty param.edit}">
+        <meta content="/themasites/portaledit/" 
name="org.mmbase.portal.editordir" />
+        <script type="text/javascript" 
src="/mmbase/portal/portal.js.jsp?language=nl"></script>
+      </c:if>
+      ]]>
+    </programlisting>
+    <para>The called editor for the block is determined using CSS-classes of 
it.
+    </para>
+    <programlisting id="block"><![CDATA[
+      <div
+          class="mm_c c_themasites b_teaser 
${requestScope['org.mmbase.componentClassName']}
+                 editable mm_editor_teaser mm_ea_node_${_node}
+                 mm_ea_portal_${param.portal} mm_ea_pos_${param.blockposrel}
+                 mm_ea_relatesto_page mm_ea_shows_teasers"
+          id="${requestScope['org.mmbase.componentId']}"
+          xmlns:jsp="http://java.sun.com/JSP/Page";
+          ]]>
+    </programlisting>
+    <para>
+      This block is editable, and it uses /themasites/portaledit/teaser/ for 
that. Some extra parameters are passed to this editor using
+      mm_ea_ classes.  In this directory can be placed whatever you like to 
edit this block. Editwizards, custom editors or vpro-wizards
+      (this last thing was done when this portal was made). An editable block 
in edit mode is recognizable because of the yellow 'edit'
+      buttons. When clicking on it, the editor opens in a jquery-ui 'dialog'. 
When closing this dialog, the page is reloaded with a 'flush'
+      argument which can be used to flush the (OS) cache for the edited block.
+    </para>
   </section>
 </article>
 

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to