thumbImage = htUpload.get(UPLOAD_PERSON_IMAGE_THUMBNAIL_PARAM);
//if these fields are null, then reuse the old file information stored
//Person loggedInPerson = this.getPerson(request);
ModelFacade mf = (ModelFacade) context.getAttribute(MF_KEY);
Person loggedInPerson = mf.getPerson(userName);
if (loggedInPerson != null) {
if (thumbImage == null) {
thumbImage = loggedInPerson.getImageThumbURL();
}
if (imageURL == null) {
imageURL = loggedInPerson.getImageURL();
}
}
logger.finer("************** data entered is*** " + "user_name*" + userName +
" password=" + password +
" first_name=" + firstName +
" last_name=" + lastName +
" summary=" + summary + " thumbUrl=" + thumbImage +
" imageURL=" + imageURL);
//Person person = new Person(userName, password, firstName, lastName, summary, email, telephone, imageURL, thumbImage, timezone, address);
//ModelFacade mf= (ModelFacade) context.getAttribute(MF_KEY);
//do not really need username since you set this value, not sure why it is returned
//String userName = mf.addPerson(person, userSignOn);
//changed above line to this since username already a variable name
//userName = mf.addPerson(person, userSignOn);
// Update person with all field values
person.setUserName(userName);
person.setPassword(password);
person.setAddress(address);
person.setTimezone(timezone);
person.setTelephone(telephone);
person.setFirstName(firstName);
person.setLastName(lastName);
person.setSummary(summary);
person.setImageURL(imageURL);
person.setImageThumbURL(thumbImage);
person = mf.updatePerson(person);
logger.log(Level.FINER, "Person " + userName + " has been updated");
return person;
}