On 8/3/05, Shane Smith <[EMAIL PROTECTED]> wrote: > When using RDC's, occasionally I would like to have a different form > prior to the RDC generated form in the vxml output. An example would > be the very first page hit by a new caller. A vxml best practice is > to play a short (less than 2 second) welcome message or tone with the > bargein property set to false, allowing telephony level echo > cancelation to kick in properly. <snip/>
Indeed. > For example: > > <vxml version="2.0" xml:lang="en-US" xmlns="http://www.w3.org/2001/vxml" > > > <form> > <block> > <prompt bargein="false"> > <audio src="welcome.vox"/> > </prompt> > <goto next="#mainRdcForm"/> > </block> > </form> > > <form> > <!-- this is the generated RDC form, but no id attribute has been set. --> > ....... <snap/> Note that this RDC may generate markup on multiple round trips, and you want to generate the welcome prompt only once. This can be done by checking whether the data model for the RDC has been instantiated. Both the sample apps in the RDC distro have welcome prompts, for example, look at how the welcome prompt is played in these pages in the sample apps (if you get a 404, svn is down ;-): 1 [ http://svn.apache.org/repos/asf/jakarta/taglibs/proper/rdc/trunk/examples/web/mortgage-app/login.jsp ] 2 [ http://svn.apache.org/repos/asf/jakarta/taglibs/proper/rdc/trunk/examples/web/musicstore-app/voice/mainmenu.jsp ] > </form> > > The FIA needs to know the name of the form in order to bounce between > them. Since top-down design doesn't work in vxml, we should give a > default name (id) to the rdc generated form, allowing developers to > add code above this at their lesiure. > > I also thought about adding a way for the developer to specify the id > attribute of the form when calling the rdc, but I feel that it's > unnecessary considering you won't have more than one rdc generated > form in any given request. > > What I've done is simply change the task.tag file like so: > > <form id="mainRdcForm"> > <jsp:doBody/> > </form> > > Can anyone think of a reason not to do this, or a better way to handle > this type of requirement? <snip/> So, in summary: 1) While this ID might not be required for the scenario you point out above, I think may help elsewhere. In most cases, however, there will need to be some check server-side, and we will need to stress that in documentation when we add the form ID. 2) I am not too keen on hard-coding the ID, because the very notion that only one form is generated holds only for the components in the distro, the RDC framework doesn't impose any such restriction. You could do more client-side in every round-trip, and maybe it will be nice to have such an example in the distro. As you point out, we can have the author specify the ID. > > Thanks, > Shane Smith -Rahul
