if (flag == true)
{
MailMessage mailmessage = null;
EmailFacade remote = (EmailFacade)cfh.create();
HashMap hm = new HashMap();
hm.put("MessageID", new Integer(messageID));
mailmessage = remote.getMailMessage(individualID, hm);
remote.setDataSource(dataSource);
String mailIdList[] = { rowId };
remote.emailMarkasRead(Integer.parseInt(folderid), 1, mailIdList);
ArrayList to = mailmessage.getTo();
ArrayList cc = mailmessage.getCc();
String arrayTO[] = new String[to.size()];
for (int i = 0; i < arrayTO.length; i++)
{
MailAddress ma = (MailAddress)to.get(i);
arrayTO[i] = ma.getAddress();
}
String arrayCC[] = new String[cc.size()];
for (int j = 0; j < arrayCC.length; j++)
{
com.centraview.email.getmail.MailAddress macc = (MailAddress)cc.get(j);
arrayCC[j] = macc.getAddress();
}
dynaForm.set("MessageID", Integer.toString(messageID));
//From
if (mailmessage.getMailFrom() != null)
{
dynaForm.set("from", mailmessage.getMailFrom());
}
// To
if (arrayTO.length != 0)
{
dynaForm.set("to", arrayTO);
}
// CC
if (arrayCC.length != 0)
{
dynaForm.set("cc", arrayCC);
}
//date
if (mailmessage.getMessageDate() != null)
{
dynaForm.set("date", mailmessage.getMessageDate());
}
//subject
if (mailmessage.getSubject() != null)
{
dynaForm.set("subject", mailmessage.getSubject());
}
System.out.println("mailmessage.getSubject()"+mailmessage.getSubject());
// body
if (mailmessage.getBody() != null)
{
dynaForm.set("message", mailmessage.getBody());
}
if (mailmessage.getHeadersHM() != null)
{
HashMap hmHeader = (HashMap)mailmessage.getHeadersHM();
String headerKey = (String)hmHeader.get(Constants.EH_SERVICE_KEY);
if (headerKey != null)
{
String headerValue = null;
if (headerKey.equals(Constants.EH_SERVICE_VALUE_ACTIVITY_INVITATION))
{
headerValue = (String)hmHeader.get(Constants.EH_ATTENDEE_STATUS_KEY);
request.setAttribute("header", headerValue);
String activityId = (String)hmHeader.get(Constants.EH_ACTIVITYID_KEY);
request.setAttribute("activityId", activityId);
}
else if (headerKey.equals(Constants.EH_SERVICE_VALUE_CREATEINDIVIDUAL))
{
headerValue = (String)hmHeader.get(headerKey);
headerValue = Constants.EH_SERVICE_VALUE_CREATEINDIVIDUAL;
request.setAttribute("header", headerValue);
}
else if (headerKey.equals(Constants.EH_SERVICE_VALUE_INDIVIDUALIMPORTED))
{