Search in sources :

Example 41 with GluuAttribute

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));
    }
}
Also used : GluuSAMLTrustRelationship(org.gluu.oxtrust.model.GluuSAMLTrustRelationship) GluuAttribute(org.gluu.model.GluuAttribute)

Example 42 with GluuAttribute

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);
    }
}
Also used : GluuSAMLTrustRelationship(org.gluu.oxtrust.model.GluuSAMLTrustRelationship) GluuAttribute(org.gluu.model.GluuAttribute)

Example 43 with GluuAttribute

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;
}
Also used : GluuAttribute(org.gluu.model.GluuAttribute)

Example 44 with GluuAttribute

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;
}
Also used : ArrayList(java.util.ArrayList) GluuAttribute(org.gluu.model.GluuAttribute)

Example 45 with GluuAttribute

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;
}
Also used : RegistrationConfiguration(org.gluu.oxtrust.model.RegistrationConfiguration) GluuOrganization(org.gluu.oxtrust.model.GluuOrganization) GluuAttribute(org.gluu.model.GluuAttribute)

Aggregations

GluuAttribute (org.gluu.model.GluuAttribute)68 ArrayList (java.util.ArrayList)21 GluuCustomAttribute (org.gluu.oxtrust.model.GluuCustomAttribute)10 IOException (java.io.IOException)8 Scope (org.oxauth.persistence.model.Scope)8 HttpEntity (org.apache.http.HttpEntity)7 HttpResponse (org.apache.http.HttpResponse)7 ParseException (org.apache.http.ParseException)7 Test (org.junit.Test)7 HttpGet (org.apache.http.client.methods.HttpGet)6 HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)6 Filter (org.gluu.search.filter.Filter)5 JSONObject (org.json.JSONObject)4 Operation (io.swagger.v3.oas.annotations.Operation)3 ApiResponses (io.swagger.v3.oas.annotations.responses.ApiResponses)3 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 FacesMessage (javax.faces.application.FacesMessage)3 UIInput (javax.faces.component.UIInput)3 AttributeValidation (org.gluu.model.attribute.AttributeValidation)3