cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steffen Stundzig <>
Subject Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)
Date Wed, 06 Dec 2000 10:08:31 GMT

On Tue, 5 Dec 2000 18:54:16 +0000 Jeremy Quinn <>

> At 23:30 +0100 10/11/00, Giacomo Pati wrote:
> >The action of type "schemox-validator" will validate the data posted.
> How does the schemox-validator relate form fields to Elements and
> Attributes in the instance and the schema at this stage? Or are we just
> setting up a validator to be used later?

To identify the form fields I've developed an ID for each control. This
ID looks like a simple XPath e.g.
    'NAMESPACEURI /[1]##items/[1]##item/@partNum'
points to the first element '/items/item' attribute 'partNum'.  Or
    'NAMESPACEURI /[1]##items/[3]##item/[2]##shipDate' 
points to the first element named 'items' its third child named 'item' and
its second child named 'shipDate'. 

Actions on button clicks in the form are resolved in the same way. Every
button has an ID such as a row delete button:
This is forwarded to the FormsActionHandler by the ActionHandlerRegistry
resists in the FormController. Action 'delete'. Then the element
/items/item is 
removed and the form were rebuilded.

I receive the IDs form the HTTPRequest object as key - values pairs.
When I read the Schema with the SchemaReader each schema element get a
such as 'NAMESPACEURI items'. I search after the ID recursive. Each
element which
name starts with the ID removed his part from the ID and searched in its
childs with 
the rest of it. 
So I build the DOM with the IDs and can find the right schema element to
its values. 

> >The action of type "schemox-handler" will manipulate the instance
> >according to events posted back from the client and make them available
> >in the environment object as well as possible messages which should be
> >presented to the client by the generator.
> So this updates the instance from the posted data and reports errors?

As described above with the action 'delete'. Each action can validate the
form against the schema and report the errors to the ErrorHandler 

> >The generator of type "schemox-form-generator" will read the instance
> >and form it to the schemox namespace according to the xschema supplied
> >from the form-controller.
> I have lost you now ....
> I think your temininology has changed?

This terminology is based on C2. We have talked about integration of
C2 and SchemoX and so the FormController as central part of SchemoX 
can have another name in the C2 language. :-)

Snippet from the other email in this thread: 

> For instance I think Giacomo talked about how different SiteMap
> might use different Schemox components, independantly.

Therefore I have wrote down some thoughts about C2 and SchemoX. 
Because our main focus with SchemoX is developing web applications 
based on Cocoon, I've tried to make the interfaces as Cocoon like as
E.g. If you would use the SchemaValidator without the rest of SchemoX, the
things you need is to read the XMLSchema with the XSDReader, to implement
ErrorHandler to act on validation errors and to transform the IDs of the 
form controls from the HTTPRequest into a HashMap and pass it to the

All clarifications eliminated? ;-)


Steffen Stundzig                  
SMB GmbH                              

View raw message