int individualID = userobjectd.getIndividualID();
String messageBody = (String)session.getAttribute("emailmessage");
DynaActionForm dynaForm = (DynaActionForm)form;
GlobalMasterLists gml = GlobalMasterLists.getGlobalMasterLists(dataSource);
StringTokenizer st = new StringTokenizer(messageBody, Constants.EH_HEADER_DELIMETER);
while (st.hasMoreTokens())
{
String fullHeader = st.nextToken();
String strhead = (fullHeader.substring(0, fullHeader.indexOf(Constants.EH_KEYVALUE_DELEMETER))).trim();
String strValue = (fullHeader.substring(fullHeader.indexOf(Constants.EH_KEYVALUE_DELEMETER) + 1)).trim();
if (strhead.equals("street1"))
dynaForm.set("street1", strValue);
else if (strhead.equals("street2"))
dynaForm.set("street2", strValue);
else if (strhead.equals("city"))
dynaForm.set("city", strValue);
else if (strhead.equals("state"))
{
Collection stateCol = (Collection)gml.get("States");
Iterator stateIter = stateCol.iterator();
while (stateIter.hasNext())
{
DDNameValue ddname = (DDNameValue)stateIter.next();
if ((ddname.getName()).equals(strValue))
{
dynaForm.set("state", (new Integer(ddname.getId())).toString());
break;
}
}
} else if (strhead.equals("zip"))
dynaForm.set("zip", strValue);
else if (strhead.equals("country"))
{
Collection countryCol = (Collection)gml.get("Country");
Iterator stateIter = countryCol.iterator();
while (stateIter.hasNext())
{
DDNameValue ddname = (DDNameValue)stateIter.next();
if ((ddname.getName()).equals(strValue))
dynaForm.set("country", (new Integer(ddname.getId())).toString());
}
} else if (strhead.equals("title"))
dynaForm.set("title", strValue);
else if (strhead.equals("source"))
dynaForm.set("source", strValue);
else if (strhead.equals("firstname"))
dynaForm.set("firstname", strValue);
else if (strhead.equals("lastname"))
dynaForm.set("lastname", strValue);
else if (strhead.equals("middlename"))
dynaForm.set("middlename", strValue);
else if (strhead.equals("entity"))
dynaForm.set("entity", strValue);
else if (strhead.equals("entity1"))
dynaForm.set("entity1", strValue);
else if (strhead.equals("Fax"))
{
Collection mocFax = (Collection)gml.get("MOC");
Iterator mocFaxIter = mocFax.iterator();
while (mocFaxIter.hasNext())
{
DDNameValue ddnameFax = (DDNameValue)mocFaxIter.next();
if ((ddnameFax.getName()).equals(strhead))
{
dynaForm.set("mocType1", (new Integer(ddnameFax.getId())).toString());
dynaForm.set("moc1", strValue);
}
}
} else if (strhead.equals("Phone")) {
Collection mocPhone = (Collection)gml.get("MOC");
Iterator mocPhoneIter = mocPhone.iterator();
while (mocPhoneIter.hasNext())
{
DDNameValue ddnamePhone = (DDNameValue)mocPhoneIter.next();
if ((ddnamePhone.getName()).equals(strhead))
{
dynaForm.set("mocType2", (new Integer(ddnamePhone.getId())).toString());
dynaForm.set("moc2", strValue);
}
}
} else if (strhead.equals("Mobile"))
{
Collection mocMobile = (Collection)gml.get("MOC");
Iterator mocMobileIter = mocMobile.iterator();
while (mocMobileIter.hasNext())
{
DDNameValue ddnameMobile = (DDNameValue)mocMobileIter.next();