All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apereo.cas.acct.webflow.LoadAccountRegistrationPropertiesAction Maven / Gradle / Ivy

There is a newer version: 7.2.0-RC3
Show newest version
package org.apereo.cas.acct.webflow;

import org.apereo.cas.acct.AccountRegistrationProperty;
import org.apereo.cas.acct.AccountRegistrationService;
import org.apereo.cas.web.flow.actions.BaseCasWebflowAction;

import lombok.RequiredArgsConstructor;
import lombok.val;
import org.springframework.webflow.execution.Event;
import org.springframework.webflow.execution.RequestContext;

import java.util.Comparator;
import java.util.stream.Collectors;

/**
 * This is {@link LoadAccountRegistrationPropertiesAction}.
 *
 * @author Misagh Moayyed
 * @since 6.5.0
 */
@RequiredArgsConstructor
public class LoadAccountRegistrationPropertiesAction extends BaseCasWebflowAction {
    private final AccountRegistrationService accountRegistrationService;

    @Override
    protected Event doExecuteInternal(final RequestContext requestContext) {
        val properties = accountRegistrationService.getAccountRegistrationPropertyLoader().load();
        requestContext.getFlowScope().put("registrationProperties", properties
            .values()
            .stream()
            .sorted(Comparator.comparing(AccountRegistrationProperty::getOrder))
            .collect(Collectors.toList()));
        return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy