Skip to main content

If you don't have an IBM ID and password, register here.

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. This profile includes the first name, last name, and display name you identified when you registered with developerWorks. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

Speech-enable Web apps using RDC with Voice Toolkit

Reusable Dialog Components do away with complicated redesign

Girish Dhanakshirur (girid@us.ibm.com), Staff Software Engineer, IBM
Girish Dhanakshirur is a Staff Software Engineer with IBM. Girish has led component development for various voice products at IBM over the last seven years. His portfolio includes development of ViaVoice, the WebSphere Transcription Server, Voice Server, and Voice Application Access products. Currently, he is responsible for Reusable Dialog Component (RDC) Tooling initiatives. You can reach Girish at girid@us.ibm.com.

Summary:  Speech applications have come to be in demand with many applications, which can sound daunting to developers who have never before made provisions for speech. Don't put it off, though, believing that it means a massive rewriting of your current offerings. It is now possible to enhance current Web applications, or develop new ones, with the Voice Toolkit and Reusable Dialog Components. Learn to construct successful voice apps, and without a big learning curve.

Date:  16 Mar 2005
Level:  Introductory

Comments:  

There has been a significant effort in developing complex, standards-based enterprise Web applications using a Java™ 2 Platform, Enterprise Edition (J2EE) programming model with the final presentation rendered using HTML mark up. Developers trying to speech-enable these applications are hindered by the lack of a standards-based approach. Commonly used approaches include authoring the presentation layer with static VoiceXML mixed inside the server side code, or by coding Java ServerPage (JSP) pages to dynamically generate the VoiceXML code directly. Both approaches have a significant negative impact on reuse and maintenance, though. The resulting code not only handles the application logic, but also has voice-specific code to handle dialog flow such as re-prompts, help, no-match, and so on, which makes it almost impossible to design, reuse, extend, or maintain. Further, this approach has another drawback in that it fails to separate developers' roles based on their expertise. Typically, Web developers code the application logic on the server side to connect to back-end applications; speech application developers are expert in creating grammars, dialog handling, speech recognition systems, and Text-to-Speech systems; Voice User Interface designers are experts in designing a good Voice Interface for handling the right prompts, responses, and so on.

The Reusable Dialog Components (RDCs) framework is designed around the J2EE/JSP programming model and provides a Web-tier approach to voice-application development that fits well with the J2EE multitier model. RDCs constitute a custom JSP tag library, which application developers can use within a JSP page. Each custom tag in the server environment generates the appropriate VoiceXML 2.0 code. The complexity of dialog management is hidden in the tag files. These tags are responsible for generating voice output, collecting and validating information from the user, formatting the data in canonical form, and guaranteeing completeness. For details on RDC architecture, refer to the RDC Web site (see Resources).

RDC applications and the WebSphere Voice Toolkit

The IBM® Voice Toolkit and the Rational® Application Developer (RAD) or Rational Web Developer (RWD) together make up all the tools needed to add speech to any existing Web applications or to develop a new speech-enabled Web application. RAD/RWD helps in developing multitier J2EE applications and Enterprise Java Bean (EJB) components. It also has a support for Struts-based application development. The Struts builder helps to design Model-View-Controller- (MVC) based applications in which the Model is a Bean, the Controller is a set of action classes with configuration files, and the View is a JSP page rendering the User interface; in our case, Voice User Interface.

The struts builder helps to lay out the overall Web application and identify various components. Figure 1 shows a simple Web Application in the Struts Builder. The JSP renders HTML markup.


Figure 1. A Struts-built Web application
XML error: The image is not displayed because the width is greater than the maximum of 580 pixels. Please decrease the image width.

The Voice Toolkit provides all the tools needed to develop, debug, and deploy voice applications. The Call Flow Builder (CFB), an easy to use graphical tool for visual components of a voice application, allows for the design and development of a voice application. The latest version of Call Flow Builder now supports application development using RDCs. By creating a Call Flow Builder file in the Voice Toolkit, you can drag and drop RDCs from a rich library of prebuilt components onto the canvas. The developer can also add any VoiceXML elements like prompt, decision, or disconnect from the Call Flow palette. Figure 2 shows a simple Call Flow, which includes two RDCs and two statement components from the palette.


Figure 2. A Call Flow, including two RDCs and two statement components from the palette
XML error: The image is not displayed because the width is greater than the maximum of 580 pixels. Please decrease the image width.

By placing the generic, preconfigured RDC components on the canvas, you can now customize each component by overriding the default prompts. Figure 3 shows how to override the default configurations for an RDC. Each RDC has an extensive set of properties you can customize, including No-Input 1, No-Input 2, No-Input 3, No-Match, and Help to name a few. For example, the digits "RDC" have generic values; the default prompt says, "Please say each digit of the desired number." If this component is used to capture a User ID, it can be customized to prompt, "Please say your User ID, one digit at a time." by overriding the default value.

After the RDCs are customized, the layout can be completed by connecting all of the objects on the canvas. The code that is then generated will be ready to deploy as JSP code in a Web project. The Call Flow Builder generates all the JSP code needed by the framework in addition to the code necessary for making calls to the individual RDCs. RDCs are shipped with default configuration files for getting up and running quickly. The RDC Properties Dialog (Figure 3) can aid in modifying those default configurations, creating customized configuration files for the framework to consume.


Figure 3. The RDC properties dialog
XML error: The image is not displayed because the width is greater than the maximum of 580 pixels. Please decrease the image width.


Developing an RDC using the Voice Toolkit

After installing WebSphere™ Studio, download the Voice Toolkit Technical Preview 6.0 Installer (see Resources) from the Voice Toolkit Web site, which will support development of RDC-based applications. Download the latest RDC library from the Apache site (see Resources). The RDC custom tag library (taglib-rdc.jar) requires a servlet container that supports the JSP 2.0 specification or higher. You must add jstl.jar and standard.jar to the WEB-INF\lib folder from the Apache project. You can use Jakarta Tomcat to test your application. You can use the WebSphere Application Server Version 6.0 test environment, included with RAD/RWD, to test your application.

  1. Create or open a dynamic Web project inside WebSphere RAD/RWD Studio.
  2. After coding the server side logic, create/edit the view by switching to the Voice perspective.
  3. Import the RDC library palette files from the Voice Toolkit library directory (%RAD%\VoiceToolkit\Libraries\RDC).
  4. Create a Communication Flow Builder file, and drag and drop the required RDC components from the RDC library.

Refer to the RDC documentation inside the Voice Toolkit for further details. After the JSP code is generated (right-click and select Generate JSP), you can insert additional logic inside the generated JSPs and connect back to the rest of the framework for making appropriate calls to the RDC components, which return a canonical value from Voice Input.


Running the RDC application using the Voice Toolkit

The project can now be run in the WebSphere Application Server Version 6.0 Test environment inside RAD/RWD, or can be exported as a WAR file. To run the application on a Tomcat server, this WAR file can be deployed on a Tomcat server by copying the WAR file into the webapps directory. Follow the server setup instructions from the Apache RDC Web site (see Resources). Use Internet Explorer to verify that the Tomcat server is running (http://localhost:8080/">http://localhost:8080/). Modify the URL to point to your application and make sure you can view the first page in Internet Explorer. RDCs generate VoiceXML 2.0 code and after the application is running, you can use the Voice Toolkit's Call Simulator to run the application. Use the Voice Toolkit to create a new Launch Configuration for a VoiceXML application. Select Remote VoiceXML URL and use the above URL to run/debug the application. If you need to modify any prompts, you can do so by opening the RDC Properties dialog for that RDC and modifying the values. Save and redeploy the WAR file, then rerun the VoiceXML application in the Voice Toolkit.


Developing your own RDC component

The RDC custom tag library, submitted by IBM to Apache, consists of several basic and high-level components. The basic components provide a well-defined dialog structure to collect simple elements of the application (for example, Digits, Date, Name, and so on) by generating appropriate VoiceXML 2.0 code, which will run on a VoiceXML browser. If you need to extend these basic RDCs or develop your own, the RDC framework provides a well-defined component structure. Each atomic or composite component can be composed further into bigger components using recursive composition. To develop these components, the Voice Toolkit includes a VoiceXML editor, which will aid in writing VoiceXML fragments. This editor has a Content Assist feature, which shows a list of valid tags at the current cursor position when you type an open bracket or when you press [Ctrl] + [Space]. The editor also validates the VoiceXML fragment and flags any VoiceXML syntax errors.

The RDC components might also involve developing grammars to be used inside VoiceXML code. The toolkit simplifies the development of rule grammars, and it also aids in testing these grammars with grammar editors and a grammar test tool. After the deployed application is ready to test, refer to Running the RDC application using the Voice Toolkit to run the application. You can set conditional or unconditional breakpoints in the source code for use with the VoiceXML Debugger and start the launch configuration in Debug mode. Optionally, you can run a session to test the fragment using the Call Simulator by launching the configuration in Run mode. After the component is tested, it is ready to be used inside a JSP page by other developers. A point to note is that RDC components are assembled within a container tag called a group tag, which hosts the dialog components and carries out the dialog management across the components. The components are responsible for returning the appropriate information to the application. For details on the Public Contract, refer to RDC documentation on the Apache Web site (see Resources).


In conclusion

The IBM Voice Toolkit includes all necessary tools for speech-enabling Web applications using the RDC framework. The components hosted inside a JSP page can be easily developed and configured. The remaining components of the application, such as the application logic and dialog flow, and so on can be developed using WebSphere Rational Studio. Both tools provide a powerful suite for enterprise-level Web-based VoiceXML applications using the RDC framework.


Resources

About the author

Girish Dhanakshirur

Girish Dhanakshirur is a Staff Software Engineer with IBM. Girish has led component development for various voice products at IBM over the last seven years. His portfolio includes development of ViaVoice, the WebSphere Transcription Server, Voice Server, and Voice Application Access products. Currently, he is responsible for Reusable Dialog Component (RDC) Tooling initiatives. You can reach Girish at girid@us.ibm.com.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in

If you don't have an IBM ID and password, register here.


Forgot your IBM ID?


Forgot your password?
Change your password


By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. This profile includes the first name, last name, and display name you identified when you registered with developerWorks. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)


By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere
ArticleID=56348
ArticleTitle=Speech-enable Web apps using RDC with Voice Toolkit
publish-date=03162005
author1-email=girid@us.ibm.com
author1-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

For articles in technology zones (such as Java technology, Linux, Open source, XML), Popular tags shows the top tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), Popular tags shows the top tags for just that product zone.

For articles in technology zones (such as Java technology, Linux, Open source, XML), My tags shows your tags for all technology zones. For articles in product zones (such as Info Mgmt, Rational, WebSphere), My tags shows your tags for just that product zone.

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).