cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scott <>
Subject thoughts needed: form validation & soap !
Date Thu, 28 Aug 2003 07:25:21 GMT
Hi guys,

I've come up with a new one in my daily wrestlings with Cocoon - presently I use
the FormValidatorAction inbuilt in Cocoon to validate my form-fields,
screen-flow being controlled via sitemap such as:

<map:act type="validator">
... load new page
... re-load existing page to display error messages

Now this kind of works. I like how my validation rules are abstracted to a
separate xml file, where I define fields, and constraint sets, such as:

<parameter name="UserName" type="string" min-len="5" max-len="20" nullable="no"/>
<parameter name="Password" type="string" min-len="5" max-len="20" nullable="no"/>
<constraint-set name="someConstraintSet">
  <validate name="UserName"/>
  <validate name="Password"/>

SO What I need to be able to do next, is validate certain form fields with a
back-end, to check their input matches some specific business rule. Perhaps the
user enters a phone number and I want to validate that it's a "supported"
number. Or whatever. But this is a vital step in my web-app!

So how would you guys approach sneaking in soap-calls within the validation in
the simplest way?

I was thinking of 2 ways:

1. Extend org.apache.cocoon.acting.FormValidatorAction and add in a new type and
other parameters. Not sure on how to do this exactly, but it sounds promising,
as I can perform all the validation in one step.
2. Write a custom java action that checks certain fields at certain stages, and
make soap calls using axis. This means I actually perform 2 validation steps.

What do y'all think? Feedback welcome :)

p.s. yet to find out how to process a soap payload in XSP - ie extract data and
use it, BEFORE an XSLT transform.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message