Search in sources :

Example 1 with SelectableEntity

use of org.xdi.model.SelectableEntity in project oxTrust by GluuFederation.

the class UpdateClientAction method searchAvailableResponseTypes.

public void searchAvailableResponseTypes() {
    if (this.availableResponseTypes != null) {
        selectAddedResponseTypes();
        return;
    }
    List<SelectableEntity<ResponseType>> tmpAvailableResponseTypes = new ArrayList<SelectableEntity<ResponseType>>();
    for (ResponseType responseType : ResponseType.values()) {
        tmpAvailableResponseTypes.add(new SelectableEntity<ResponseType>(responseType));
    }
    this.availableResponseTypes = tmpAvailableResponseTypes;
    selectAddedResponseTypes();
}
Also used : SelectableEntity(org.xdi.model.SelectableEntity) ResponseType(org.xdi.oxauth.model.common.ResponseType)

Example 2 with SelectableEntity

use of org.xdi.model.SelectableEntity in project oxTrust by GluuFederation.

the class UpdateScopeAction method searchAvailableDynamicScripts.

public void searchAvailableDynamicScripts() {
    if (this.availableDynamicScripts != null) {
        selectAddedDynamicScripts();
        return;
    }
    try {
        List<CustomScript> availableScripts = customScriptService.findCustomScripts(Arrays.asList(CustomScriptType.DYNAMIC_SCOPE), CUSTOM_SCRIPT_RETURN_ATTRIBUTES);
        List<SelectableEntity<CustomScript>> tmpAvailableDynamicScripts = new ArrayList<SelectableEntity<CustomScript>>();
        for (CustomScript dynamicScript : availableScripts) {
            if (dynamicScript.isEnabled()) {
                tmpAvailableDynamicScripts.add(new SelectableEntity<CustomScript>(dynamicScript));
            }
        }
        this.availableDynamicScripts = tmpAvailableDynamicScripts;
        selectAddedDynamicScripts();
    } catch (LdapMappingException ex) {
        log.error("Failed to find available authorization policies", ex);
    }
}
Also used : CustomScript(org.xdi.model.custom.script.model.CustomScript) SelectableEntity(org.xdi.model.SelectableEntity) LdapMappingException(org.gluu.site.ldap.persistence.exception.LdapMappingException) ArrayList(java.util.ArrayList)

Example 3 with SelectableEntity

use of org.xdi.model.SelectableEntity in project oxTrust by GluuFederation.

the class UpdateScopeDescriptionAction method searchAvailableAuthorizationPolicies.

public void searchAvailableAuthorizationPolicies() {
    if (this.availableAuthorizationPolicies != null) {
        selectAddedAuthorizationPolicies();
        return;
    }
    try {
        List<CustomScript> availableScripts = customScriptService.findCustomScripts(Arrays.asList(CustomScriptType.UMA_AUTHORIZATION_POLICY), CUSTOM_SCRIPT_RETURN_ATTRIBUTES);
        List<SelectableEntity<CustomScript>> tmpAvailableAuthorizationPolicies = new ArrayList<SelectableEntity<CustomScript>>();
        for (CustomScript authorizationPolicy : availableScripts) {
            tmpAvailableAuthorizationPolicies.add(new SelectableEntity<CustomScript>(authorizationPolicy));
        }
        this.availableAuthorizationPolicies = tmpAvailableAuthorizationPolicies;
        selectAddedAuthorizationPolicies();
    } catch (LdapMappingException ex) {
        log.error("Failed to find available authorization policies", ex);
    }
}
Also used : CustomScript(org.xdi.model.custom.script.model.CustomScript) SelectableEntity(org.xdi.model.SelectableEntity) LdapMappingException(org.gluu.site.ldap.persistence.exception.LdapMappingException) ArrayList(java.util.ArrayList)

Aggregations

SelectableEntity (org.xdi.model.SelectableEntity)3 ArrayList (java.util.ArrayList)2 LdapMappingException (org.gluu.site.ldap.persistence.exception.LdapMappingException)2 CustomScript (org.xdi.model.custom.script.model.CustomScript)2 ResponseType (org.xdi.oxauth.model.common.ResponseType)1