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

Page of 122
Execution Methods
The following bullets describe the execution methods:
SayItSmartContent convertToFiles(Object data, String inputFormat, 
                                   String outputFormat, String fileset)
This is the execution method for converting data to a list of audio files with TTS backups.
The first argument is the data to convert. This data can be any Java object and it is up to the
plugin to cast to the appropriate type (usually depending on what the input format is). Most
of the time, though, it will be considered a 
String
. The next three arguments list the real
names of the input format, output format, and fileset specified in the voice element
configuration (either statically in Builder for Call Studio or dynamically).
The method returns an instance of 
SayItSmartContent
. This class encapsulates any number
of audio filenames, their TTS backups, and pauses to insert in the playback. The execution
method must create an instance of this class, add the desired content to it, and return it. VXML
Server then reads this content to generate the VoiceXML for the Say It Smart audio item in
the audio group.
Note:
• The path and file type options available in the Say It Smart configuration in the Builder
are not passed here because they are added automatically by VXML Server once the
plugin has converted the data. The plugin should produce just the audio file names
without any paths or extensions.
• While the option exists, the plugin need not include TTS backups for the audio files.
They are used as a backup in case the audio file is not found or is corrupted. Not
including a transcript (by making it 
null
) would mean that if the audio file could
not be found, the application would prematurely end with an error.
The developer can throw a 
SayItSmartException
 in this method indicating the data passed
to the plugin could not be converted using the specified configuration. This would most likely
end the call prematurely so the exception should be thrown only when the Say It Smart plugin
cannot do what it is supposed to do and is unable to recover.
convertToFiles()
 is abstract, meaning every Say It Smart plugin must implement this
method.
SayItSmartContent convertToTTS(Object data, String inputFormat, 
                                 String outputFormat, String fileset)
This is the execution method for converting data to a TTS string. The arguments are identical
in this method as the c
onvertToFiles()
 method.
Note: Even though the fileset option technically does not apply here, it is included in case
the plugin does alter the TTS output based on fileset information.
Programming Guide for Cisco Unified CVP VXML Server and Cisco Unified Call Studio Release 8.0(1)
77
Chapter 12: Say It Smart Plugins
Execution Methods