swf-1095
This commit is contained in:
@@ -10,6 +10,7 @@ Bug Fixes
|
||||
* Fixed bug where subclasses of FacesMessage we do not control could introduce dependencies on JSF-specific services outside of Web Flow's control (SWF-1073)
|
||||
This specifically caused problems with Rich Faces 3.3.0's messages component, which adds a LabeledFacesMessage that requires a FacesContext to be serialized.
|
||||
* Fixed bug where a FlowExecution's flashScope and MessageContext were not cleared when a user had already completed a render response (SWF-1089).
|
||||
* Fixed bug where FlowHandlerMapping was not querying parent flow registries when determining if a flow should handle the current request (SWF-1095).
|
||||
|
||||
Improvements
|
||||
* Added org.springframework.webflow dm Server library definition for use in a dm Server deployment environment (SWF-1067)
|
||||
|
||||
@@ -41,11 +41,20 @@ public interface FlowDefinitionRegistry extends FlowDefinitionLocator {
|
||||
public String[] getFlowDefinitionIds();
|
||||
|
||||
/**
|
||||
* Returns this registry'es parent registry.
|
||||
* Returns this registry's parent registry.
|
||||
* @return the parent flow definition registry, or null if no parent is set
|
||||
*/
|
||||
public FlowDefinitionRegistry getParent();
|
||||
|
||||
/**
|
||||
* Does this registry contain a flow with the given id? More specifically, is {@link #getFlowDefinition(String)}
|
||||
* able to obtain a flow definition instance for the given id? Will ask the parent registry if the flow cannot be
|
||||
* found in this instance.
|
||||
* @param flowId the id of the flow to query
|
||||
* @return whether a flow definition with the given id is registered
|
||||
*/
|
||||
public boolean containsFlowDefinition(String flowId);
|
||||
|
||||
/**
|
||||
* Sets this registry's parent registry. When asked by a client to locate a flow definition this registry will query
|
||||
* it's parent if it cannot fulfill the lookup request itself.
|
||||
@@ -67,6 +76,4 @@ public interface FlowDefinitionRegistry extends FlowDefinitionLocator {
|
||||
*/
|
||||
public void registerFlowDefinition(FlowDefinition definition);
|
||||
|
||||
public boolean containsFlowDefinition(String flowId);
|
||||
|
||||
}
|
||||
@@ -71,7 +71,11 @@ public class FlowDefinitionRegistryImpl implements FlowDefinitionRegistry {
|
||||
// implementing FlowDefinitionRegistry
|
||||
|
||||
public boolean containsFlowDefinition(String flowId) {
|
||||
return flowDefinitions.containsKey(flowId);
|
||||
boolean containsFlow = flowDefinitions.containsKey(flowId);
|
||||
if (!containsFlow && parent != null) {
|
||||
containsFlow = parent.containsFlowDefinition(flowId);
|
||||
}
|
||||
return containsFlow;
|
||||
}
|
||||
|
||||
public int getFlowDefinitionCount() {
|
||||
|
||||
@@ -67,6 +67,7 @@ public class FlowDefinitionRegistryImplTests extends TestCase {
|
||||
|
||||
public void testRegisterFlow() {
|
||||
registry.registerFlowDefinition(new StaticFlowDefinitionHolder(fooFlow));
|
||||
assertTrue(registry.containsFlowDefinition("foo"));
|
||||
assertEquals(fooFlow, registry.getFlowDefinition("foo"));
|
||||
}
|
||||
|
||||
@@ -87,6 +88,8 @@ public class FlowDefinitionRegistryImplTests extends TestCase {
|
||||
public void testRegisterMultipleFlows() {
|
||||
registry.registerFlowDefinition(new StaticFlowDefinitionHolder(fooFlow));
|
||||
registry.registerFlowDefinition(new StaticFlowDefinitionHolder(barFlow));
|
||||
assertTrue(registry.containsFlowDefinition("foo"));
|
||||
assertTrue(registry.containsFlowDefinition("bar"));
|
||||
assertEquals(fooFlow, registry.getFlowDefinition("foo"));
|
||||
assertEquals(barFlow, registry.getFlowDefinition("bar"));
|
||||
}
|
||||
@@ -97,6 +100,8 @@ public class FlowDefinitionRegistryImplTests extends TestCase {
|
||||
child.setParent(registry);
|
||||
FooFlow fooFlow = new FooFlow();
|
||||
child.registerFlowDefinition(new StaticFlowDefinitionHolder(fooFlow));
|
||||
assertTrue(child.containsFlowDefinition("foo"));
|
||||
assertTrue(child.containsFlowDefinition("bar"));
|
||||
assertSame(fooFlow, child.getFlowDefinition("foo"));
|
||||
assertEquals(barFlow, child.getFlowDefinition("bar"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user