String returnStatus = "failure";
String rowID = null;
boolean isEntity = false;
try {
ContactVO contactObject = new ContactVO();
rowID = request.getParameter("rowId");
isEntity = (request.getParameter("type") == null) ? false : true;
ContactFacadeHome aa = (ContactFacadeHome)CVUtility.getHomeObject(
"com.centraview.contact.contactfacade.ContactFacadeHome", "ContactFacade");
ContactFacade remote = aa.create();
remote.setDataSource(dataSource);
DynaActionForm dynaForm = (DynaActionForm)form;
String recordType = "";
if (isEntity) {
recordType = "Entity";
EntityVO entityVO = remote.getEntity(Integer.parseInt(rowID));
contactObject = entityVO;
dynaForm.set("name", entityVO.getName());
request.setAttribute("name", entityVO.getName());
} else {
recordType = "Individual";
IndividualVO individualVO = remote.getIndividual(Integer.parseInt(rowID));
contactObject = individualVO;
dynaForm.set("name", individualVO.getFirstName() + " " + individualVO.getLastName());
request
.setAttribute("name", individualVO.getFirstName() + " " + individualVO.getLastName());
}
dynaForm.set("ContactID", Integer.toString(contactObject.getContactID()));
dynaForm.set("EntityType", Boolean.toString(isEntity));
request.setAttribute("EntityType", Boolean.toString(isEntity));
request.setAttribute("closeWindow", request.getAttribute("closeWindow"));
request.setAttribute("refreshWindow", request.getAttribute("refreshWindow"));
Iterator mocIterator = contactObject.getMOC().iterator();
ArrayList phoneNumbers = new ArrayList();
ArrayList emailAddresses = new ArrayList();
String primaryEmailAddress = new String();
while (mocIterator.hasNext()) {
MethodOfContactVO methodOfContact = (MethodOfContactVO)mocIterator.next();