01: /**
02: * Title: OpenUSS - Open Source University Support System
03: * My Piggy Bank Example
04: * Description: Enhydra Presentation Object
05: * Copyright: Copyright (c) 2003 by B. Lofi Dewanto, T. Menzel
06: * Company: University of Muenster, HTWK Leipzig
07: * @author B. Lofi Dewanto, T. Menzel
08: * @version 1.1
09: */package net.sourceforge.ejosa.piggybank.presentation.enhydra;
10:
11: import java.util.*;
12:
13: import org.openuss.presentation.enhydra.framework.*;
14:
15: /**
16: * The base session object for foundation components.
17: *
18: * @author B. Lofi Dewanto, T. Menzel
19: * @version 1.1
20: */
21: public class FoundationSessionData extends BaseSessionData {
22: /**
23: * Session key for foundation components.
24: */
25: public static final String SESSION_KEY = "FoundationSessionData";
26:
27: /**
28: * Data for the base session.
29: */
30:
31: // English and USA are the standard locale
32: protected Locale myLocale = new Locale("en", "US");
33: protected String userMessage = null;
34:
35: /**
36: * Sets the locale.
37: */
38: public void setLocale(Locale locale) {
39: this .myLocale = locale;
40: }
41:
42: /**
43: * Gets the locale.
44: */
45: public Locale getLocale() {
46: return this .myLocale;
47: }
48:
49: /**
50: * Set the message.
51: * This should be used for a short use.
52: */
53: public void setUserMessage(String msg) {
54: this .userMessage = msg;
55: }
56:
57: /**
58: * Retrieve the most recent user message and then clear it so no
59: * other app tries to use it.
60: * This should be used for a short use.
61: */
62: public String getAndClearUserMessage() {
63: String msg = this.userMessage;
64: this.userMessage = null;
65:
66: return msg;
67: }
68: }
|