|
| 1 | +package io.cos.cas.osf.web.flow.configurer; |
| 2 | + |
| 3 | +import io.cos.cas.osf.web.flow.support.OsfCasWebflowConstants; |
| 4 | + |
| 5 | +import org.apereo.cas.configuration.CasConfigurationProperties; |
| 6 | +import org.apereo.cas.web.flow.configurer.DefaultLogoutWebflowConfigurer; |
| 7 | + |
| 8 | +import org.springframework.context.ConfigurableApplicationContext; |
| 9 | +import org.springframework.webflow.definition.registry.FlowDefinitionRegistry; |
| 10 | +import org.springframework.webflow.engine.ActionList; |
| 11 | +import org.springframework.webflow.engine.Flow; |
| 12 | +import org.springframework.webflow.engine.builder.support.FlowBuilderServices; |
| 13 | + |
| 14 | +/** |
| 15 | + * This is {@link OsfCasLogoutWebFlowConfigurer}. |
| 16 | + * |
| 17 | + * @author Longze Chen |
| 18 | + * @since 20.2.0 |
| 19 | + */ |
| 20 | +public class OsfCasLogoutWebFlowConfigurer extends DefaultLogoutWebflowConfigurer { |
| 21 | + |
| 22 | + public OsfCasLogoutWebFlowConfigurer( |
| 23 | + final FlowBuilderServices flowBuilderServices, |
| 24 | + final FlowDefinitionRegistry flowDefinitionRegistry, |
| 25 | + final ConfigurableApplicationContext applicationContext, |
| 26 | + final CasConfigurationProperties casProperties |
| 27 | + ) { |
| 28 | + super(flowBuilderServices, flowDefinitionRegistry, applicationContext, casProperties); |
| 29 | + } |
| 30 | + |
| 31 | + @Override |
| 32 | + protected void doInitialize() { |
| 33 | + final Flow flow = getLogoutFlow(); |
| 34 | + if (flow != null) { |
| 35 | + createInitialFlowActions(flow); |
| 36 | + } |
| 37 | + super.doInitialize(); |
| 38 | + } |
| 39 | + |
| 40 | + /** |
| 41 | + * Create initial flow actions similar to {@link OsfCasLoginWebflowConfigurer#createInitialFlowActions(Flow)}. |
| 42 | + * |
| 43 | + * @param flow the flow |
| 44 | + */ |
| 45 | + protected void createInitialFlowActions(final Flow flow) { |
| 46 | + final ActionList startActionList = flow.getStartActionList(); |
| 47 | + startActionList.add(createEvaluateAction(OsfCasWebflowConstants.ACTION_ID_OSF_PRE_INITIAL_FLOW_SETUP)); |
| 48 | + } |
| 49 | +} |
0 commit comments