use of org.gluu.oxtrust.model.GluuCustomAttribute in project oxTrust by GluuFederation.
the class LanguageBean method setLocaleCode.
public void setLocaleCode(String localeCode) {
if (!identity.isLoggedIn()) {
return;
}
GluuCustomPerson gluuCustomPerson = (GluuCustomPerson) identity.getUser();
if (gluuCustomPerson == null) {
return;
}
GluuCustomAttribute locale = getLocaleOrNull(gluuCustomPerson);
if (locale == null) {
addLocale(gluuCustomPerson, localeCode);
} else {
locale.setValue(localeCode);
}
personService.updatePerson(gluuCustomPerson);
}
use of org.gluu.oxtrust.model.GluuCustomAttribute in project oxTrust by GluuFederation.
the class CustomAttributeAction method removePhoto.
public void removePhoto(String inum) {
if (StringHelper.isEmpty(inum)) {
return;
}
GluuCustomAttribute customAttribute = getCustomAttribute(inum);
if ((customAttribute == null) || StringHelper.isEmpty(customAttribute.getValue())) {
return;
}
GluuImage image = imageService.getImage(customAttribute);
if (image != null) {
image.setStoreTemporary(addedPhotos.contains(image));
if (image.isStoreTemporary()) {
imageService.deleteImage(image);
addedPhotos.remove(image);
} else {
removedPhotos.add(image);
}
}
customAttribute.setValue(null);
}
Aggregations