if (dateAndTime.length() == 10) {
EntityManager mgr = null;
Order order = null;
TTSSession ttsSession = getTTSProvider().getNewTTSSession(
audioFilePath, "kevin16");
char[] c = dateAndTime.toCharArray();
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("You have selected delivery date to be ");
String date = "" + c[0] + c[1];
int iDate = (new Integer(date)).intValue();
stringBuffer.append(iDate);
String month = "" + c[2] + c[3];
int iMonth = (new Integer(month)).intValue();
String year = "" + c[4] + c[5];
int iYear = (new Integer(year)).intValue();
String hour = "" + c[6] + c[7];
int iHour = (new Integer(hour)).intValue();
String min = "" + c[8] + c[9];
int iMin = (new Integer(min)).intValue();
switch (iMonth) {
case 1:
month = "January";
break;
case 2:
month = "February";
break;
case 3:
month = "March";
break;
case 4:
month = "April";
break;
case 5:
month = "May";
break;
case 6:
month = "June";
break;
case 7:
month = "July";
break;
case 8:
month = "August";
break;
case 9:
month = "September";
break;
case 10:
month = "October";
break;
case 11:
month = "November";
break;
case 12:
month = "December";
break;
default:
break;
}
stringBuffer.append(" of ");
stringBuffer.append(month);
stringBuffer.append(" ");
stringBuffer.append(2000 + iYear);
stringBuffer.append(" at ");
stringBuffer.append(iHour);
stringBuffer.append(" hour and ");
stringBuffer.append(iMin);
stringBuffer.append(" minute. Thank you. Bye.");
java.sql.Timestamp timeStamp = new java.sql.Timestamp(
(iYear + 100), iMonth - 1, iDate, iHour, iMin, 0, 0);
mgr = this.persistenceResourceAdaptorSbbInterface
.createEntityManager(new HashMap(), "custom-pu");
order = (Order) mgr
.createQuery(
"select o from Order o where o.orderId = :orderId")
.setParameter("orderId", this.getCustomEvent().getOrderId())
.getSingleResult();
order.setDeliveryDate(timeStamp);
mgr.flush();
mgr.close();
ttsSession.textToAudioFile(stringBuffer.toString());
MsSignalGenerator generator = msProvider.getSignalGenerator(this
.getAnnouncementEndpointName());
try {