Search in sources :

Example 1 with RegistrationInterceptorScript

use of org.gluu.oxtrust.model.RegistrationInterceptorScript in project oxTrust by GluuFederation.

the class RegistrationInterceptionService method runPostRegistrationScripts.

public boolean runPostRegistrationScripts(GluuCustomPerson person, Map<String, String[]> requestParameters) {
    GluuOrganization org = organizationService.getOrganization();
    RegistrationConfiguration config = org.getOxRegistrationConfiguration();
    if (config != null && config.isRegistrationInterceptorsConfigured()) {
        List<RegistrationInterceptorScript> scripts = config.getRegistrationInterceptorScripts();
        List<RegistrationInterceptorScript> sortedEnabledPostRegistrationScripts = sort(getActive(getPostRegistrationScripts(scripts)));
        if (sortedEnabledPostRegistrationScripts != null) {
            boolean result = true;
            for (RegistrationInterceptorScript script : sortedEnabledPostRegistrationScripts) {
                RegistrationScript registrationScript = createRegistrationScriptFromStringWithPythonException(script);
                result &= registrationScript.execute(script.getCustomAttributes(), person, requestParameters);
            }
            return result;
        } else {
            return true;
        }
    } else {
        return true;
    }
}
Also used : RegistrationScript(org.gluu.oxtrust.service.python.interfaces.RegistrationScript) RegistrationInterceptorScript(org.gluu.oxtrust.model.RegistrationInterceptorScript) RegistrationConfiguration(org.gluu.oxtrust.model.RegistrationConfiguration) GluuOrganization(org.gluu.oxtrust.model.GluuOrganization)

Example 2 with RegistrationInterceptorScript

use of org.gluu.oxtrust.model.RegistrationInterceptorScript in project oxTrust by GluuFederation.

the class RegistrationInterceptionService method runPreRegistrationScripts.

public boolean runPreRegistrationScripts(GluuCustomPerson person, Map<String, String[]> requestParameters) {
    GluuOrganization org = organizationService.getOrganization();
    RegistrationConfiguration config = org.getOxRegistrationConfiguration();
    if (config != null && config.isRegistrationInterceptorsConfigured()) {
        List<RegistrationInterceptorScript> scripts = config.getRegistrationInterceptorScripts();
        List<RegistrationInterceptorScript> sortedEnabledPreRegistrationScripts = sort(getActive(getPreRegistrationScripts(scripts)));
        if (sortedEnabledPreRegistrationScripts != null) {
            boolean result = true;
            for (RegistrationInterceptorScript script : sortedEnabledPreRegistrationScripts) {
                RegistrationScript registrationScript = createRegistrationScriptFromStringWithPythonException(script);
                result &= registrationScript.execute(script.getCustomAttributes(), person, requestParameters);
            }
            return result;
        } else {
            return true;
        }
    } else {
        return true;
    }
}
Also used : RegistrationScript(org.gluu.oxtrust.service.python.interfaces.RegistrationScript) RegistrationInterceptorScript(org.gluu.oxtrust.model.RegistrationInterceptorScript) RegistrationConfiguration(org.gluu.oxtrust.model.RegistrationConfiguration) GluuOrganization(org.gluu.oxtrust.model.GluuOrganization)

Example 3 with RegistrationInterceptorScript

use of org.gluu.oxtrust.model.RegistrationInterceptorScript in project oxTrust by GluuFederation.

the class RegistrationInterceptionService method runInitRegistrationScripts.

public boolean runInitRegistrationScripts(GluuCustomPerson person, Map<String, String[]> requestParameters) {
    GluuOrganization org = organizationService.getOrganization();
    RegistrationConfiguration config = org.getOxRegistrationConfiguration();
    if (config != null && config.isRegistrationInterceptorsConfigured()) {
        List<RegistrationInterceptorScript> scripts = config.getRegistrationInterceptorScripts();
        List<RegistrationInterceptorScript> sortedEnabledInitRegistrationScripts = sort(getActive(getInitRegistrationScripts(scripts)));
        if (sortedEnabledInitRegistrationScripts != null) {
            boolean result = true;
            for (RegistrationInterceptorScript script : sortedEnabledInitRegistrationScripts) {
                RegistrationScript registrationScript = createRegistrationScriptFromStringWithPythonException(script);
                result &= registrationScript.execute(script.getCustomAttributes(), person, requestParameters);
            }
            return result;
        } else {
            return true;
        }
    } else {
        return true;
    }
}
Also used : RegistrationScript(org.gluu.oxtrust.service.python.interfaces.RegistrationScript) RegistrationInterceptorScript(org.gluu.oxtrust.model.RegistrationInterceptorScript) RegistrationConfiguration(org.gluu.oxtrust.model.RegistrationConfiguration) GluuOrganization(org.gluu.oxtrust.model.GluuOrganization)

Example 4 with RegistrationInterceptorScript

use of org.gluu.oxtrust.model.RegistrationInterceptorScript in project oxTrust by GluuFederation.

the class RegistrationManagementAction method addRegistrationInterceptor.

public String addRegistrationInterceptor() {
    RegistrationInterceptorScript registrationScript = new RegistrationInterceptorScript();
    registrationInterceptors.add(registrationScript);
    return OxTrustConstants.RESULT_SUCCESS;
}
Also used : RegistrationInterceptorScript(org.gluu.oxtrust.model.RegistrationInterceptorScript)

Aggregations

RegistrationInterceptorScript (org.gluu.oxtrust.model.RegistrationInterceptorScript)4 GluuOrganization (org.gluu.oxtrust.model.GluuOrganization)3 RegistrationConfiguration (org.gluu.oxtrust.model.RegistrationConfiguration)3 RegistrationScript (org.gluu.oxtrust.service.python.interfaces.RegistrationScript)3