rubys       2005/04/17 09:47:38

  Modified:    rdc/xml  intro.xml
  Added:       rdc/examples/web/mortgage-app pause.jsp
               rdc/examples/web/musicstore-app/voice pause.jsp
               rdc/src/.grammar pause.grxml
               rdc/src/META-INF/tags/rdc pause.tag
               rdc/src/META-INF/tags/rdc/config pause.xml
               rdc/src/org/apache/taglibs/rdc Pause.java
  Log:
  Files I missed in yesterday's commit.
  Author: Rahul P Akolkar
  
  Revision  Changes    Path
  1.1                  
jakarta-taglibs-sandbox/rdc/examples/web/mortgage-app/pause.jsp
  
  Index: pause.jsp
  ===================================================================
  <!--Example:Start-->

  <%--

    Copyright 2004 The Apache Software Foundation.

    Licensed under the Apache License, Version 2.0 (the "License");

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at

  

        http://www.apache.org/licenses/LICENSE-2.0

  

    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an "AS IS" BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.

  --%>

  <!--$Id: pause.jsp,v 1.1 2005/04/17 16:47:38 rubys Exp $-->

  <!--

  <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>

  <%@ taglib prefix="rdc" uri="http://jakarta.apache.org/taglibs/rdc-1.0"%>

  -->

  <vxml xmlns="http://www.w3.org/2001/vxml"; version="2.0" xml:lang="en-US">

    <jsp:useBean id="dialogMap" class="java.util.LinkedHashMap" 
scope="session"/>

    <rdc:task map="${dialogMap}">

  

      <rdc:pause id="pause" />

  

    </rdc:task>

  </vxml>

  

  <c:if test="${!(empty pause)}">

    <rdc:struts-submit submit="${pause}" context="${pageContext}" 
clearlist="pause"

     dialogMap="${dialogMap}" />

  </c:if>

  <!--Example:End-->

  
  
  
  1.1                  
jakarta-taglibs-sandbox/rdc/examples/web/musicstore-app/voice/pause.jsp
  
  Index: pause.jsp
  ===================================================================
  <!--Example:Start-->

  <%--

    Copyright 2004 The Apache Software Foundation.

    Licensed under the Apache License, Version 2.0 (the "License");

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at

  

        http://www.apache.org/licenses/LICENSE-2.0

  

    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an "AS IS" BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.

  --%>

  <!--$Id: pause.jsp,v 1.1 2005/04/17 16:47:38 rubys Exp $-->

  <!--

  <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>

  <%@ taglib prefix="rdc" uri="http://jakarta.apache.org/taglibs/rdc-1.0"%>

  -->

  <vxml xmlns="http://www.w3.org/2001/vxml"; version="2.0" xml:lang="en-US">

    <jsp:useBean id="dialogMap" class="java.util.LinkedHashMap" 
scope="session"/>

    <rdc:task map="${dialogMap}">

  

      <rdc:pause id="pause" />

  

    </rdc:task>

  </vxml>

  

  <c:if test="${!(empty pause)}">

    <rdc:struts-submit submit="${pause}" context="${pageContext}" 
clearlist="pause"

     dialogMap="${dialogMap}" />

  </c:if>

  <!--Example:End-->

  
  
  
  1.1                  jakarta-taglibs-sandbox/rdc/src/.grammar/pause.grxml
  
  Index: pause.grxml
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>

  <!DOCTYPE grammar PUBLIC "-//W3C//DTD GRAMMAR 1.0//EN" 
"http://www.w3.org/TR/speech-grammar/grammar.dtd";>

  <grammar version="1.0" xmlns="http://www.w3.org/2001/06/grammar"; xml:lang = 
"en-US"   tag-format="semantics/1.0"

           mode="voice" root="pause">

  <!-- 

    Copyright 2004 The Apache Software Foundation.

   

    Licensed under the Apache License, Version 2.0 (the "License");

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at

  

        http://www.apache.org/licenses/LICENSE-2.0

  

    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an "AS IS" BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.

  -->

  

    <rule id="pause" scope="public">

      <one-of>

          <item>resume</item>

      </one-of>

    </rule>

  

  </grammar>

  

  
  
  
  1.1                  
jakarta-taglibs-sandbox/rdc/src/META-INF/tags/rdc/pause.tag
  
  Index: pause.tag
  ===================================================================
  <%--

    Copyright 2004 The Apache Software Foundation.

    Licensed under the Apache License, Version 2.0 (the "License");

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at

  

        http://www.apache.org/licenses/LICENSE-2.0

  

    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an "AS IS" BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.

  --%>

  <!--

  <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>

  <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"; %>

  <%@ taglib prefix="rdc" uri="http://jakarta.apache.org/taglibs/rdc-1.0"; %>

  

  <%@ tag body-content="empty" %>

  

  <%@ attribute name="id" required="true" rtexprvalue="false" %>

  <%@ attribute name="config" required="false" %>

  <%@ attribute name="minConfidence" required="false" %>

  <%@ variable name-from-attribute="id" alias="retVal" scope="AT_END"%>

  -->

  

  <rdc:comment>

  Description: Pause the application.

  Attributes:

  id: unique identifier for the atom

  config: the configuration file location 

  minConfidence: the minimum acceptable confidence value

  </rdc:comment>

  

  <rdc:peek var="stateMap" stack="${requestScope.rdcStack}"/>

  

  <rdc:comment>

  Bean model holds the private data model of this component.

  It is created when the component is called the first time,

  and is found in subsequent requests  in stateMap[id].

  </rdc:comment>

  <jsp:useBean id="constants" class="org.apache.taglibs.rdc.core.Constants" />

  

  <c:choose>

    <c:when test="${empty stateMap[id]}">

      <rdc:comment>This instance is being called for the first time in this 
session </rdc:comment>

      <jsp:useBean id="model"

        class="org.apache.taglibs.rdc.Pause" >

        <c:set target="${model}" property="state"

        value="${stateMap.initOnlyFlag == true ? constants.FSM_INITONLY : 
constants.FSM_INPUT}"/>

        <rdc:comment> initialize bean from our attributes </rdc:comment>

        <c:set target="${model}" property="id" value="${id}"/>

        <c:set target="${model}" property="resumeURI" 
value="${param['resumeURI']}"/>

        <jsp:useBean id="voice_grammar"

         class="org.apache.taglibs.rdc.core.Grammar" >

            <c:set target="${voice_grammar}" property="grammar"

             value="${pageContext.request.contextPath}/.grammar/pause.grxml"/>

        </jsp:useBean>

        <c:set target="${model}" property="grammar" value="${voice_grammar}"/>

        <rdc:configure model="${model}" config="${config}" 

          defaultConfig="META-INF/tags/rdc/config/pause.xml" />

        <rdc:setup-results model="${model}" submit="${submit}" 

          minConfidence="${minConfidence}" numNBest="${numNBest}" />

      </jsp:useBean>

      <rdc:comment>cache away this instance for future requests in this session 
</rdc:comment>

      <c:set target="${stateMap}" property="${id}" value="${model}"/>

    </c:when>

    <c:otherwise>

      <rdc:comment>retrieve cached bean for this instance</rdc:comment>

      <c:set var="model" value="${stateMap[id]}"/>

    </c:otherwise>

  </c:choose>

  

  <rdc:extract-params target="${model}" parameters="${model.paramsMap}"/>

  

  <rdc:fsm-run  model="${model}" />

                

  <c:if test="${model.state == constants.FSM_DONE}">

    <c:set var="retVal" value="${model.value}"/>

  </c:if>

  
  
  
  1.1                  
jakarta-taglibs-sandbox/rdc/src/META-INF/tags/rdc/config/pause.xml
  
  Index: pause.xml
  ===================================================================
  <?xml version="1.0" encoding="utf-8"?>

  <config>

  <!-- 

    Copyright 2004 The Apache Software Foundation.

   

    Licensed under the Apache License, Version 2.0 (the "License");

    you may not use this file except in compliance with the License.

    You may obtain a copy of the License at

  

        http://www.apache.org/licenses/LICENSE-2.0

  

    Unless required by applicable law or agreed to in writing, software

    distributed under the License is distributed on an "AS IS" BASIS,

    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    See the License for the specific language governing permissions and

    limitations under the License.

  -->

    <input>

      <property-list>

        <property name="incompletetimeout"  value="120s"/>

        <property name="completetimeout"  value="120s"/>

        <property name="timeout"  value="120s"/>

      </property-list>

      <prompt-list>

        <prompt>To unpause, say resume.</prompt>

      </prompt-list>

      <help-list>

        <help>

          <prompt>To unpause, say resume.</prompt>

        </help>

      </help-list>

      <noinput-list>

        <noinput />

      </noinput-list>

      <nomatch-list>

        <nomatch />

      </nomatch-list>

    </input>

  </config>

  
  
  
  1.1                  
jakarta-taglibs-sandbox/rdc/src/org/apache/taglibs/rdc/Pause.java
  
  Index: Pause.java
  ===================================================================
  /*

   *    

   *   Copyright 2004 The Apache Software Foundation.

   *

   *  Licensed under the Apache License, Version 2.0 (the "License");

   *  you may not use this file except in compliance with the License.

   *  You may obtain a copy of the License at

   *

   *      http://www.apache.org/licenses/LICENSE-2.0

   *

   *  Unless required by applicable law or agreed to in writing, software

   *  distributed under the License is distributed on an "AS IS" BASIS,

   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

   *  See the License for the specific language governing permissions and

   *  limitations under the License.

   *

   *

   */

  package org.apache.taglibs.rdc;

  

  import org.apache.taglibs.rdc.core.BaseModel;

  /**

   * Datamodel for the pause RDC. 

   * The pause RDC is used to put an RDC based application "on hold".

   * The utterance "resume" will "unpause" the application.

   *

   * @author Rahul Akolkar

   */

  public class Pause extends BaseModel {

  

        // The URI where the application will resume after being "unpaused"

        private String resumeURI;

  

        /**

          * Sets default values for all data members

          */

        public Pause() {

                super();

                this.resumeURI = null;

        }

        

        /**

         * Get the URI where the application will resume after being "unpaused"

         * 

         * @return String the resumeURI

         */

        public String getResumeURI() {

                return resumeURI;

        }

  

        /**

         * Set the URI where the application will resume after being "unpaused"

         * 

         * @param String the resumeURI

         */

        public void setResumeURI(String string) {

                this.resumeURI = string;

        }

        

        /**

         * Return the resumeURI when on the voice browser's "filled" event

         * 

         * @param input The grammar match from the "resume" grammar

         * @return The value of pause RDC (which will be the resumeURI as 
defined

         *         in the public contract)

         */

        protected Object canonicalize(Object input, boolean isAttribute) {

                return resumeURI;               

        } // end canonicalize()

  

  }

  
  
  
  1.8       +3 -0      jakarta-taglibs-sandbox/rdc/xml/intro.xml
  
  Index: intro.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs-sandbox/rdc/xml/intro.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- intro.xml 27 Feb 2005 16:02:07 -0000      1.7
  +++ intro.xml 17 Apr 2005 16:47:38 -0000      1.8
  @@ -122,6 +122,9 @@
     <section name="RDC News" href="News">

   

       <news>

  +      <newsitem date="03/08/2005">

  +        Beta 1.0 of the RDC taglib has been released!

  +      </newsitem>

         <newsitem date="02/25/2005">

           The Music Store sample application is now multi-channel (Speech + 
small device GUI)!

         </newsitem>

  
  
  

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

Reply via email to