{
this.desiredLocales = desiredLocales;
this.locale = WSRPUtils.getLocale(preferredLocale);
if (userContext != null)
{
UserProfile profile = userContext.getProfile();
if (profile != null)
{
infos = new HashMap<String, String>();
XMLGregorianCalendar bdate = profile.getBdate();
if (bdate != null)
{
infos.put(INFO_USER_BDATE, bdate.toString());
}
infos.put(INFO_USER_GENDER, profile.getGender());
PersonName name = profile.getName();
if (name != null)
{
infos.put(INFO_USER_NAME_FAMILY, name.getFamily());
infos.put(INFO_USER_NAME_GIVEN, name.getGiven());
infos.put(INFO_USER_NAME_MIDDLE, name.getMiddle());
infos.put(INFO_USER_NAME_NICKNAME, name.getNickname());
infos.put(INFO_USER_NAME_PREFIX, name.getPrefix());
infos.put(INFO_USER_NAME_SUFFIX, name.getSuffix());
}
populateContactInfo(profile.getBusinessInfo(), true);
populateContactInfo(profile.getHomeInfo(), false);
EmployerInfo employerInfo = profile.getEmployerInfo();
if (employerInfo != null)
{
infos.put(INFO_USER_DEPARTMENT, employerInfo.getDepartment());
infos.put(INFO_USER_EMPLOYER, employerInfo.getEmployer());
infos.put(INFO_USER_JOB_TITLE, employerInfo.getJobtitle());