There is a way to accomplish both, it appears that in order to pass it
along more than one grammar file, then you must pass it an array, and
not some type of deliminated list.  Also, if in the case of having one
or more of them of the type dtmf, you need to pass an array of
org.apache.taglibs.rdc.core.Grammar objects.

Since the information necessary to create these objects lives in the
jsp context of my application, I have to resort to scriptlets to
accomplish the above.  I would much rather see a method for
rdc:template to handle this on it's own.

I recommend:

1.  Making rdctemplate.java look for and handle a comma seperated list
of grammar url's

2.  possible adding another attribute to template:

<rdc:template grammar="foo.grxml,bar.grxml" grammar-dtmf="dtmf.grxml"/>

Then, the code could loadall of them into the document.  Any other
ideas on how to accomplish this easily, without resorting to
scriptlets?

Here is what I have now:

        <c:set var="gramUrl1">${grammarRoot}subid.grxml</c:set>
        <c:set var="gramUrl2">${grammarRoot}subid-dtmf.grxml</c:set>    
        
        <%
                String gramUrl1= (String) pageContext.getAttribute("gramUrl1");
                String gramUrl2= (String) pageContext.getAttribute("gramUrl2");
                
                org.apache.taglibs.rdc.core.Grammar gram1 = new
org.apache.taglibs.rdc.core.Grammar(gramUrl1, Boolean.FALSE,
Boolean.FALSE,"subid");
                org.apache.taglibs.rdc.core.Grammar gram2 = new
org.apache.taglibs.rdc.core.Grammar(gramUrl2, Boolean.TRUE,
Boolean.FALSE,"subid-dtmf");
                
                org.apache.taglibs.rdc.core.Grammar [] arrayGrams = new
org.apache.taglibs.rdc.core.Grammar [] {gram1,gram2};
                
        %>

        <rdc:template id="memberId" config="${configRoot}${form.rdcConfigFile}"
                confirm="false" grammar="<%=arrayGrams %>"
                minConfidence="0.42" numNBest="1" />


ugly.

Thanks,
Shane

On 10/25/05, Shane Smith <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> I'm trying to setup a RDC using the rdc:template tag, but running into
> an issue with grammars:
>
>
> In the RDC docs, it says that the grammar attribute of the tag takes,
> "One or more grammars needed by this instance".  It doesn't say how
> they should be deliminated.  I've tried both a space and a comma, but
> neither one appears to work.  I only get the grammar file that was
> last listed.
>
> Regardless, the most common reason for doing this is to list one voice
> grammar, and one dtmf grammar.  But, RDCTemplate.java has hard-coded
> logic to assume voice grammars, and fills in that attribute of the
> grammar tag.  According to spec, the grammar tag attribute of "mode"
> allows for either "voice" or "dtmf", but not both, and if left blank
> it defaults to "voice".
>
> How can I specify more than one grammar file using rdc:template, and
> also, how can I specify one as a voice grammar and one as dtmf?
>
> Thanks,
> Shane
>

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

Reply via email to