2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.dialog.scxml;
19
20 import javax.faces.context.FacesContext;
21
22 /***
23 * <p>{@link DialogStateMapper} is an interface describing a pluggable
24 * mechanism to map between the state ID within a SCXML dialog definition
25 * and the corresponding JavaServer Faces <em>view identifier</em>
26 * that should be rendered when the dialog state machine comes to rest in
27 * that state.</p>
28 *
29 * <p>By default, an identity transform is applied i.e. the
30 * JavaServer Faces <code>view identifier</code> used is the same as
31 * the dialog state identifier.</p>
32 *
33 * <p>The default behavior can be changed by replacing the application
34 * scoped bean at key {@link Globals#STATE_MAPPER}. The replacement
35 * must implement {@link DialogStateMapper}.</p>
36 *
37 * @since 1.0.4
38 *
39 * $Id: DialogStateMapper.java 469656 2006-10-31 21:18:18Z rahul $
40 */
41 public interface DialogStateMapper {
42
43 /***
44 * <p>Return the JavaServer Faces <code>view identifier</code> that
45 * corresponds to current dialog state. The current {@link FacesContext}
46 * instance is also available so developers can consult pertinent
47 * information such as user role, current locale, user agent making
48 * the request etc. to map the state identifier to the view
49 * identifier, if needed.</p>
50 *
51 * @param dialogName The logical name of the dialog this state belongs to
52 * @param stateId The state identifier for the current dialog state
53 * @param context The current {@link FacesContext}
54 * @return The JavaServer Faces <code>view identifier</code> that should
55 * be rendered
56 */
57 public String mapStateId(String dialogName, String stateId,
58 FacesContext context);
59
60 }
61