cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicola Ken Barozzi" <nicola...@supereva.it>
Subject Forms proposal
Date Mon, 03 Jul 2000 08:18:08 GMT
----- Original Message ----- 
From: "Jon Lancelle" <jkl@knosys.com>
To: <cocoon-dev@xml.apache.org>
Sent: Sunday, July 02, 2000 8:00 PM
Subject: Your favorite way to handle form submissions

> Any thoughts on handling form submissions from the client via Cocoon? I
> want to start down the right path from square one...
> 
> 
> My first inclination is to write a producer. Has anyone used ECS from
> Apache successfully in a producer?
> 
> How about a simple servlet which either redirects when done to an *.xml
> file for continuation or generates some well-formed HTML in response,
> complete with links back to the xml model?
> 
> Jon Lancelle

I would like to take this mail as an opportunity to discuss about the use of
forms in Cocoon, and about how it can be done.

I know that others have started similar discussions and implementations
in the past, and I apologise beforehand if I repeat things and are not 
aware of some past conclusions.
This is my contribution to the subject, I'm waiting comments.

The goal is setting up a new form system that integrates well with
the notion of content-view separation.
The system has to be as flexible, simple and extensible as possible.
The starting point is the XForms specification draft on the W3C site.

First of all: what is a form?
Even better: what is a form system?

A form system is a way of inverting the data stream: the data comes 
from the client.
A form is a way of presenting the "questions" that answered create the
data sent to the server. 

The verb "presenting" suggests that forms are
a view... so they need stylesheets (1), one for every client type.
Forms are not only style, because they are also content like any other
content. You need xml (2) to drive a stylesheet.
Form data needs to be checked for correctness, so you
need a validator (3).
The validator validates against a schema (4).
Then you need to do something with the data (5).

Looking at the XForm spec you can see that (2) is html, svg, etc.
We need xml that gets mapped dynamically to those formats.

The following is a scheme of how things can work and what is needed.
I made two versions hoping all can see it ok.
(this drawing is for fixed space fonts).

4)                 -----------------------
XML Schema --------|   schema file ref    |
                   |                      |
                   | <xml>                |
                   |                      |
                   |                      |
                   |<schema element ref/> | (2)
                   |                      |
                   |                      |
                   |      </xml>          |
                   |                      |
                   -----------------------
                            |
 ----client input ----------|
 |                     processor (3)
 |                          |
XSL(1)------yes-------error in validation?
                            |
                           no
                            |
                    -----------------------
XML Schema --------|   schema ref          |
                   |  <next pi>            |
                   | <root>                |
                   |                       |
                   |                       |
                   |<element>              |
                   |                       |
                   |                       |
                   |      </root>          |
                   |                       | 
                   -----------------------
                             |
                             |
                            (5)


(this drawing is ok in Outlook).

(4)                                -----------------------
XML Schema --------|   schema file ref          |
                                   |                                  |
                                   | <xml>                       |
                                   |                                  |
                                   |                                  |
                                   |<schema element ref/>| (2)
                                   |                                  |
                                   |                                  |
                                   |      </xml>                 |
                                   |                                  |
                                   -----------------------
                                                   |
             ----client input ----------|
             |                             processor (3)
             |                                     |
          XSL(1)------yes-------error in validation?
                                                   |
                                                  no
                                                   |
                                   -----------------------
XML Schema --------|   schema ref               |
                                   |  <next pi>                 |
                                   | <root>                      |
                                   |                                  |
                                   |                                  |
                                   |<element>                  |
                                   |                                  |
                                   |                                  |
                                   |      </root>                |
                                   |                                  | 
                                   -----------------------
                                                   |
                                                   |
                                                 (5)

Let's see what is missing now:
(1) need all the stylesheets for all clients.
(2) We need to define general tags for inserting references to the
      schema in the xml. They are needed by (1).
(3) Need a processor that uses a schema validator and validates.
(4) XForms schemas are different from normal schemas.
     We need an XSL that maps between the two.
(5) I think basic ones are needed, like an SQL insertor or XML insertor
     (there are implementations, we just have to tweak them).
     I think a redirector is very important.

As you see I haven't discussed about how the client interacts, if he
sends xml or single nodes. I think that it is not that important for
now as long as the data gets to the server...
Sending Xml is important when the amount of data sent is not known
beforehand (arrays). I needed it myself once but imho it is 1% of 90%
of forms.

Here transactions are not discussed; I think that they should be taken
care of in (5).

Please let me know what you think of this.

Ken

Nicola Ken Barozzi - AISA Industries S.p.A
http://www.aisaindustries.it/
Via Leonardo da Vinci,2 Ticengo (CR) Italy
Personal homepage at Java Guru:
http://www.jguru.com/jguru/guru/viewchannel.jsp?EID=39153
Personal FAQ at Java Guru:
http://www.jguru.com/jguru/guru/viewfaqs.jsp?EID=39153
Research Activity:
Politecnico di Milano - Dipartimento di Meccanica
Piazza Leonardo da Vinci, n.32 - 20133 Milano (Italy)



Mime
View raw message