01: package org.wings.session;
02:
03: import javax.portlet.RenderResponse;
04:
05: import org.wings.portlet.Const;
06: import org.wings.portlet.PortletParameterProvider;
07: import org.wings.portlet.WindowStateProvider;
08:
09: public class ExtendedSession extends Session {
10:
11: /**
12: * Creates a unique id including the portlet id.
13: */
14: public String createUniqueId() {
15: RenderResponse renderResponse = (RenderResponse) getProperty(Const.WINGS_SESSION_PROPERTY_RENDER_RESPONSE);
16: String uid = renderResponse.getNamespace();
17: uid = uid.replace("_", "");
18: return uid + super .createUniqueId();
19: }
20:
21: /**
22: * Fires events if the portlet window state has changed and if there is
23: * a PortletWindowStateProvider registered in the actual session
24: */
25: public synchronized void fireWindowStateEvents() {
26: WindowStateProvider pwsp = (WindowStateProvider) getProperty(Const.WINGS_SESSION_PROPERTY_WINDOW_STATE_PROVIDER);
27: if (pwsp != null) {
28: pwsp.updateWindowState();
29: }
30: }
31:
32: /**
33: * Fires events for the new portlet parameters
34: */
35: public synchronized void fireNewPortletParameters() {
36: PortletParameterProvider ppp = (PortletParameterProvider) getProperty(Const.WINGS_SESSION_PROPERTY_PORTLET_PARAMETER_PROVIDER);
37: if (ppp != null) {
38: ppp.updateParameters();
39: }
40: }
41:
42: }
|