> -----Original Message----- > From: Ivelin Ivanov [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 20, 2002 4:26 AM > To: Nicola Ken Barozzi > Cc: [EMAIL PROTECTED] > Subject: Re: SchemoX forms > > > > It is one of the projects that I looked at initially along > with Chiba and ExForms. Appears that Schemox has been frozen > back in 2000. Although it was presented on the Cocoon dev > list an integrated solution never saw the light of day.
Yes, there is no any activity at Infozone now and, AFAIK, they have never finished integration with Cocoon 2. > > That's why I keep saying we should try to finish the beast this time ! > > To give everyone a heads up, I am now working on Java API for > XML Schema and Schematron validation of JavaBeans, which can > be easily used in the Action classes. The end goal is for > these APIs to be merged with Torsten's code. That's cool! Waiting result with impatience. If Cocoon will have all features needed for a form-based web application then a lot of people will move from Struts to Cocoon. And I hope to move all our projects to Cocoon. > > imagine code similar to: > > SchamatronValidator sv = new > SchematronValidator("my-schema-report.xml"); > sv.setXmlBinder( SomeCastorWrapper ); > sv.setPhase("loginPhase"); ValidationResult vresult = > sv.validate(myJavaBean); if (vresult.isEmpty() ) > move on to db insert > objectMap.setAttribut("validationSuccess", Boolean.TRUE); else > { > objectMap.setAttribut("validationSucces", Boolean.FALSE); > session.setAttribute("validationResult", vresult); > } > > then further in the pipeline: > > <selector > <when test="validationSuccess"> > render next page > <otherwise> <!-- render the old page --> > <transformer type="castor" src="page-with-errors.xml"/> > <transformer src="xmlform2html.xsl/> This is the way Struts works (you know that, of course). Although Struts has less verbose syntax for that: <forward name="success" path="/otherResource"/> <forward name="error" path="/errorResource"/> Maybe something like this can be added to sitemap syntax? What about a 'test' attribute for every pipeline component? So, only those components will be used whose 'test' expression will return true? This can be used also in action-sets to select actions to be performed. > > where page-with-errors.xml is > > <xmlform xmlns:castor="castornamespace"> > <insert bean="xmlform"/> > <insert bean="validationResult"/> > </xmlform> > > > How does that look? Looks fine, but in this case you'll have all your presentation logic in XSL, which is not bad, but sometimes hard to customize and maintain. What about of using XPath expressions with included beans to bind them to form elements like it's done in XForms? What about this: <xmlform xmlns:castor="castornamespace"> <insert bean="xmlform" as="DOM"/> <!-- This will result in a DOM object placed in request (or session) --> <insert bean="validationResult" as="string"/> <!-- This will output SAX events and result in an XML string --> </xmlform> Then a logicsheet/transformer can be used for something like this to bind the data to form elements: <input ref="xmlform/field/value" .../> -- Konstantin Piroumian [EMAIL PROTECTED] > ----- Original Message ----- > From: "Nicola Ken Barozzi" <[EMAIL PROTECTED]> > > > It just might help a bit with forms stuff: > > > > http://www.infozone-group.org/schemoxDocs/html/ctwo.html > > > > -- > > Nicola Ken Barozzi [EMAIL PROTECTED] > > - verba volant, scripta manent - > > (discussions get forgotten, just code remains) > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]