if( "".equals(userid) ) return;
log.info("Looking up user details for " + userid);
this.userid = userid;
// Also, when the user ID is set, look up the user details
User u = getUser(userid);
// If we succeeded:
if( u != null ) {
this.firstname = u.getFirstName();
this.lastname = u.getLastName();
this.fullname = u.getFullName();
this.email = u.getEmail();
this.telephone = u.getPhoneNumber();
// For now, we must format the address manually.
// FIXME The Address entity should do this.
this.address = "";
if( u.getAddress().getAddress() != null && ! "".equals( u.getAddress().getAddress().trim() ) )
this.address += u.getAddress().getAddress() + ",\n";
if( u.getAddress().getCity() != null && ! "".equals( u.getAddress().getCity().trim() ) )
this.address += u.getAddress().getCity() + ",\n";
if( u.getAddress().getProvince() != null && ! "".equals( u.getAddress().getProvince().trim() ) ) {
this.address += u.getAddress().getProvince();
if( u.getAddress().getPostalCode() != null && ! "".equals( u.getAddress().getPostalCode().trim() ) )
this.address += " ";
}
if( u.getAddress().getPostalCode() != null && ! "".equals( u.getAddress().getPostalCode().trim() ) )
this.address += u.getAddress().getPostalCode();
if( (u.getAddress().getProvince() != null && ! "".equals( u.getAddress().getProvince().trim() )) ||
(u.getAddress().getPostalCode() != null && ! "".equals( u.getAddress().getPostalCode().trim() ) ) )
this.address += ",\n";
if( u.getAddress().getCountry() != null && ! "".equals( u.getAddress().getCountry().trim() ) )
this.address += u.getAddress().getCountry();
log.debug("User lookup succeeded: Got details for "+u.getFullName());
} else {
log.error("Username '"+userid+"' not found! Returned a null User object.");
}
}