source: vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloSession.java @ 4232

Last change on this file since 4232 was 4232, checked in by keeloo, 10 years ago

Removed VloPageParameters? class. ResourceLinkPanel? test is failing.

File size: 1.8 KB
Line 
1
2package eu.clarin.cmdi.vlo;
3
4import org.apache.wicket.protocol.http.WebSession;
5import org.apache.wicket.request.Request;
6import org.apache.wicket.request.mapper.parameter.PageParameters;
7
8/**
9 * A web session containing a VLO theme and parameters that are considered to
10 * be persistent in a VLO session.
11 *
12 * Note that these parameters can include the specification of the theme.
13 *
14 * @author keeloo
15 */
16public class VloSession extends WebSession {
17
18    // remember the parameters that need to persist in URLs to VLO pages in this session
19    public PageParameters vloSessionPageParameters = new PageParameters();
20
21    // remember this session's theme
22    private Theme currentTheme = new Theme("defaultTheme");
23
24    /**
25     * Construct a session object with a request parameter
26     *
27     * @param request
28     */
29    public VloSession(Request request) {
30        // only the parameterless constructors are invoked implicitly
31        super(request);
32    }
33
34    /**
35     * Get the session's theme
36     *
37     * @return the session's theme
38     */
39    public Theme getCurrentTheme() {
40        return this.currentTheme;
41    }
42
43    /**
44     * Set the session's theme
45     *
46     * @param theme the session's theme
47     */
48    public void setCurrentTheme(Theme theme) {
49        this.currentTheme = theme;
50    }
51   
52    /**
53     * Return the session's persistent parameters
54     *
55     * @return session parameters
56     */
57    public PageParameters getVloSessionPageParameters() {
58        return vloSessionPageParameters;
59    }
60
61    /**
62     * Add parameters to the session's persistent parameters
63     *
64     * @param parameters a page parameter map
65     *
66     */
67    public void addVloSessionPageParameters(PageParameters parameters) {
68       
69        vloSessionPageParameters.mergeWith(parameters);
70    }
71}
Note: See TracBrowser for help on using the repository browser.