use of org.xdi.model.GluuImage in project oxTrust by GluuFederation.
the class UpdateOrganizationAction method setCustLogoImageImpl.
private void setCustLogoImageImpl(UploadedFile uploadedFile) {
removeLogoImage();
GluuImage newLogoImage = imageService.constructImage(currentPerson, uploadedFile);
newLogoImage.setStoreTemporary(true);
newLogoImage.setLogo(true);
try {
if (imageService.createImageFiles(newLogoImage)) {
this.curLogoImage = newLogoImage;
}
this.organization.setLogoImage(imageService.getXMLFromGluuImage(newLogoImage));
} catch (Exception ex) {
log.error("Failed to store icon image: '{}'", ex, newLogoImage);
}
}
use of org.xdi.model.GluuImage in project oxTrust by GluuFederation.
the class CustomAttributeAction method savePhotos.
public void savePhotos() {
// Move added photos to persistent location
for (GluuImage image : addedPhotos) {
imageService.moveImageToPersistentStore(image);
}
addedPhotos.clear();
removeRemovedPhotos();
}
use of org.xdi.model.GluuImage in project oxTrust by GluuFederation.
the class CustomAttributeAction method setIconImageImpl.
private void setIconImageImpl(GluuCustomAttribute customAttribute, GluuImage image) {
GluuImage oldImage = imageService.getGluuImageFromXML(customAttribute.getValue());
if (oldImage != null) {
removedPhotos.add(oldImage);
}
customAttribute.setValue(imageService.getXMLFromGluuImage(image));
addedPhotos.add(image);
}
use of org.xdi.model.GluuImage 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