01: /*
02: * Created on 10-Feb-2006
03: */
04: package uk.org.ponder.rsf.flow.jsfnav;
05:
06: import uk.org.ponder.rsf.flow.ARIResult;
07: import uk.org.ponder.rsf.viewstate.AnyViewParameters;
08:
09: /**
10: * Summarises a single "navigation case", a static rule mapping from the return
11: * value of an RSF Action into the ViewParameters to be navigated to. Used by
12: * the "JSF Navigation Style" ActionResultInterpreter,
13: * {@link uk.org.ponder.rsf.flow.jsfnav.JSFNavActionResultInterpreter}.
14: *
15: * This has been extended from the JSF model to include a single extra field,
16: * the "flow condition marker" which determines flow propagation state of parts
17: * of the bean model marked as managed by a
18: * {@link uk.org.ponder.rsf.preservation.StatePreservationStrategy}.
19: *
20: * @author Antranig Basman (antranig@caret.cam.ac.uk)
21: *
22: */
23: public class NavigationCase {
24: public NavigationCase() {
25: }
26:
27: /** A default NavigationCase which operates for any action return. This rule
28: * will navigate to the state specified by <code>resultingView</code> **/
29: public NavigationCase(AnyViewParameters resultingView) {
30: this .resultingView = resultingView;
31: }
32:
33: public NavigationCase(AnyViewParameters resultingView,
34: String flowCondition) {
35: this .resultingView = resultingView;
36: this .flowCondition = flowCondition;
37: }
38:
39: /** A NavigationCase which triggers only on a particular outcome (action return) */
40: public NavigationCase(String fromOutcome,
41: AnyViewParameters resultingView) {
42: this .fromOutcome = fromOutcome;
43: this .resultingView = resultingView;
44: }
45:
46: public NavigationCase(String fromOutcome,
47: AnyViewParameters resultingView, String flowCondition) {
48: this .fromOutcome = fromOutcome;
49: this .resultingView = resultingView;
50: this .flowCondition = flowCondition;
51: }
52:
53: /** The return value from the method binding executed for this action
54: * which matches this rule. If <code>fromOutcome</code> is left blank, this
55: * rule will operate for all actions handled for this view.
56: */
57: public String fromOutcome;
58: /** Final navigation state that this rule will cause navigation to if it is
59: * selected.
60: */
61: public AnyViewParameters resultingView;
62: /** A "Flow condition marker" for this navigation rule. This is set if this
63: * navigation rule is considered to be part of an "informal flow".
64: * Defaults to {@link uk.org.ponder.rsf.flow.ARIResult}.FLOW_END representing
65: * no flow state or termination of any existing flow. Set to FLOW_START,
66: * PROPAGATE or FLOW_ONESTEP for other flow behaviour.
67: */
68: public String flowCondition = ARIResult.FLOW_END;
69:
70: }
|