use of org.gluu.model.GluuAttribute in project oxTrust by GluuFederation.
the class TrustRelationshipInventoryAction method setCustomAttributes.
private void setCustomAttributes(List<GluuSAMLTrustRelationship> trustRelationships) {
List<GluuAttribute> attributes = attributeService.getAllPersonAttributes(GluuUserRole.ADMIN);
HashMap<String, GluuAttribute> attributesByDNs = attributeService.getAttributeMapByDNs(attributes);
for (GluuSAMLTrustRelationship trustRelationship : trustRelationships) {
trustRelationship.setReleasedCustomAttributes(attributeService.getCustomAttributesByAttributeDNs(trustRelationship.getReleasedAttributes(), attributesByDNs));
}
}
use of org.gluu.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.gluu.model.GluuAttribute in project oxTrust by GluuFederation.
the class UpdateAttributeAction method validateName.
public boolean validateName(String attributeName) {
GluuAttribute tmpAttribute = new GluuAttribute();
tmpAttribute.setBaseDn(attributeService.getDnForAttribute(null));
tmpAttribute.setName(attributeName);
if (attributeService.containsAttribute(tmpAttribute)) {
return false;
}
return true;
}
use of org.gluu.model.GluuAttribute in project oxTrust by GluuFederation.
the class PersonImportAction method getAttributesForImport.
private List<ImportAttribute> getAttributesForImport(Table table) {
List<ImportAttribute> importAttributes = new ArrayList<ImportAttribute>();
if ((table == null) || (table.getCountCols() < 1) || (table.getCountRows() < 1)) {
return importAttributes;
}
int cols = table.getCountCols();
List<String> addedAttributes = new ArrayList<String>(this.attributes.size());
for (int i = 0; i <= cols; i++) {
String cellValue = table.getCellValue(i, 0);
if (StringHelper.isEmpty(cellValue)) {
continue;
}
String attributeName = cellValue.toLowerCase();
GluuAttribute attribute = attributesDisplayNameMap.get(attributeName);
if (attribute != null) {
addedAttributes.add(attributeName);
ImportAttribute importAttribute = new ImportAttribute(i, attribute);
importAttributes.add(importAttribute);
}
}
for (GluuAttribute attribute : this.attributes) {
if (!addedAttributes.contains(attribute.getName())) {
ImportAttribute importAttribute = new ImportAttribute(-1, attribute);
importAttributes.add(importAttribute);
}
}
return importAttributes;
}
use of org.gluu.model.GluuAttribute in project oxTrust by GluuFederation.
the class RegistrationManagementAction method init.
public String init() {
customScriptTypes = new ArrayList<String>();
customScriptTypes.add(OxTrustConstants.INIT_REGISTRATION_SCRIPT);
customScriptTypes.add(OxTrustConstants.PRE_REGISTRATION_SCRIPT);
customScriptTypes.add(OxTrustConstants.POST_REGISTRATION_SCRIPT);
this.oxTrustappConfiguration = jsonConfigurationService.getOxTrustappConfiguration();
GluuOrganization org = organizationService.getOrganization();
RegistrationConfiguration config = org.getOxRegistrationConfiguration();
if (config != null) {
captchaDisabled = config.isCaptchaDisabled();
List<String> attributeList = config.getAdditionalAttributes();
if (attributeList != null && !attributeList.isEmpty()) {
configureRegistrationForm = true;
for (String attributeInum : attributeList) {
GluuAttribute attribute = attributeService.getAttributeByInum(attributeInum);
selectedAttributes.add(attribute);
attributes.add(attribute);
}
}
}
search();
return OxTrustConstants.RESULT_SUCCESS;
}
Aggregations