The patch for unit testing voiceXML apps was just accepted to htmlunit. It won't be in the distribution jar until the next release, but if you build from CVS you'll get the new version. It turns out that a primary committer for Canoo, Marc Guillemot, is also a committer for htmlunit - so there was no convincing needed at all!

Regarding my validation issue, you're right -- I can get what I need by setting size=7 for min and max and making the messages the same in the config. And actually that is acceptable for me. It would be nice if there were a separate validation for exact size so that the default error message would be more appropriate, but that's a pretty fine point. Doing it at the grammar would be tricky because grammars are static resources in the jars, right? I wasn't thinking of that, though it's interesting. How would that impact error messages? Would that mean the interpreter would generate a no-match event if the input were the wrong size? If so, I don't like that because it wouldn't give a very meaningful message (speaking name and giving 6 digits would give same error msg). Having the RDC generate the message seems like the most flexible and user-friendly approach.

As for the property files for specifying grammars, I noticed those went in a while ago, but haven't taken a look. Do I need to change them in the rdc source, or is there something I can do in app-space to make the new grammars active for a locale? We'll be doing a multi-lingual app, so the locale-per-app granularity is what we're looking for. I'll read through your comments more carefully a bit later when we get to this stage. It sounds like overriding these on a per-locale basis is possible...which was my hope.

Btw, what is a dynamic grammar? Also, what did you mean by "vary validation rules suitably?" Did you mean change rdc validation to do things that could also be done in the grammar, as per your example?

Regarding the possible JSP writer buffering issue during forwards, would you like me to send you my application offline? It should be an ideal testbed since I get it instantly when I stop redirecting.

Rahul P Akolkar wrote:

I hope the patch gets accepted to htmlunit shortly, since patching
is by far the trickiest part of what needs to be done.
<snap/>

Do you need help convincing them there is more than one modality to the "web" ;-?

First, we need validation that in put is an exact size, rather than
just a range, for alpha, digit and alphanum.  Range works, but the
error message is goofy.  The change looks straightforward, and I was
thinking of making the new attribute "size."
<snip/>

We should work with examples. Do you mean, for instance:
<rdc:digits id="foo" size="7" />
in place of:
<rdc:digits id="foo" minLength="7" maxLength="7" />
The error messages can be adjusted suitably via the config file (both instances can produce the same VUI).

Or do you mean influencing the grammar itself i.e. instead of a blanket:
<item repeat="1-"><ruleref uri="#digit"/></item>
produce an instance specific:
<item repeat="7-7"><ruleref uri="#digit"/></item>
which will reduce the number of round trips (though possibly trigger more events client-side).

The main thing though is to find or make a way to specify custom
grammars for standard RDCs.  For instance, date.grxml allows year to
be optional, which for our purposes will never be the case.  We'd
also like to narrow some of the grammars that accept wider input than
we need, to improve the accuracy of speech recognition.  These are
generally minor tweaks, and do not change the contract between the
grammar and the RDC.
<snap/>

Indeed, the last line is crucial.

I see in fsm-input where these are set, and
that there's flexibility to have inline grammars and arrays of
either.
<snip/>

Thats the rendering bit, they're set in the respective tag file.

I didn't see a mechanism for specifying overrides for
default grammars though.  I think it would be ideal if this were
doable at the per-instance level and also per-application level, the
later possibly via an init param to the grammer servlet.
<snap/>

At a per application level (rather per locale per app), the grammars can be set using these properties files [ http://svn.apache.org/repos/asf/jakarta/taglibs/sandbox/rdc/trunk/src/org/apache/taglibs/rdc/resources/ ].

At the per instance level, several options are available (each one will require some work):
1) Provide dynamic grammars
2) Vary validation rules suitably
3) Use RDC templates

Speaking of
which, though I haven't thought through all the way how to implement
this yet, I suspect we're going to bump head-on into the
GrammarServlet's dependence on the taglibs-rdc.jar.  Will we have to
break this up to implement this?  Maybe if it pulled grammars from
the classpath instead?
<snip/>

For app-specific grammars (i.e. grammars not packaged in the distro), the GrammarServlet is really not in the picture. The grammars can sit anywhere in the context (as long as its not a folder called .grammar at context root), and the properties file(s) above point correctly.

Thanks for giving credit for my little wiki page :-)
<snap/>

But ofcourse!

Oh, before I forget, I really do need to send you a simple example of
the jsp forwarding problem with struts-submit.  I'm now redirecting
between all struts actions so that no more than 1 JSP ever renders
within a single request.  I understand this works in Tomcat, but WAS
6.0.1 (haven't applied the 6.0.2 patch yet) the voice interpreter
errors out with prolog complaints. Recreating it is pretty simple,
and you might even hit it with the example apps.  If not, I'll try to
find time to create a simple example, or maybe just send you
something offline.
<snip/>

I'll try to recreate at my end when I get a chance.

Thanks,
-Rahul

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to