use of org.xdi.model.GluuAttribute in project oxTrust by GluuFederation.
the class WhitePagesAction method getReleasedAttributes.
public List<GluuCustomAttribute> getReleasedAttributes(GluuCustomPerson person) {
if (person == null) {
return Arrays.asList(new GluuCustomAttribute[0]);
}
List<GluuCustomAttribute> releasedAttributes = new ArrayList<GluuCustomAttribute>();
for (GluuCustomAttribute attribute : person.getCustomAttributes()) {
List<GluuAttribute> attributes = attributeService.getAllPersonAttributes(GluuUserRole.USER);
GluuAttribute metadata = attributeService.getAttributeByName(attribute.getName(), attributes);
if (metadata != null && metadata.isWhitePagesCanView() && !tableAttributes.contains(attribute.getName())) {
attribute.setMetadata(metadata);
releasedAttributes.add(attribute);
}
}
return releasedAttributes;
}
use of org.xdi.model.GluuAttribute in project oxTrust by GluuFederation.
the class UpdateTrustRelationshipAction method initFederatedSites.
private void initFederatedSites(GluuSAMLTrustRelationship trustRelationship) {
List<GluuAttribute> attributes = getAllAttributes();
this.federatedSites = new ArrayList<GluuSAMLTrustRelationship>();
for (GluuSAMLTrustRelationship deconstructedTrustRelationship : trustService.getDeconstructedTrustRelationships(trustRelationship)) {
initTrustRelationship(deconstructedTrustRelationship, attributes);
this.federatedSites.add(deconstructedTrustRelationship);
}
}
use of org.xdi.model.GluuAttribute in project oxTrust by GluuFederation.
the class WhitePagesAction method getPhotoThumbData.
public byte[] getPhotoThumbData(GluuCustomPerson person) {
List<GluuAttribute> attributes = attributeService.getAllPersonAttributes(GluuUserRole.USER);
GluuAttribute photoAttribute = attributeService.getAttributeByName(PHOTO_NAME, attributes);
GluuCustomAttribute customAttribute = new GluuCustomAttribute(PHOTO_NAME, person.getAttribute(PHOTO_NAME));
customAttribute.setMetadata(photoAttribute);
GluuImage image = imageService.getImage(customAttribute);
if (image == null || (person.getGluuOptOuts() != null && person.getGluuOptOuts().contains(PHOTO_NAME))) {
return imageService.getBlankPhotoData();
}
return imageService.getThumImageData(image);
}
use of org.xdi.model.GluuAttribute in project oxTrust by GluuFederation.
the class ImportPersonConfiguration method createAttributeFromConfig.
private GluuAttribute createAttributeFromConfig(ImportPerson importPerson) {
String attributeName = importPerson.getLdapName();
String displayName = importPerson.getDisplayName();
String dataType = importPerson.getDataType();
boolean required = importPerson.getRequired();
if (StringHelper.isNotEmpty(attributeName) && StringHelper.isNotEmpty(displayName) && StringHelper.isNotEmpty(dataType)) {
GluuAttributeDataType attributeDataType = GluuAttributeDataType.getByValue(dataType);
if (attributeDataType != null) {
GluuAttribute attr = new GluuAttribute();
attr.setName(attributeName);
attr.setDisplayName(displayName);
attr.setDataType(attributeDataType);
attr.setRequred(required);
return attr;
}
}
return null;
}
use of org.xdi.model.GluuAttribute in project oxTrust by GluuFederation.
the class ImportPersonConfiguration method createAttributeFromConfig.
private GluuAttribute createAttributeFromConfig(String prefix) {
String attributeName = importConfiguration.getString(prefix + ATTRIBUTE_LDAP_NAME_SUFFIX, null);
String displayName = importConfiguration.getString(prefix + ATTRIBUTE_DISPLAY_NAME_SUFFIX, null);
String dataType = importConfiguration.getString(prefix + ATTRIBUTE_DATA_TYPE_SUFFIX, null);
boolean required = importConfiguration.getBoolean(prefix + ATTRIBUTE_DATA_REQUIRED_SUFFIX, false);
if (StringHelper.isNotEmpty(attributeName) && StringHelper.isNotEmpty(displayName) && StringHelper.isNotEmpty(dataType)) {
GluuAttributeDataType attributeDataType = GluuAttributeDataType.getByValue(dataType);
if (attributeDataType != null) {
GluuAttribute attr = new GluuAttribute();
attr.setName(attributeName);
attr.setDisplayName(displayName);
attr.setDataType(attributeDataType);
attr.setRequred(required);
return attr;
}
}
return null;
}
Aggregations