1 /**
2 * - Digitalis Internal Framework v2.0 - (C) 2007, Digitalis Informatica. Distribuicao e Gestao de Informatica, Lda.
3 * Estrada de Paco de Arcos num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999
4 * http://www.digitalis.pt
5 */
6 package pt.digitalis.dif.dem.interfaces;
7
8 import java.util.List;
9 import java.util.Map;
10
11 import pt.digitalis.dif.dem.objects.EventType;
12 import pt.digitalis.dif.dem.objects.ViewObject;
13 import pt.digitalis.dif.dem.objects.parameters.IParameters;
14
15 /**
16 * This interface represents a Stage entity on the DEM.
17 * <p>
18 * A Stage is related to a Service.
19 *
20 * @author Pedro Viegas <a href="mailto:pviegas@digitalis.pt">pviegas@digitalis.pt</a>
21 * @author Rodrigo Gonçalves <a href="mailto:rgoncalves@digitalis.pt">rgoncalves@digitalis.pt</a>
22 * @created 2007/07/12
23 */
24 public interface IStage extends IEntity, ICallback, IRegistrable {
25
26 /**
27 * Returns the default error Stage defined for this Stage
28 *
29 * @return the default error Stage
30 */
31 public IStage getDefaultErrorStage();
32
33 /**
34 * Returns the default error view defined for this Stage.
35 *
36 * @return the default error view
37 */
38 public ViewObject getDefaultErrorView();
39
40 /**
41 * Returns the default view.
42 *
43 * @return the default view
44 */
45 public ViewObject getDefaultView();
46
47 /**
48 * Returns the list of all the Stages submit handlers.
49 *
50 * @return the list
51 */
52 public Map<EventType, List<String>> getEventHandlers();
53
54 /**
55 * Returns the list of all the error Stages injected in this Stage.
56 *
57 * @return the list of all the injected Stages
58 */
59 public Map<String, String> getInjectedErrorStages();
60
61 /**
62 * Returns the list of all the error views injected in this Stage.
63 *
64 * @return the list of all the injected ViewObject
65 */
66 public Map<String, ViewObject> getInjectedErrorViews();
67
68 /**
69 * Returns the list of all the Stages injected in this Stage.
70 *
71 * @return the list of all the injected Stages
72 */
73 public List<String> getInjectedStages();
74
75 /**
76 * Returns the list of all the views injected in this Stage.
77 *
78 * @return the list of all the injected ViewObject
79 */
80 public List<ViewObject> getInjectedViews();
81
82 /**
83 * Return an instance of the stage for execution
84 *
85 * @return the stage instance
86 */
87 public IStageInstance getInstance();
88
89 /**
90 * Returns a message associated with a given ID
91 *
92 * @param language
93 * the language to get the messages in
94 * @param messageID
95 * the message ID
96 * @return the message with the given id
97 */
98 public String getMessageForLanguage(String language, String messageID);
99
100 /**
101 * Returns all messages associated with the Entity.
102 *
103 * @param language
104 * the language to get the messages in
105 * @return a map with all the messages related to the Entity
106 */
107 public Map<String, String> getMessagesForLanguage(String language);
108
109 /**
110 * @return the stage id of the stage that the present one overrides. Null otherwise.
111 */
112 public String getOverridesStageID();
113
114 /**
115 * Returns the parameters for the current stage
116 *
117 * @return the parameters
118 */
119 public IParameters getParameters();
120
121 /**
122 * Returns the Stage service.
123 *
124 * @return the Stage service
125 */
126 public IService getService();
127
128 /**
129 * Obtains the original stage class name
130 *
131 * @return the class name
132 */
133 public String getStageInstanceClassName();
134
135 /**
136 * Defines if the stage has authentication.
137 *
138 * @return T if the stage has , F otherwise
139 */
140 public boolean hasAuthentication();
141
142 /**
143 * Registers if the stage has injected the authentication errors. If so the dispatcher will not fail on
144 * authentication errors and instead inject them so the stage may process them.
145 *
146 * @return T if the stage has injected the authentication errors onto an attribute
147 */
148 public boolean hasAuthenticationErrorInjection();
149
150 /**
151 * Defines if the stage has authorization.
152 *
153 * @return T if the stage has , F otherwise
154 */
155 public boolean hasAuthorization();
156
157 /**
158 * @return T if any attribute or method in annotated with {@link com.google.inject.Inject}
159 */
160 public boolean hasInjectedContributions();
161
162 /**
163 * Registers if the stage has injected the parameter errors. If not the framework must provide extra reporting of
164 * the errors. Else it is delegated to the business stage implementation.
165 *
166 * @return T if the stage has injected the errors onto an attribute
167 */
168 public boolean hasParameterErrorInjection();
169
170 /**
171 * Checks if the current form has a validation logic handler for the given form
172 *
173 * @param formName
174 * the form name
175 * @return T if present
176 */
177 public boolean hasValidationLogicForForm(String formName);
178 }