Cisco Cisco Customer Voice Portal 8.0(1) Developer's Guide

Page of 122
Using the Java API
Dynamic voice, action, and decision element configurations are constructed in the Java API by
implementing the Java interfaces 
VoiceElementInterface
ActionConfigInterface
and 
DecisionConfigInterface
 respectively, all found in the 
com.audium.server.proxy
package.
Note: The name of the voice element interface is not consistent with the others due to backwards
compatibility concerns. Each of these interfaces contains a single method named 
getConfig
that receives three arguments:
The name of the element as a 
String
.
An instance of 
ElementAPI
 or 
ActionAPI
 (for dynamic action element configurations).
These classes belong to the Session API and are used to access session information. (See
An instance of 
VoiceElementConfig
ActionElementConfig
 or
DecisionElementConfig
 (found in the 
com.audium.server.xml
 package) that contains
the base configuration for the element (or 
null
 if there is no base configuration).
The method must return an instance of the configuration object (
VoiceElementConfig
,
ActionElementConfig
 or 
DecisionElementConfig
). This can be a modified version of
the object passed as input to the method or one built from scratch. It is expected that should an
unrecoverable error occur, the dynamic configuration class should throw an 
AudiumException
.
Due to the fact that most dynamic configurations involve only a few changes to the static
configuration, obtaining a base configuration as input to the execution method saves significant
coding effort since the dynamic configuration class simply needs to modify this object in order
to create the final configuration object then return it.
All three configuration classes extend a common base class, 
ElementConfig
. This class defines
those features common to all three element configurations: settings, element and session data
created, custom log content, and associating the call with a UID. 
ActionElementConfig
 and
DecisionElementConfig
 are essentially identical, separate classes are used for design
considerations and for possible future differentiation. 
VoiceElementConfig
, however, expands
upon the 
ElementConfig
 class by introducing voice element only features: local hotlinks,
VoiceXML properties and audio groups. The three configuration classes allow the developer
to obtain everything about a configuration as well as change or add to the configuration in any
way.
To handle audio groups, 
VoiceElementConfig
 introduces inner classes that define an audio
group (
AudioGroup
) and a generic audio item (
AudioItem
). Two additional inner classes
define audio item types that extend the 
AudioItem
 class to define a Say It Smart audio item
(
SayItSmart
) and a static audio item (
StaticAudio
). The 
AudioGroup
 class encapsulates
any number of 
AudioItem
 objects of either type. A developer can create new audio groups
separately and call a method in 
VoiceElementConfig
 to add the audio group to the
Programming Guide for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 8.0(1)
36
Chapter 6: Dynamic Element Configurations
Using the Java API