Cisco Cisco Unified Customer Voice Portal 11.0(1) Developer's Guide

Page of 98
C
HAPTER 
9:
 
C
ONFIGURABLE
 E
LEMENTS
 
 
V
OICE
XML
 
P
ROGRAMMING 
G
UIDE 
 
 
 
FOR 
C
ISCO 
U
NIFIED 
C
USTOMER 
V
OICE 
P
ORTAL 
R
ELEASE 
4.0(1) 
 
 
 
 
53
 
    The element data namespace is shared across the super-element and all sub-elements. Again, 
the VoiceXML Server uses a separate namespace for each element it is aware of, which 
means the super-element. The super-element must ensure that element data created by one 
sub-element does not overwrite the element data created by another sub-element. 
    The super-element must handle all the “internal call flow” between sub-elements. 
Essentially, the super-element must perform the tasks the VoiceXML Server normally 
performs to handle the call flow between sub-elements. This means keeping track of state, 
managing the exit states of sub-elements, and knowing when to leave the super-element with 
its own exit states. 
Even though creating super-elements can be a tedious and potentially error-prone process, it may 
still be preferable over creating a new voice element from scratch. 
Configuration Methods 
In addition to the existing configuration methods defined in 
ElementBase
, two additional 
methods are required for a voice element class to implement. These methods deal with audio, a 
feature unique to voice element configurations. The values returned by these methods are used 
by Unified CVP VoiceXML Studio to render the contents of the Audio tab of a voice element’s 
configuration. 
HashMap getAudioGroups() 
Unlike element settings, which are defined in a simple one-dimensional array, audio groups are 
combined into sets. This is done to facilitate organization and ease of use when configuring the 
voice element in VoiceXML Studio. When right-clicking on the Audio Groups folder in the 
Element Configuration Pane, the dropdown menu lists all the audio group sets. The designer can 
then choose an audio group within a set by selecting the appropriate name from the submenu. 
This method is used to return the audio groups for the element and the sets they belong to. 
A single audio group is contained within a single 
AudioGroup
 instance (
AudioGroup
 is found in 
the 
com.audium.server.voiceElement
 package). The object encapsulates the audio group’s 
real name, display name, and description. The display name is shown within the dropdown menu 
in VoiceXML Studio, the real name is used for all other situations. The audio group description 
is displayed as a tool tip when the cursor points to the audio group in the Element Configuration 
Pane.  
The 
AudioGroup
 class also defines setting dependencies. As with element settings, the 
appearance of audio groups can also depend on the values of certain settings. Again, this exists to 
simplify configuring a complex voice element in VoiceXML Studio. For example, an audio 
group that introduces a confirmation menu would not be necessary if a setting determining if a 
confirmation should exist is turned off. See the previous section describing the 
getSettings()
 
method for a full description of how dependencies work. Configuring audio groups to depend on 
settings works the same way as configuring settings to depend on other settings.