You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Davanum Srinivas <di...@yahoo.com> on 2000/11/01 16:41:48 UTC

[C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Steffen,
Does SchemoX use Cocoon2?

Thanks,
dims

--- Steffen Stundzig <st...@smb-tec.com> wrote:
> Hi,
> 
> sorry. The right URL is
> 
> http://www.infozone-group.org/projects_main.html
> 
> not 
> > More information such as a proposal and some code samples can be found on 
> > http://www.infozone-group.org/projects_main.html/
> 
> -- 
> ______________________________________________________________________
> Steffen Stundzig                            mailto:steffen@smb-tec.com
> SMB GmbH                                        http://www.smb-tec.com
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 


=====
Davanum Srinivas, JNI-FAQ Manager
http://www.jGuru.com/faq/JNI

__________________________________________________
Do You Yahoo!?

Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 11:08 +0100 06/12/00, Steffen Stundzig wrote:
>Hi,
>
>On Tue, 5 Dec 2000 18:54:16 +0000 Jeremy Quinn <je...@media.demon.co.uk>
>wrote:
>
>> 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.

[snip]

OK, I think I am beginning to understand.

Thanks

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Steffen Stundzig <st...@smb-tec.com>.
Hi,

On Tue, 5 Dec 2000 18:54:16 +0000 Jeremy Quinn <je...@media.demon.co.uk>
wrote:

> 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:
     'SCHEMOX_ACTION_NAMESPACEURI
ACTIONHANDLER_PREFIX:ACTION_NAME@ACTION_ARGS'
e.g.
     'http://www.infozone-group.org/SchemoX/Action 
             gfah:1@http://www.infozone-group.org/SchemoX
/[1]##items/[1]##item'
This is forwarded to the FormsActionHandler by the ActionHandlerRegistry
which
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
name
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
validate
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 
implementation.

> >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
components
> 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
possible.
E.g. If you would use the SchemaValidator without the rest of SchemoX, the
only
things you need is to read the XMLSchema with the XSDReader, to implement
an
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
Validator.


All clarifications eliminated? ;-)


Regards
	Steffen...

-- 
______________________________________________________________________
Steffen Stundzig                            mailto:steffen@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 23:30 +0100 10/11/00, Giacomo Pati wrote:
>Steffen Stundzig wrote:
>>
>> Hi,
>>
>> On Wed, 1 Nov 2000 07:41:48 -0800 (PST) Davanum Srinivas
>><di...@yahoo.com> wrote:
>> > Steffen,
>> > Does SchemoX use Cocoon2?
>>
>> At the moment we have a sample implementation using Cocoon1.8.
>> I don't no why we couldn't use Cocoon2. One main goal of the SchemoX
>> framework is independence of the output renderer.
>
>I've had a look at SchemoX and Steffen contacted me to have some
>discussion about how SchemoX and Cocoon 2 can work together. I really
>like the idea of SchemoX and I clearly see the SchemoX framework
>implemented as C2 components.
>
>SchemoX is a framework that uses XSchemas to build forms to edit XML
>instance. The
>http://www.infozone-group.org/schemoxDocs/html/proposal.html gives an
>overview to the framework. I'd like Jeremy to take a look at it (as soon
>as he's back from his vacation :) because he has some experience with
>XML document editing from his FP taglib. I would also appreciate if we
>can work together with the SchemoX group discussing and building such
>components for C2.

Sorry it has taken me so long to get back to you about this.
I am keen to understand, but please excuse my work schedule getting in the
way :)

Re:an earlier post, I am still trying to learn SAX ...

>The discussion with Steffen has brought us to the following sitemap
>example snippet so far and this is a base to discuss about:
>
>  <match pattern="mydocs/*/*">
>    <action type="schemox-reader" src="xschemas/{2}.xsd"/>
>    <action type="schemox-validator"/>
>    <action type="schemox-handler"/>
>    <generate type="schemox-composer" src="resources/{1}.xml"/>
>    <transform src="stylesheets/schemox2structure.xsl"/>
>    <transform src="stylesheets/structure2html.xsl"/>
>    <serialize type="html"/>
>  </match>
>
>The action of type "schemox-reader" will build up the XSchema
>representing object and put it in the environment if it is not already
>there.

OK

>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?

>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?

>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?

>The first xslt transformer builds up the structure of the page possibly
>inserting additional elements for linkage etc.
>
>The second transformer builds the styled xhtml representation of the
>page.
>
>The serializer makes it available to the clients OutputStream.
>
>This IMHO will give the best flexibility to change or parametrize those
>components for different source stores of XSchemas and XML instances.

Yup.


regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: SchemoX and Cocoon2

Posted by Steffen Stundzig <st...@smb-tec.com>.
Hi,

On Wed, 15 Nov 2000 13:33:24 +0200
Lassi Immonen <li...@mail.urova.fi> wrote:

> Hi,
> 
> I just wonder is this JavaWorld arcticle any help to SchemoX:
> http://www.javaworld.com/jjw/1114/jw-11-2000/jw-1110-validation3.html
> 
> Lassi Immonen

Lassi, thanks for this hint. 

It's an interesting article about validation of attribute values from 
XMLSchema definitions.
I'm sure that some of the suggestions in it, would influence the 
implementation of the SchemaValidator component in SchemoX. 
However we need a little bit more functionality for complete Schema 
validation. That's article is a good point to start. 

Thanks to Brett McLaughlin (and JavaWorld :-)).

Regards
	Steffen...
-- 
______________________________________________________________________
Steffen Stundzig                            mailto:steffen@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




Re: SchemoX and Cocoon2

Posted by Lassi Immonen <li...@malla.urova.fi>.
Steffen Stundzig wrote:
> 
> Hi,
> 
> On Fri, 10 Nov 2000 23:30:57 +0100
> Giacomo Pati <gi...@apache.org> wrote:
> > I've had a look at SchemoX and Steffen contacted me to have some
> > discussion about how SchemoX and Cocoon 2 can work together. I really
> > like the idea of SchemoX and I clearly see the SchemoX framework
> > implemented as C2 components.

Hi,

I just wonder is this JavaWorld arcticle any help to SchemoX:
http://www.javaworld.com/jjw/1114/jw-11-2000/jw-1110-validation3.html

Lassi Immonen

SchemoX and Cocoon2

Posted by Steffen Stundzig <st...@smb-tec.com>.
Hi,

On Fri, 10 Nov 2000 23:30:57 +0100
Giacomo Pati <gi...@apache.org> wrote:
> I've had a look at SchemoX and Steffen contacted me to have some
> discussion about how SchemoX and Cocoon 2 can work together. I really
> like the idea of SchemoX and I clearly see the SchemoX framework
> implemented as C2 components.

Because a goal of SchemoX is to build also forms for Java Swing apps
the framework should not completely implemented as C2 components, 
but should brillant match with it. 

> The discussion with Steffen has brought us to the following sitemap
> example snippet so far and this is a base to discuss about:
> 
>   <match pattern="mydocs/*/*">
>     <action type="schemox-reader" src="xschemas/{2}.xsd"/>
>     <action type="schemox-validator"/>
>     <action type="schemox-handler"/>
>     <generate type="schemox-composer" src="resources/{1}.xml"/>
>     <transform src="stylesheets/schemox2structure.xsl"/>
>     <transform src="stylesheets/structure2html.xsl"/>
>     <serialize type="html"/>
>   </match>
> 
> The action of type "schemox-reader" will build up the XSchema
> representing object and put it in the environment if it is not already
> there. 
>  
> The action of type "schemox-validator" will validate the data posted.
> 
> 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.
> 

Therefore we should implement wrapper derived from 
the corresponding org.apache.cocoon.* classes to. 
These classes then invokes the appropriate methods in the
special SchemoX implementations. So we can write Sitemaps without the
need of writing application specific classes to use SchemoX.

> 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.

Another way is, to plug in a schemox-generator after the
FormDesigner implementation. The schemox-generator then derived from 
FormRenderer, reads the special SchemoX events and generate SAX events 
from it. So I could use the output of the FormDesigner also for my 
Java Swing form builder without the need of transforming it to SAX/XML.

> 
> Please join it with your oppinions.

I've start writing a small proposal about the corporation between C2 and 
SchemoX with the ideas from Giacomo, Ken and me.  

Regards
	Steffen...

-- 
______________________________________________________________________
Steffen Stundzig                            mailto:steffen@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Giacomo Pati <gi...@apache.org>.
Steffen Stundzig wrote:
> 
> Hi,
> 
> On Wed, 1 Nov 2000 07:41:48 -0800 (PST) Davanum Srinivas <di...@yahoo.com> wrote:
> > Steffen,
> > Does SchemoX use Cocoon2?
> 
> At the moment we have a sample implementation using Cocoon1.8.
> I don't no why we couldn't use Cocoon2. One main goal of the SchemoX
> framework is independence of the output renderer.

I've had a look at SchemoX and Steffen contacted me to have some
discussion about how SchemoX and Cocoon 2 can work together. I really
like the idea of SchemoX and I clearly see the SchemoX framework
implemented as C2 components.

SchemoX is a framework that uses XSchemas to build forms to edit XML
instance. The
http://www.infozone-group.org/schemoxDocs/html/proposal.html gives an
overview to the framework. I'd like Jeremy to take a look at it (as soon
as he's back from his vacation :) because he has some experience with
XML document editing from his FP taglib. I would also appreciate if we
can work together with the SchemoX group discussing and building such
components for C2.

The discussion with Steffen has brought us to the following sitemap
example snippet so far and this is a base to discuss about:

  <match pattern="mydocs/*/*">
    <action type="schemox-reader" src="xschemas/{2}.xsd"/>
    <action type="schemox-validator"/>
    <action type="schemox-handler"/>
    <generate type="schemox-composer" src="resources/{1}.xml"/>
    <transform src="stylesheets/schemox2structure.xsl"/>
    <transform src="stylesheets/structure2html.xsl"/>
    <serialize type="html"/>
  </match>

The action of type "schemox-reader" will build up the XSchema
representing object and put it in the environment if it is not already
there. 
 
The action of type "schemox-validator" will validate the data posted.

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.

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.

The first xslt transformer builds up the structure of the page possibly
inserting additional elements for linkage etc.

The second transformer builds the styled xhtml representation of the
page.

The serializer makes it available to the clients OutputStream.

This IMHO will give the best flexibility to change or parametrize those
components for different source stores of XSchemas and XML instances.

Please join it with your oppinions.

Giacomo

Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Steffen Stundzig <st...@smb-tec.com>.
Hi Jeremy,

On Tue, 5 Dec 2000 18:02:55 +0000 Jeremy Quinn <je...@media.demon.co.uk>
wrote:

> At 15:44 +0100 05/12/00, Steffen Stundzig wrote:
> It was a bit of a struggle, but then I always have a horrible time with
PCs
> and BAT files (I'm pretty Maclexix ;)
I have tried to do the most of the compile and start work with the great
jakarta-ant. 
So I've hoped that I can use the ant.[bat|sh] scripts without any
modifications. :-)

> I feel horrible saying this, I can imagine the amount of work that has
gone
> into this project ... but in both Cocoon1 and Cocoon2 it is likely that
> what you have produced would be best used in a more modular way.
> 
> For instance I think Giacomo talked about how different SiteMap
components
> might use different Schemox components, independantly.

See the other email in this thread.

Regards
	Steffen...

-- 
______________________________________________________________________
Steffen Stundzig                            mailto:steffen@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 15:44 +0100 05/12/00, Steffen Stundzig wrote:
>Hi Jeremy,
>
>
>On Tue, 5 Dec 2000 13:59:20 +0000 Jeremy Quinn <je...@media.demon.co.uk>
>wrote:
>
>> At 21:56 +0100 01/11/00, Steffen Stundzig wrote:
>> Dear Steffen,
>>
>> I just managed to get Schemox working under Cocoon 1 (phew!)
>Great! Nice to hear that. Were there any problems?

It was a bit of a struggle, but then I always have a horrible time with PCs
and BAT files (I'm pretty Maclexix ;)

>
>> Very nice ......
>Thanks.
>
>> First question .....
>And I'm sure not the last
>
>> How do you plan to get output from Schemox without it going through your
>> XHTML Renderer?
>>
>> Most people would prefer (I guess) to use XSL to transform output, not
>have
>> it hard-coded by a renderer class.
>
>The only thing that the renderer does is, to transform the method calls
>from the DefaultFormDesigner into XML, in this special case XHTML.
>
>If you wouldn't use the default XHTMLRenderer implementation you have to
>write a Class that implements the interfaces of FormRenderer or
>FormDesigner.
>Then these class must transform the method calls from the prior invoker
>into XML e.g. DOM or SAXEvents.
>
>One feasibility:
>  If you wouldn't use the DefaultFormDesigner you write your own
>FormDesigner
>implementation and transform the method calls from the SchemaComposer into
>XML.
>In this case you can ignore the FormRender.
>
>Another:
>  If you wouldn't use the XHTMLRenderer, but the DefaultFormDesigner you
>write
>your own FormRenderer implementation and transform the method calls from
>the
>DefaultFormDesigner into XML.
>
>
>SchemoX can automatically validate the user input, therefore it needs
>a HashMap with the names of the form controls as keys and there values
>as values. :-) In the current XSP sample I receive it from the
>HTTPRequest.
>
>
>Hope that helps.

I'd like to understand the flow of your software, and how the components
might be used independantly if necessary.

I feel horrible saying this, I can imagine the amount of work that has gone
into this project ... but in both Cocoon1 and Cocoon2 it is likely that
what you have produced would be best used in a more modular way.

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

I was wondering how I could take the validation components and use them by
themselves in a TagLib for Cocoon 1.


But I could easily be missing the whole point :)


Thanks

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Steffen Stundzig <st...@smb-tec.com>.
Hi Jeremy,


On Tue, 5 Dec 2000 13:59:20 +0000 Jeremy Quinn <je...@media.demon.co.uk>
wrote:

> At 21:56 +0100 01/11/00, Steffen Stundzig wrote:
> Dear Steffen,
> 
> I just managed to get Schemox working under Cocoon 1 (phew!)
Great! Nice to hear that. Were there any problems?

> Very nice ......
Thanks.

> First question .....
And I'm sure not the last

> How do you plan to get output from Schemox without it going through your
> XHTML Renderer?
> 
> Most people would prefer (I guess) to use XSL to transform output, not
have
> it hard-coded by a renderer class.

The only thing that the renderer does is, to transform the method calls 
from the DefaultFormDesigner into XML, in this special case XHTML.

If you wouldn't use the default XHTMLRenderer implementation you have to 
write a Class that implements the interfaces of FormRenderer or
FormDesigner. 
Then these class must transform the method calls from the prior invoker 
into XML e.g. DOM or SAXEvents. 

One feasibility:
  If you wouldn't use the DefaultFormDesigner you write your own
FormDesigner 
implementation and transform the method calls from the SchemaComposer into
XML.
In this case you can ignore the FormRender.

Another:
  If you wouldn't use the XHTMLRenderer, but the DefaultFormDesigner you
write 
your own FormRenderer implementation and transform the method calls from
the 
DefaultFormDesigner into XML.


SchemoX can automatically validate the user input, therefore it needs
a HashMap with the names of the form controls as keys and there values 
as values. :-) In the current XSP sample I receive it from the
HTTPRequest.


Hope that helps.


In my proposal about SchemoX and C2, the functionality described above
is implemented by a Generator. This Generator is an implementation
or a wrapper of a FormRenderer or a FormDesigner.

Regards
	Steffen...


-- 
______________________________________________________________________
Steffen Stundzig                            mailto:steffen@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com




Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 21:56 +0100 01/11/00, Steffen Stundzig wrote:
>Hi,
>
>On Wed, 1 Nov 2000 07:41:48 -0800 (PST) Davanum Srinivas <di...@yahoo.com>
>wrote:
>> Steffen,
>> Does SchemoX use Cocoon2?
>
>At the moment we have a sample implementation using Cocoon1.8.
>I don't no why we couldn't use Cocoon2. One main goal of the SchemoX
>framework is independence of the output renderer.


Dear Steffen,

I just managed to get Schemox working under Cocoon 1 (phew!)

Very nice ......

First question .....

How do you plan to get output from Schemox without it going through your
XHTML Renderer?

Most people would prefer (I guess) to use XSL to transform output, not have
it hard-coded by a renderer class.

Thanks

regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: [C2] Re: SchemoX (was: MVC, Struts and Cocoon)

Posted by Steffen Stundzig <st...@smb-tec.com>.
Hi,

On Wed, 1 Nov 2000 07:41:48 -0800 (PST) Davanum Srinivas <di...@yahoo.com> wrote:
> Steffen,
> Does SchemoX use Cocoon2?

At the moment we have a sample implementation using Cocoon1.8. 
I don't no why we couldn't use Cocoon2. One main goal of the SchemoX 
framework is independence of the output renderer.
> 
> Thanks,
> dims
Hope that helps,
	Steffen...

-- 
______________________________________________________________________
Steffen Stundzig                            mailto:steffen@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com