}
String updateSubmitBP = request.getParameter("UpdateBP");
if (updateSubmitBP!=null) {
// doView() stores the baseline in the session object
BasicPerson bpBaseline = (BasicPerson) request.getPortletSession().getAttribute(BASIC_PERSON);
if (bpBaseline != null) {
try {
logger.info("["+portletName+"] Baseline:\n"+bpBaseline.toXmlString());
BasicPerson bp = (BasicPerson) bpBaseline.clone();
bp.setBaseline(bpBaseline);
Name name=bp.getName();
name.setLastName(lastName);
name.setFirstName(firstName);
name.setMiddleName(middleName);
bp.setName(name);
if (gender!=null) {
bp.setGender(gender);
}
List addressList = bp.getAddress();
addressList.clear();
if (addressType!=null) {
for (int i=0;i<addressType.length;i++) {
Address address=bp.newAddress();
address.setType(addressType[i]);
address.setStreet1(addressStreet[i]);
address.setCityOrLocality(addressCity[i]);
address.setStateOrProvince(addressState[i]);
address.setZipOrPostalCode(addressZip[i]);
address.setEffectiveDate(toDate("EffectiveDate",addressEffective[i]));
addressList.add(address);
}
bp.setAddress(addressList);
}
List phoneList = bp.getPhone();
phoneList.clear();
if (phoneType!=null) {
for (int i=0;i<phoneType.length;i++) {
Phone phone=bp.newPhone();
phone.setType(phoneType[i]);
phone.setPhoneArea(phoneAreacode[i]);
phone.setPhoneNumber(phoneNumber[i]);
phoneList.add(phone);
}
bp.setPhone(phoneList);
}
List emailList = bp.getEmail();
emailList.clear();
if (emailType!=null) {
for (int i=0;i<emailType.length;i++) {
Email email=bp.newEmail();
email.setType(emailType[i]);
email.setEmailAddress(emailAddress[i]);
email.setStatus(emailStatus[i]);
email.setPreferred(emailPreferred[i]);
emailList.add(email);
}
bp.setEmail(emailList);
}
bp.update(p2p);
response.setRenderParameter("actionMessage","Update successful.");
} catch (XmlEnterpriseObjectException e) {
e.printStackTrace();
throw new PortletException("XmlEnterpriseObjectException");
} catch (CloneNotSupportedException e) {