/** * Return a builder for creating a {@link FlowDefinitionRegistry} instance. * @return the created builder */ protected FlowDefinitionRegistryBuilder getFlowDefinitionRegistryBuilder() { return new FlowDefinitionRegistryBuilder(this.applicationContext); }
/** * Register a custom {@link FlowBuilder} instance with the given flow id. * @param builder the FlowBuilder to configure * @param id the id assign to the flow definition in this registry. * Specify when you wish to provide a custom flow definition identifier. */ public FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder, String id) { addFlowBuilder(builder, id, null); return this; }
/** * Register a flow defined at the following location as an .xml file. * This may be a path to a single resource or a ANT-style path expression that * matches multiple resources. * @param path the resource path to the externalized flow definition resource. */ public FlowDefinitionRegistryBuilder addFlowLocation(String path) { this.addFlowLocation(path, null, null); return this; }
private void registerFlowLocationPatterns(DefaultFlowRegistry flowRegistry) { for (String pattern : this.flowLocationPatterns) { AttributeMap<Object> attributes = new LocalAttributeMap<>(); updateFlowAttributes(attributes); FlowDefinitionResource[] resources; try { resources = this.flowResourceFactory.createResources(pattern, attributes); } catch (IOException e) { IllegalStateException ise = new IllegalStateException( "An I/O Exception occurred resolving the flow location pattern '" + pattern + "'"); ise.initCause(e); throw ise; } for (FlowDefinitionResource resource : resources) { registerFlow(resource, flowRegistry); } } }
@Bean public FlowDefinitionRegistry yubikeyFlowRegistry() { val builder = new FlowDefinitionRegistryBuilder(this.applicationContext, this.flowBuilderServices); builder.setBasePath("classpath*:/webflow"); builder.addFlowLocationPattern("/mfa-yubikey/*-webflow.xml"); return builder.build(); }
@Override public Flow buildFlow(final String location, final String id) { val builder = new FlowDefinitionRegistryBuilder(this.applicationContext, this.flowBuilderServices); builder.setParent(this.loginFlowDefinitionRegistry); builder.addFlowLocation(location, id); val registry = builder.build(); return (Flow) registry.getFlowDefinition(id); }
@Bean public FlowDefinitionRegistry flowRegistry() { Map<String, Object> flowAttributes = new HashMap<>(); flowAttributes.put("foo", "bar"); flowAttributes.put("bar", 2); return getFlowDefinitionRegistryBuilder().setParent(parentRegistry()) .addFlowLocation("org/springframework/webflow/config/flow.xml", "flow", flowAttributes) .addFlowLocation("/some/path/that/is/bogus.xml") .addFlowLocationPattern("org/springframework/webflow/config/flows/*.xml") .addFlowBuilder(new FooFlowBuilder()) .addFlowBuilder(new FooFlowBuilder(), "foo2") .addFlowBuilder(new FooFlowBuilder(), "foo3", flowAttributes) .build(); }
private FlowDefinitionRegistry createDuoFlowDefinitionRegistry(final DuoSecurityMultifactorProperties p, final DynamicFlowModelBuilder modelBuilder) { val holder = new DefaultFlowModelHolder(modelBuilder); val flowBuilder = new FlowModelFlowBuilder(holder); val builder = new FlowDefinitionRegistryBuilder(this.applicationContext, flowBuilderServices); builder.addFlowBuilder(flowBuilder, p.getId()); return builder.build(); }
@Bean public FlowDefinitionRegistry flowRegistry() { return getFlowDefinitionRegistryBuilder(flowBuilderServices()).setBasePath("classpath*:/templates") .addFlowLocationPattern("/**/*-flow.xml").build(); }
@Bean public FlowDefinitionRegistry parentRegistry() { return getFlowDefinitionRegistryBuilder() .addFlowLocation("org/springframework/webflow/config/flow.xml", "parentFlow") .build(); }
@Bean public FlowDefinitionRegistry logoutFlowRegistry() { val builder = new FlowDefinitionRegistryBuilder(this.applicationContext, builder()); builder.setBasePath(BASE_CLASSPATH_WEBFLOW); builder.addFlowLocationPattern("/logout/*-webflow.xml"); return builder.build(); }
@Bean public FlowDefinitionRegistry flowRegistry() { return getFlowDefinitionRegistryBuilder() .addFlowLocation("org/springframework/webflow/config/flow.xml").build(); }
private void registerFlowLocations(DefaultFlowRegistry flowRegistry) { for (FlowLocation location : this.flowLocations) { String path = location.getPath(); String id = location.getId(); AttributeMap<Object> attributes = location.getAttributes(); updateFlowAttributes(attributes); FlowDefinitionResource resource = this.flowResourceFactory.createResource(path, attributes, id); registerFlow(resource, flowRegistry); } }
@Bean public FlowDefinitionRegistry loginFlowRegistry() { val builder = new FlowDefinitionRegistryBuilder(this.applicationContext, builder()); builder.setBasePath(BASE_CLASSPATH_WEBFLOW); builder.addFlowLocationPattern("/login/*-webflow.xml"); return builder.build(); }
/** * Return a builder for creating a {@link FlowDefinitionRegistry} instance. * @param flowBuilderServices the {@link FlowBuilderServices} to configure on the flow registry with * @return the created builder */ protected FlowDefinitionRegistryBuilder getFlowDefinitionRegistryBuilder(FlowBuilderServices flowBuilderServices) { return new FlowDefinitionRegistryBuilder(this.applicationContext, flowBuilderServices); }
private void registerFlowLocationPatterns(DefaultFlowRegistry flowRegistry) { for (String pattern : this.flowLocationPatterns) { AttributeMap<Object> attributes = new LocalAttributeMap<>(); updateFlowAttributes(attributes); FlowDefinitionResource[] resources; try { resources = this.flowResourceFactory.createResources(pattern, attributes); } catch (IOException e) { IllegalStateException ise = new IllegalStateException( "An I/O Exception occurred resolving the flow location pattern '" + pattern + "'"); ise.initCause(e); throw ise; } for (FlowDefinitionResource resource : resources) { registerFlow(resource, flowRegistry); } } }
/** * Register a custom {@link FlowBuilder} instance. * @param builder the FlowBuilder to configure */ public FlowDefinitionRegistryBuilder addFlowBuilder(FlowBuilder builder) { addFlowBuilder(builder, null, null); return this; }
/** * Register a flow defined at the following location as an .xml file. * This may be a path to a single resource or a ANT-style path expression that * matches multiple resources. * @param path the resource path to the externalized flow definition resource. */ public FlowDefinitionRegistryBuilder addFlowLocation(String path) { this.addFlowLocation(path, null, null); return this; }
/** * Return a builder for creating a {@link FlowDefinitionRegistry} instance. * @return the created builder */ protected FlowDefinitionRegistryBuilder getFlowDefinitionRegistryBuilder() { return new FlowDefinitionRegistryBuilder(this.applicationContext); }
private void registerFlowLocations(DefaultFlowRegistry flowRegistry) { for (FlowLocation location : this.flowLocations) { String path = location.getPath(); String id = location.getId(); AttributeMap<Object> attributes = location.getAttributes(); updateFlowAttributes(attributes); FlowDefinitionResource resource = this.flowResourceFactory.createResource(path, attributes, id); registerFlow(resource, flowRegistry); } }