You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by st...@outerthought.org on 2004/02/23 18:00:02 UTC

[WIKI-UPDATE] WoodyCopletForPortalEngine Mon Feb 23 18:00:02 2004

Page: http://wiki.cocoondev.org/Wiki.jsp?page=WoodyCopletForPortalEngine , version: 1 on Mon Feb 23 16:17:23 2004 by 81.80.90.130

New page created:
+ I found some questions on the user mailing list about how to use woody with the Portal Engine. I have taken some time to reproduce the process with basic samples provided in Cocoon.\\
+ \\
+ To use woody in a coplet portal isn't very difficult but you need a special handling for the continuation. Got a Cocoon-2.1.4-dev, and we gonna put the woody/registration form (because it simple) inside a coplet.\\
+ \\
+ __Step 1:__ The first step is to modify one existing coplet to use a woody form.
+ Edit the {{portal/layout/copletdata/portal.xml}} file and change the value of the uri of the Portal-Demo with {{cocoon://samples/woody/registration}}.\\
+ {{{
+ ...
+ <coplet-data id="Portal-demo" name="standard">
+   ...
+   <value xsi:type="java:java.lang.string"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+     cocoon://samples/woody/registration
+   </value>
+   ...
+ </coplet>
+ ...
+ }}}
+ Log into the portal as guest/guest and in the main tab instead of the introduction coplet, you will ses the woody form.\\
+ Now the problem is that the KontId isn't handling. It's always the same uri called for this coplet. The simplest trick will be to put the KontID in an hidden filed and change the woody sitemap to handle it.\\
+ \\
+ __Step 2:__ Add the continuation hidden field. Edit the {{woody/forms/registration_template.xml}} and add after {{wt:form-template}} the tag
+ {{<wt:continuation-id/>}}
+ Then set the form action to an empty string, because we want use the portal page, not just the form. Your file should look like\\
+ {{{<page ...
+ <content>
+   <wt:form-template action="" method="POST">
+     <wt:continuation-id/>
+     <wt:widget-label id="name"/>
+ ...</page>
+ }}}
+ \\
+ __Step 3:__ Configure the sitemap to handle the continuation. we gonna switch the pipeline based on the request method.
+ Edit the woody/sitemap.xmap and replace the match pattern registration with\\
+ {{{<map:match pattern="registration">
+   <map:select type="request-method">
+     <map:when test="GET">
+       <map:call function="registration"/>
+     </map:when>
+     <map:when test="POST">
+       <map:call continuation="{request-param:continuation-id}"/>
+     </map:when>
+   </map:select>
+ </map:match>
+ }}}
+ That's all. Right now you can enjoy the woody inside a Coplet.\\
+ \\
+ __Optional Steps:__ The registration form is not design to put itshelf inside a coplet. You will need to remove the html/head/body part. It will be cleaner.\\
+ When you change the menu tab, you can see that you lose the woody context. It's because you loose also the KontId. To solve it you can put it in a coplet attribute instead of the request parameter.\\
+ \\
+ Hopes, it's clear enough\\
+ [Laurent Trillaud]
+