cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@cocoon.zones.apache.org
Subject [DAISY] Updated: Portal: Using forms
Date Tue, 16 Aug 2005 12:03:53 GMT
A document has been updated:

http://cocoon.zones.apache.org/daisy/documentation/598.html

Document ID: 598
Branch: main
Language: default
Name: Portal: Using forms (unchanged)
Document Type: Document (unchanged)
Updated on: 8/16/05 12:03:42 PM
Updated by: Helma

A new version has been created, state: publish

Parts
=====
Content
-------
This part has been updated.
Mime type: text/xml (unchanged)
File name:  (unchanged)
Size: 9829 bytes (previous version: 9837 bytes)
Content diff:
(11 equal lines skipped)
    <h1>Including Applications</h1>
    
    <p>The portal allows to include a complete web application (with forms, links
--- etc.) that is build with Cocoon. Therefore it's possible to develop the forms
+++ etc.) that is built with Cocoon. Therefore it's possible to develop the forms
    like you usually do with Cocoon without thinking about the portal. When you are
    finished just include this application into the portal as a coplet. The
    following shows you how to configure such an application as a coplet.</p>
(6 equal lines skipped)
    <p>For each application you have to configure a coplet data object in the
    profile:</p>
    
--- <pre>
--- ...
+++ <pre>...
       &lt;coplet-data id="app-test-two" name="standard"&gt;
          &lt;title&gt;Application Test&lt;/title&gt;
          &lt;coplet-base-data&gt;CachingURICoplet&lt;/coplet-base-data&gt;
(63 equal lines skipped)
    <p>In this chapter we demonstrate using a sample how to build forms that can be
    used within the portal. We will use Cocoon flow to define the logic for the
    form, but for your own form you can of course use a different approach as well.
--- If you want to have complex forms, you can also use Cocoon forms (Woody), but
+++ If you want to have complex forms, you can also use Cocoon forms (CForms), but
    you have to be careful with correctly using JavaScript on the client, which
    means you have to add the JavaScript to the response in the main portal pipeline
--- and not by the form itself. Or you avoid using JavaScript on the client :)</p>
+++ and not by the form itself. Or you avoid using JavaScript on the client. :)</p>
    
--- <p>As outlined in the previous chapter, you can define your form handling
+++ <p>As outlined in the previous section, you can define your form handling
    application without taking care about the portal, so let's start developing it.
    </p>
    
(4 equal lines skipped)
    whether we have to display the form or a different (result) page. So our sitemap
    looks like this:</p>
    
--- <pre>
--- ...
+++ <pre>...
          &lt;map:match pattern="form"&gt;
            &lt;map:call function="form"/&gt;
          &lt;/map:match&gt;
(5 equal lines skipped)
    means that either the form has to be displayed or the user just submitted some
    values. So we have to distinguish these two cases as well:</p>
    
--- <pre>
--- ...
+++ <pre>...
    function form() {
        // is the value stored in the session?
        if ( cocoon.session.getAttribute("form") == null ) {
(22 equal lines skipped)
    <p>In each case, the view is called which is a Cocoon pipeline. For example the
    pipeline for the form reads an XML document that looks like this:</p>
    
--- <pre>
--- ...
+++ <pre>...
    &lt;page&gt;
        &lt;title&gt;Form&lt;/title&gt;
        &lt;content&gt;
(11 equal lines skipped)
    <em>form</em> pipeline, containing the call to the flow.</p>
    
    <p>So, how does this work? Each link (or target of a form action) is rewritten
--- by the portal engine. The link is transformed into an event. When now the user
+++ by the portal engine. The link is transformed into an event. When the user
    activates such a link (or form) the event is send to the portal and the portal
    updates the URI to call for the portlet. The <em>portal-html-eventlink</em>
    transformer does the rewriting of all links and forms in combination with the
(19 equal lines skipped)
    is <em>copletid</em> and the value is the unique id. In our sample, we pass
this
    identifier to the flow script using an input module:</p>
    
--- <pre>
--- ...
+++ <pre>...
          &lt;map:match pattern="form"&gt;
            &lt;map:call function="form"&gt;
              &lt;map:parameter name="copletId" value="{request-param:copletid}"/&gt;
(5 equal lines skipped)
    <p>In the flow script, we can now use this identifier to calculate a unique
    session key to store the information:</p>
    
--- <pre>
---     // get the coplet id
+++ <pre>    // get the coplet id
        var cid = cocoon.parameters["copletId"];
        var key = cid + "/myform";
          </pre>
(23 equal lines skipped)


Fields
======
no changes

Links
=====
no changes

Custom Fields
=============
no changes

Collections
===========
Removed from collection: legacydocs
Added to collection: documentation

Mime
View raw message