You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ivelin Ivanov <iv...@iname.com> on 2002/03/14 22:31:47 UTC

[Announcement] HTML Form binding and validation arrived

===============================================================
! The HTML Form symmetry loop is closed: !
===============================================================
HTML Forms <-> XPath <-> JavaBeans <-> XML -> Schematron -> HTML Forms
===============================================================

Just released the next version of the symmetric Form binding and validation
toolkit ( a CocoonBlock wannabe :).
In addition to the form-binding it now has integrated Schematron validation
support.

The zip file can be downloaded from:
http://prdownloads.sourceforge.net/freebuilder/CocoonForm_0-6.zip

With this in place one can provide form binding with just a few lines of
code (~5 lines) and Sophisticated form validation with 0! lines of Java
code.

Let me walk you quickly through the sitemap of the example provided in the
distribution:

#########
#sitemap:#
########
...

 <map:pipelines>
  <map:pipeline>
   <map:match pattern="*">
1.    <map:act type="FormBinderAction"/>           <!-- ### Uses The
FormBeanBinder tool to bind the html form elements to an underlying JavaBean
model through XPath based form element names -->
2.    <map:generate src="insertFormBean.xml"/>  <!--  ### This is a very
short
files simply inserting the form bean    -->
3.    <map:transform type="castor"/>                <!-- ###
CastorTransformer converts the bean into an XML stream -->
4.    <map:transform src="schematron/xmlform-sch-report.xsl"/> <!-- ### A
Schematron schema validates the form and adds the validation results in the
stream, while preserving the original form stream -->
5.    <map:transform src="formbean2html.xsl"/>   <!-- ### Renders the HTML
file
using the XML form and the validation errors from the input document -->
    <map:serialize type="html"/>
   </map:match>
  </map:pipeline>
 </map:pipelines>
...

######################
#xmlform-sch-report.xml: #
######################

The validation schema is really simple and intuitive. The one in the example
is over simplified.
Schematron however supports i18n and validation in phases (useful for
wizards).

...
<schema ns="http://xml.apache.cocoon/xmlform"
xmlns="http://www.ascc.net/xml/schematron">
 <title>Schema for the XML Form example</title>
 <pattern name="A Simple Form Validation Pattern">
  <rule context="name">
   <assert  test="string-length(.) > 3">Animal name should be at least 4
characters.</assert>
   <assert  test="string-length(.) &lt; 10">Animal name should be less than
10 characters.</assert>
  </rule>
  <rule context="scope">
   <assert test="normalize-space(.) = 'session' or normalize-space(.) =
'request'">Scope should be request or session.</assert>
  </rule>
 </pattern>
</schema>

=====================================

That's all folks !

All sources and xml documents are provided in the example.

I will be working with Torsten on a more sophisticated wizard example
and a best practices document.

Cocoon is really close to becoming a full-blown web-app server,
which enforces a pure separation in BOTH directions !

I know everyone on this team is extremely busy, but even one line feedback
is of great help for me, so

Feedback please !

Cheers,

Ivelin















---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Ivelin Ivanov wrote:

>===============================================================
>! The HTML Form symmetry loop is closed: !
>===============================================================
>HTML Forms <-> XPath <-> JavaBeans <-> XML -> Schematron -> HTML Forms
>===============================================================
>
<snip/>

>
>That's all folks !
>
>All sources and xml documents are provided in the example.
>
>I will be working with Torsten on a more sophisticated wizard example
>and a best practices document.
>
>Cocoon is really close to becoming a full-blown web-app server,
>which enforces a pure separation in BOTH directions !
>
>I know everyone on this team is extremely busy, but even one line feedback
>is of great help for me, so
>
>Feedback please !
>
One line feedback : this seems to be *really cool stuff* !
More feeback later ;)

>
>Cheers,
>
>Ivelin
>
Thanks,
Sylvain

-- 
Sylvain Wallez
 Anyware Technologies                  Apache Cocoon
 http://www.anyware-tech.com            mailto:sylvain@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Optimize Performance

Posted by Michael Wechner <co...@wyona.org>.
Hi

I try to configure Cocoon and Tomcat such that the
performance is as good as possible when I let it run
as production system. What I figured out already is

1) set all "check-reloads" attributes within all sitemaps to "false"
2) set all "log-level" attributes within logkit.xconf to "ERROR"
3) set attribute "reloadable" of Context cocoon within 
tomcat/conf/server.xml to "false".

I guess there are more parameters to turn, for instance how do
I turn off the lookup of lastmodified of XSLT, or is this configured
by check-reloads already?

Any tips or help appreciated

Thanks

Michael


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


[WIP] Samples Restructuring (was: tons of other messages ;)

Posted by Nicola Ken Barozzi <ni...@apache.org>.
The sample restructuring is taking me longer than expected, since I changed
the dir layout a couple of times until I was reasonably satisfied.
If it's ok, (ie no -1) I'll commit today the current version with an initial
page that has these links

 - status
 - documentation
 - search
 - samples
 - refactored samples (WIP)

This way we have a "Cocoon is working" page wether or not they installed one
of the above components (smells like 1.8 ;-), and the "old" samples can
coexist with the refactored ones.

--
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Davanum Srinivas <di...@yahoo.com>.
Nicola,

+1 to adding this to scratchpad.

Thanks,
dims

--- Nicola Ken Barozzi <ni...@apache.org> wrote:
> From: "Stefano Mazzocchi" <st...@apache.org>
> 
> 
> > Ivelin Ivanov wrote:
> > > 
> > > ===============================================================
> > > ! The HTML Form symmetry loop is closed: !
> > > ===============================================================
> > > HTML Forms <-> XPath <-> JavaBeans <-> XML -> Schematron -> HTML Forms
> > > ===============================================================
> > 
> > Way cool! I'll be glad to have it in the scratchpad as soon as you have
> > a cool sample to show the users.
> 
> I can commit it along with the new samples.
> Shall I go for it?
> 
> > Keep up the great work!
> 
> Yeah!
> 
> -- 
> Nicola Ken Barozzi                   nicolaken@apache.org
>             - verba volant, scripta manent -
>    (discussions get forgotten, just code remains)
> ---------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 


=====
Davanum Srinivas - http://xml.apache.org/~dims/

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Nicola Ken Barozzi <ni...@apache.org>.
From: "Stefano Mazzocchi" <st...@apache.org>


> Ivelin Ivanov wrote:
> > 
> > ===============================================================
> > ! The HTML Form symmetry loop is closed: !
> > ===============================================================
> > HTML Forms <-> XPath <-> JavaBeans <-> XML -> Schematron -> HTML Forms
> > ===============================================================
> 
> Way cool! I'll be glad to have it in the scratchpad as soon as you have
> a cool sample to show the users.

I can commit it along with the new samples.
Shall I go for it?

> Keep up the great work!

Yeah!

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Ivelin Ivanov <iv...@iname.com>.
...
> > ===============================================================
> > ! The HTML Form symmetry loop is closed: !
> > ===============================================================
> > HTML Forms <-> XPath <-> JavaBeans <-> XML -> Schematron -> HTML Forms
> > ===============================================================
> >
...
> Way cool! I'll be glad to have it in the scratchpad as soon as you have
> a cool sample to show the users.

Actually the zip file has an end-to-end example which covers the whole
roundtrip pictured above.
We will be expanding this example with something more complex and close to a
real world scenario though.


Cheers,

Ivelin

>
> Keep up the great work!
>
> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>                           able to give birth to a dancing star.
> <st...@apache.org>                             Friedrich Nietzsche
> --------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Stefano Mazzocchi <st...@apache.org>.
Ivelin Ivanov wrote:
> 
> ===============================================================
> ! The HTML Form symmetry loop is closed: !
> ===============================================================
> HTML Forms <-> XPath <-> JavaBeans <-> XML -> Schematron -> HTML Forms
> ===============================================================
> 
> Just released the next version of the symmetric Form binding and validation
> toolkit ( a CocoonBlock wannabe :).
> In addition to the form-binding it now has integrated Schematron validation
> support.
> 
> The zip file can be downloaded from:
> http://prdownloads.sourceforge.net/freebuilder/CocoonForm_0-6.zip
> 
> With this in place one can provide form binding with just a few lines of
> code (~5 lines) and Sophisticated form validation with 0! lines of Java
> code.
> 
> Let me walk you quickly through the sitemap of the example provided in the
> distribution:
> 
> #########
> #sitemap:#
> ########
> ...
> 
>  <map:pipelines>
>   <map:pipeline>
>    <map:match pattern="*">
> 1.    <map:act type="FormBinderAction"/>           <!-- ### Uses The
> FormBeanBinder tool to bind the html form elements to an underlying JavaBean
> model through XPath based form element names -->
> 2.    <map:generate src="insertFormBean.xml"/>  <!--  ### This is a very
> short
> files simply inserting the form bean    -->
> 3.    <map:transform type="castor"/>                <!-- ###
> CastorTransformer converts the bean into an XML stream -->
> 4.    <map:transform src="schematron/xmlform-sch-report.xsl"/> <!-- ### A
> Schematron schema validates the form and adds the validation results in the
> stream, while preserving the original form stream -->
> 5.    <map:transform src="formbean2html.xsl"/>   <!-- ### Renders the HTML
> file
> using the XML form and the validation errors from the input document -->
>     <map:serialize type="html"/>
>    </map:match>
>   </map:pipeline>
>  </map:pipelines>
> ...
> 
> ######################
> #xmlform-sch-report.xml: #
> ######################
> 
> The validation schema is really simple and intuitive. The one in the example
> is over simplified.
> Schematron however supports i18n and validation in phases (useful for
> wizards).
> 
> ...
> <schema ns="http://xml.apache.cocoon/xmlform"
> xmlns="http://www.ascc.net/xml/schematron">
>  <title>Schema for the XML Form example</title>
>  <pattern name="A Simple Form Validation Pattern">
>   <rule context="name">
>    <assert  test="string-length(.) > 3">Animal name should be at least 4
> characters.</assert>
>    <assert  test="string-length(.) &lt; 10">Animal name should be less than
> 10 characters.</assert>
>   </rule>
>   <rule context="scope">
>    <assert test="normalize-space(.) = 'session' or normalize-space(.) =
> 'request'">Scope should be request or session.</assert>
>   </rule>
>  </pattern>
> </schema>
> 
> =====================================
> 
> That's all folks !
> 
> All sources and xml documents are provided in the example.
> 
> I will be working with Torsten on a more sophisticated wizard example
> and a best practices document.
> 
> Cocoon is really close to becoming a full-blown web-app server,
> which enforces a pure separation in BOTH directions !
> 
> I know everyone on this team is extremely busy, but even one line feedback
> is of great help for me, so
> 
> Feedback please !
> 
> Cheers,
> 
> Ivelin

Way cool! I'll be glad to have it in the scratchpad as soon as you have
a cool sample to show the users.

Keep up the great work!

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Ivelin Ivanov <iv...@iname.com>.
It took me a while to digest your solution.
Now that I think I understand it basicly, it seems elegant.
I would appreciate to see some sample code though.

You're welcome to join our discussion with Torsten, so that we can finish a
complex wizard that can server as a best practices example.

Thanks.

----- Original Message -----
From: "Jeremy Quinn" <je...@media.demon.co.uk>
To: <co...@xml.apache.org>
Sent: Friday, March 15, 2002 5:06 AM
Subject: Re: [Announcement] HTML Form binding and validation arrived


> At 6:44 pm -0600 14/3/02, Ivelin Ivanov wrote:
> >For the wizard I would like to do the following, but am not sure what's
the
> >optimal way to express it with a sitemap.
> >Maybe you can help:
>
> this is still a difficult issue ....
>
> >1) When the browser request an URL with HTML form, then the pipeline in
the
> >current example works fine.
> >2) Now when the browser submits the form though, I would like to pass
> >through the same (or similar) pipeline, but at the end, instead of going
> >back to the same page, I'd like to forward to another Action2 if there
are
> >no errors in the <validationResult/> section of the <xmlform/> stream.
> >3) Action2 will then do additional business logic validation and will
either
> >  a) branch to a pipeline which produces <xmlform/> with
<validationResult/>
> >section that contains <errors/> and is followed by the same
transformation
> >which happen in 1) to display the html form page with the errors
> >  b) call into business logic to perform additional work and branch to
the
> >next page in the wizard.
> >
> >What is the *right* way to branch at the end of step 2), 3.a) and 3.b)?
>
> The problem as I understand it here is that all Actions in a pipeline are
> executed before any pipeline processing is commenced. (This still seems
> weird to me;)
>
> >These questions maybe overlapping somewhat with the other thread on
dynamic
> >pipeline selectors which is going in parallel. Anyway,
>
> This is something I am beginning to play with in <slash-edit/>.
>
> The general idea is this: (I don't know if I can express this in terms
> immediately useful to you ....)
>
>
> <slash-edit/> uses aggregation to assemble document parts, the aggregation
> creates tags that "instruct" later XSLT passes what to do.
>
> XSLTs in the pipeline act as "Adaptors", conditionally modifying the XML
> according to different runtime states, to modify the behaviour of later
> XSLT and Transformers. (This is the key, your business logic would have to
> be implemented in a Transformer).
>
> As an example, let's say I had Schematron validation in <slash-edit/>.
>
> The internal "fetch-put(*)" pipeline, would capture the request, XSLT
would
> convert it to your document instance, your schematron.xsl would produce a
> validation report, another XSLT (editorAdaptor) would adapt the whole lot
> for the Editor, if there were no validation errors, it would wrap the
> instance in a <source:write/> tag so the SourceWritingTransformer would
> write it, if there were errors, it would not wrap with <source:write/>,
> meaning that even though SWT is still in the pipeline, it does nothing. On
> error editorAdaptor, could then change the behaviour from 'put' to 'get',
> meaning that editor-html.xsl would convert your instance back into form
> again for re-editing.
>
> Does this make any sense?
>
>
> 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...@vizzavi.net>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 6:44 pm -0600 14/3/02, Ivelin Ivanov wrote:
>For the wizard I would like to do the following, but am not sure what's the
>optimal way to express it with a sitemap.
>Maybe you can help:

this is still a difficult issue ....

>1) When the browser request an URL with HTML form, then the pipeline in the
>current example works fine.
>2) Now when the browser submits the form though, I would like to pass
>through the same (or similar) pipeline, but at the end, instead of going
>back to the same page, I'd like to forward to another Action2 if there are
>no errors in the <validationResult/> section of the <xmlform/> stream.
>3) Action2 will then do additional business logic validation and will either
>  a) branch to a pipeline which produces <xmlform/> with <validationResult/>
>section that contains <errors/> and is followed by the same transformation
>which happen in 1) to display the html form page with the errors
>  b) call into business logic to perform additional work and branch to the
>next page in the wizard.
>
>What is the *right* way to branch at the end of step 2), 3.a) and 3.b)?

The problem as I understand it here is that all Actions in a pipeline are
executed before any pipeline processing is commenced. (This still seems
weird to me;)

>These questions maybe overlapping somewhat with the other thread on dynamic
>pipeline selectors which is going in parallel. Anyway,

This is something I am beginning to play with in <slash-edit/>.

The general idea is this: (I don't know if I can express this in terms
immediately useful to you ....)


<slash-edit/> uses aggregation to assemble document parts, the aggregation
creates tags that "instruct" later XSLT passes what to do.

XSLTs in the pipeline act as "Adaptors", conditionally modifying the XML
according to different runtime states, to modify the behaviour of later
XSLT and Transformers. (This is the key, your business logic would have to
be implemented in a Transformer).

As an example, let's say I had Schematron validation in <slash-edit/>.

The internal "fetch-put(*)" pipeline, would capture the request, XSLT would
convert it to your document instance, your schematron.xsl would produce a
validation report, another XSLT (editorAdaptor) would adapt the whole lot
for the Editor, if there were no validation errors, it would wrap the
instance in a <source:write/> tag so the SourceWritingTransformer would
write it, if there were errors, it would not wrap with <source:write/>,
meaning that even though SWT is still in the pipeline, it does nothing. On
error editorAdaptor, could then change the behaviour from 'put' to 'get',
meaning that editor-html.xsl would convert your instance back into form
again for re-editing.

Does this make any sense?


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...@vizzavi.net>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Ivelin Ivanov <iv...@iname.com>.
Ahaa, so that's the power of  the cocoon: protocol.
I'll try it and let you know if I can't make it work.

----- Original Message -----
From: "Jeremy Quinn" <je...@media.demon.co.uk>
To: <co...@xml.apache.org>
Sent: Friday, March 15, 2002 4:40 AM
Subject: Re: [Announcement] HTML Form binding and validation arrived


> At 6:44 pm -0600 14/3/02, Ivelin Ivanov wrote:
> >> I have the feeling you could get Cocoon to generate the validating
> >> StyleSheet on the fly using an internal pipeline.
> >
> >I would like to do it. Can you script up a few lines to give me
direction.
> >As everyone have noticed, I'm a Total newbie with sitemaps.
>
> I'm no great shakes myself ;)
>
> .... I was thinking of something like this :
>
>
> to do the equivalent of this (from your 'xmlform.bat' file):
>
> call xslt xmlform-sch-report.xml xmlform-schematron.xsl
xmlform-sch-report.xsl
> call xslt some-xmlform.xml xmlform-sch-report.xsl result.xml
>
> I might use two pipelines, one internal, one external
>
>
>   <map:pipelines>
> <map:pipeline internal-only="true">
>
> <map:match pattern="xmlform-sch-report">
> <map:generate src="schematron/xmlform-sch-report.xml"/>
> <map:transform src="schematron/xmlform-schematron.xsl"/>
> <map:serialize type="xml"/>
> </map:match>
>
> </map:pipeline>
>
> <map:pipeline>
>
> <map:match pattern="*">
> <map:act type="FormBinderAction"/>
> <map:generate src="insertFormBean.xml"/>
> <map:transform type="castor"/>
> <map:transform src="cocoon:xmlform-sch-report"/>
> <map:transform src="formbean2html.xsl"/>
> <map:serialize type="html"/>
> </map:match>
>
> </map:pipeline>
> </map:pipelines>
>
> I have not tried this, I believe it would work and be handled properly by
> the caching mechanisms, though I am not entirely sure yet.
>
> 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...@vizzavi.net>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 6:44 pm -0600 14/3/02, Ivelin Ivanov wrote:
>> I have the feeling you could get Cocoon to generate the validating
>> StyleSheet on the fly using an internal pipeline.
>
>I would like to do it. Can you script up a few lines to give me direction.
>As everyone have noticed, I'm a Total newbie with sitemaps.

I'm no great shakes myself ;)

.... I was thinking of something like this :


to do the equivalent of this (from your 'xmlform.bat' file):

call xslt xmlform-sch-report.xml xmlform-schematron.xsl xmlform-sch-report.xsl
call xslt some-xmlform.xml xmlform-sch-report.xsl result.xml

I might use two pipelines, one internal, one external


  <map:pipelines>
		<map:pipeline internal-only="true">

			<map:match pattern="xmlform-sch-report">
				<map:generate src="schematron/xmlform-sch-report.xml"/>
				<map:transform src="schematron/xmlform-schematron.xsl"/>
				<map:serialize type="xml"/>
			</map:match>

		</map:pipeline>

		<map:pipeline>

			<map:match pattern="*">
				<map:act type="FormBinderAction"/>
				<map:generate src="insertFormBean.xml"/>
				<map:transform type="castor"/>
				<map:transform src="cocoon:xmlform-sch-report"/>
				<map:transform src="formbean2html.xsl"/>
				<map:serialize type="html"/>
			</map:match>

		</map:pipeline>
	</map:pipelines>

I have not tried this, I believe it would work and be handled properly by
the caching mechanisms, though I am not entirely sure yet.

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...@vizzavi.net>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Ivelin Ivanov <iv...@iname.com>.
Thanks folks.

One line goes a long way. When I released v0.5 a week ago, I got almost no
feedback and was about to drop it.

Hope my words didn' go much farther than the code they promote. I'll find
out soon ... ;-)

<snip/>

..see below...

----- Original Message -----
From: "Jeremy Quinn" <je...@media.demon.co.uk>
To: <co...@xml.apache.org>
Sent: Thursday, March 14, 2002 5:32 PM
Subject: Re: [Announcement] HTML Form binding and validation arrived


> At 3:31 pm -0600 14/3/02, Ivelin Ivanov wrote:
> >===============================================================
> >! The HTML Form symmetry loop is closed: !
> >===============================================================
> >HTML Forms <-> XPath <-> JavaBeans <-> XML -> Schematron -> HTML Forms
> >===============================================================
> >

> I have the feeling you could get Cocoon to generate the validating
> StyleSheet on the fly using an internal pipeline.

I would like to do it. Can you script up a few lines to give me direction.
As everyone have noticed, I'm a Total newbie with sitemaps.


For the wizard I would like to do the following, but am not sure what's the
optimal way to express it with a sitemap.
Maybe you can help:

1) When the browser request an URL with HTML form, then the pipeline in the
current example works fine.
2) Now when the browser submits the form though, I would like to pass
through the same (or similar) pipeline, but at the end, instead of going
back to the same page, I'd like to forward to another Action2 if there are
no errors in the <validationResult/> section of the <xmlform/> stream.
3) Action2 will then do additional business logic validation and will either
  a) branch to a pipeline which produces <xmlform/> with <validationResult/>
section that contains <errors/> and is followed by the same transformation
which happen in 1) to display the html form page with the errors
  b) call into business logic to perform additional work and branch to the
next page in the wizard.

What is the *right* way to branch at the end of step 2), 3.a) and 3.b)?

These questions maybe overlapping somewhat with the other thread on dynamic
pipeline selectors which is going in parallel. Anyway,

Feedback please ! :)

Cheers,

Ivelin

P.S.: To give a chance to more people to join this discussion, I'll paste
the <xmlform/> document which is used in the FormBinding and validation
toolkit:

<?xml version="1.0" encoding="UTF-8"?>
<xmlform>
<instance>
  <animal>
        <name>Mickey Mouse</name>
        <scope>session1</scope>
        <personalInfo>
          <kind>mammal</kind>
        </personalInfo>
        <count>10d</count>
      </animal>
</instance>
<validationResult>
  <pattern name="A Simple Form Validation Pattern">
    <error>
      <path>animal/name</path>
      <message>Animal name should be less than 10 characters.</message>
    </error>
    <error>
      <path>animal/scope</path>
      <message>Scope should be request or session.</message>
    </error>
  </pattern>
</validationResult>
</xmlform>






>
> Did you try this?
>
> 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...@vizzavi.net>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 3:31 pm -0600 14/3/02, Ivelin Ivanov wrote:
>===============================================================
>! The HTML Form symmetry loop is closed: !
>===============================================================
>HTML Forms <-> XPath <-> JavaBeans <-> XML -> Schematron -> HTML Forms
>===============================================================
>
>Just released the next version of the symmetric Form binding and validation
>toolkit ( a CocoonBlock wannabe :).
>In addition to the form-binding it now has integrated Schematron validation
>support.


This is top stuff!

I'd immediately like to rip off the Schematron stuff for <slash-edit/>.

I have the feeling you could get Cocoon to generate the validating
StyleSheet on the fly using an internal pipeline.

Did you try this?

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...@vizzavi.net>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Gianugo Rabellino <gi...@apache.org>.
Ivelin Ivanov wrote:


> I know everyone on this team is extremely busy, but even one line feedback
> is of great help for me, so
> 
> Feedback please !

There you go: sounds extra cool stuff :-)

Need to check it out and start working on it, but keep it rolling :-)

Ciao,

-- 
Gianugo



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Ivelin Ivanov <iv...@iname.com>.
Robert,

Apology for the misleading text - 'scratchpad formatted bundle'
I've tried to bundle it "like" other libs in scratchpad, e.g.
CastorTransofrmer.
It is not a drag and drop auto-installable zip.
If this toolkit makes it to scratchpad one day, you will be able to deploy
it with the rest of the scratchpad apps.
For now, this is what you can do:
- Install the CastorTransformer toolkit from scratchpad
- Compile the source and drop it under cocoon's webapp/WEB-INF/classes
directory. (Put on the javac classpath cocoon.jar.)
- Then unzip the samples/xmlform directory from the zip file under cocoon's
webapp/ directory.
- Now modify cocoon's main webapp/sitemap.xmap file to include the following
section:

  <!-- xmlform examples pipeline -->
  <map:pipeline>
   <map:match pattern="samples/xmlform/**">
    <map:mount uri-prefix="xmlform" src="xmlform/" check-reload="yes"/>
   </map:match>
  </map:pipeline>

- Redeploy cocoon
- Hit http://localhost:8080/samples/xmlform/test
- You should see a not so pretty html form with populated fields and a red
error message under the name field.
- If you got so far, you can play with the form a bit then see the xml files
under xmlform to understand how they work together.

I know there are smarter ways to auto-deploy an app, but I am not familiar
enough with those yet.

Regards,

Ivelin



----- Original Message -----
From: "Robert Leftwich" <r....@bigpond.com>
To: <co...@xml.apache.org>
Sent: Thursday, March 14, 2002 7:05 PM
Subject: Re: [Announcement] HTML Form binding and validation arrived


> At 08:31 AM 15/03/2002, Ivelin Ivanov wrote:
>
> >The zip file can be downloaded from:
> >http://prdownloads.sourceforge.net/freebuilder/CocoonForm_0-6.zip
>
> <newbie.question>
> The precursor to the above file described it as a 'scratchpad formatted
bundle', so assuming it is still in the same format, is there a document
describing how to install said bundles ?
> (I've tried unzipping it under src/scratchpad - along the same lines as
schecoon without success using both the new 'build installscratchpadwar' and
the old? build -Dinclude.scratchpad.libs=yes"
>
> </newbie.question>
>
> Robert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [Announcement] HTML Form binding and validation arrived

Posted by Robert Leftwich <r....@bigpond.com>.
At 08:31 AM 15/03/2002, Ivelin Ivanov wrote:

>The zip file can be downloaded from:
>http://prdownloads.sourceforge.net/freebuilder/CocoonForm_0-6.zip

<newbie.question>
The precursor to the above file described it as a 'scratchpad formatted bundle', so assuming it is still in the same format, is there a document describing how to install said bundles ? 
(I've tried unzipping it under src/scratchpad - along the same lines as schecoon without success using both the new 'build installscratchpadwar' and the old? build -Dinclude.scratchpad.libs=yes"

</newbie.question>

Robert


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org