You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Vani Ampavathina <va...@gmail.com> on 2006/02/02 06:54:28 UTC

Regarding RDC

 Hi

 I am evaluating the RDC Tag  libraries to use in our speech
applications.Ihave a small difficulty in using these tags. can you
help me in briefing a
solution for the following problem.

1) When I use,say for example "alpha" tag, I would like to have my own logic
in the "filled" block rather having the default submit and the namelist
formed from the Nbest.js. From the provided document , I understand that we
can use the submit attribute to submit to any other JSP, but what about the
variables i wish to pass on to the next JSP?

Say to have something like

<filled>
 <submit next="UseCollectedAlpha.jsp" namelist="alphacollected var1 var2
var3"/>
</filled>

instead of

<filled>
    <script src="/rdc-examples/.grammar/nbest.js"/>
    <var name="alphaResultNBest" expr="serializeNBest()"/>
    <submit
next="/rdc-examples/alpha.jsp;jsessionid=CD6603360BFF6C0D33417D414A2D205C"
method="post" namelist="alphaResultNBest"/>
  </filled>

is it possible to implement this? whats the reason to send the confidence,
utterance and the interpretation as a serialized object from the nbest.js?
by default the maxNBest is set to 5 and all the values are concatenated and
returned. is there any special reason of such implementation, when i can
directly take up the "application.lastresult$.utterance" for the most
probable value, the asr recognized.

2) how is a simple JSP with 4 lines of code getting translated to few tens
lines of code? The tutorials and wikis doesn't help in understanding the
concept.The only vxml tag I can see in the Tag library is <form> in "
task.tag". The config file gives the prompts list, this part is
understood. But how are the attributes like minLength and maxLength of
"alpha" tag, for example, used to limit the grammar as I notice there is no
direct correspondence to these attributes, and where is the input entered by
the user getting validated?


Regards
Vani

Re: Regarding RDC

Posted by Rahul Akolkar <ra...@gmail.com>.
On 2/2/06, Vani Ampavathina <va...@gmail.com> wrote:
>  Hi
>
>  I am evaluating the RDC Tag  libraries to use in our speech
> applications.Ihave a small difficulty in using these tags. can you
> help me in briefing a
> solution for the following problem.
>
> 1) When I use,say for example "alpha" tag, I would like to have my own logic
> in the "filled" block rather having the default submit and the namelist
> formed from the Nbest.js. From the provided document , I understand that we
> can use the submit attribute to submit to any other JSP, but what about the
> variables i wish to pass on to the next JSP?
>
<snip/>

I would consider the use of the submit attribute to cover only corner
cases, and on a case-by-case basis. It is generally recommended to
leave it unspecified, so the component submits back to itself which is
its default behavior (and thus, allows its state machine to run to
completion). The RDC framework in itself, does nothing for cross-page
navigation. There are multiple web application frameworks that provide
such controllers (such as Struts), and we encourage you to pick one of
those while authoring your applications. To illustrate the point, the
RDC distribution does provide tags to submit to Struts actions, and
echo the errors from these actions as prompts.

More on that here:

http://wiki.apache.org/jakarta-taglibs/ReusableDialogComponents/Tutorials/StrutsInterface

If you want to directly submit to another JSP (without using Struts),
that is quite easy as well, see my other note that Aravilli referenced
earlier in this message thread. These two approaches maintain
component boundaries and responsibilities appropriately.


> Say to have something like
>
> <filled>
>  <submit next="UseCollectedAlpha.jsp" namelist="alphacollected var1 var2
> var3"/>
> </filled>
>
> instead of
>
> <filled>
>    <script src="/rdc-examples/.grammar/nbest.js"/>
>    <var name="alphaResultNBest" expr="serializeNBest()"/>
>    <submit
> next="/rdc-examples/alpha.jsp;jsessionid=CD6603360BFF6C0D33417D414A2D205C"
> method="post" namelist="alphaResultNBest"/>
>  </filled>
>
> is it possible to implement this?
<snap/>

Yes, as mentioned above.


> whats the reason to send the confidence,
> utterance and the interpretation as a serialized object from the nbest.js?
> by default the maxNBest is set to 5 and all the values are concatenated and
> returned. is there any special reason of such implementation, when i can
> directly take up the "application.lastresult$.utterance" for the most
> probable value, the asr recognized.
>
<snip/>

A RDC component is a JSP tag, and exists server-side. The information
you quote is only available on the client. The framework makes sure
application.lastresult$ can be examined by the component's private
data model (see Building Blocks for what that means):

http://wiki.apache.org/jakarta-taglibs/ReusableDialogComponents/Tutorials/BuildingBlocks


> 2) how is a simple JSP with 4 lines of code getting translated to few tens
> lines of code? The tutorials and wikis doesn't help in understanding the
> concept.The only vxml tag I can see in the Tag library is <form> in "
> task.tag".
<snap/>

Its no magic, I assure you ;-) Look at the fsm-*.tag files in this directory:

http://svn.apache.org/repos/asf/jakarta/taglibs/proper/rdc/trunk/src/META-INF/tags/rdc/

Those do most of the VoiceXML generation. Each component maintains an
internal finite state machine, which determines what output is
generated at any given turn.


> The config file gives the prompts list, this part is
> understood. But how are the attributes like minLength and maxLength of
> "alpha" tag, for example, used to limit the grammar as I notice there is no
> direct correspondence to these attributes, and where is the input entered by
> the user getting validated?
>
<snip/>

Those are used by the validate() method of the private data model to
decide whether the input received is valid or not. The private data
models are here:

http://svn.apache.org/repos/asf/jakarta/taglibs/proper/rdc/trunk/src/org/apache/taglibs/rdc/

The methods of importance are validate() and canonicalize().

Please let me know if you have other questions.

-Rahul


>
> Regards
> Vani
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org