/** * Returns the name an attribute is (or will be) encoded in the PortletSession APPLICATION_SCOPE. * @param session PortletSession * @param attributeName the attribute name to encode */ public static String getApplicationScopeSessionAttributeName(PortletSession session, String attributeName) { return getApplicationScopeSessionAttributeName(getPortletWindowId(session),attributeName); }
public NamespacedNamesEnumeration(Enumeration namesEnumeration, String namespace) { this.namesEnumeration = namesEnumeration; this.namespace = namespace; hasMoreElements(); }
public static HttpSession createProxy(HttpServletRequest request) { HttpSession servletSession = request.getSession(); PortletRequest portletRequest = (PortletRequest) request.getAttribute("javax.portlet.request"); if (portletRequest != null) { PortletSession portletSession = portletRequest.getPortletSession(); servletSession = (HttpSession)createProxy(request, "javax.portlet.p."+PortletWindowUtils.getPortletWindowId(portletSession)); } return servletSession; }
/** * Save the prefs */ public void processPreferencesAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException { PortletPreferences prefs = request.getPreferences(); PreferencesHelper.requestParamsToPreferences(request); prefs.store(); actionResponse.setPortletMode(PortletMode.VIEW); }
protected String getPortletWindowId() { if (portletWindowId == null) { portletWindowId = PortletWindowUtils.getPortletWindowId(portletRequest .getPortletSession()); } return portletWindowId; }
filterRequestContext.setRequest(new PortletServletRequestWrapper(config .getServletContext(), filterRequestContext.getRequest(), ServletPortletSessionProxy.createProxy(filterRequestContext.getRequest()), filterPath)); if (WicketPortlet.ACTION_REQUEST.equals(filterRequestContext.getRequest().getAttribute( if (portletWindowId != null) HttpSession proxiedSession = ServletPortletSessionProxy.createProxy(request, portletWindowId); pathInfo = stripWindowIdFromPathInfo(pathInfo);
public static HttpSession createProxy(HttpServletRequest request, String portletWindowNamespace) { HttpSession servletSession = request.getSession(); HashSet interfaces = new HashSet(); interfaces.add(HttpSession.class); Class current = servletSession.getClass(); while (current != null) { try { Class[] currentInterfaces = current.getInterfaces(); for (int i = 0; i < currentInterfaces.length; i++) { interfaces.add(currentInterfaces[i]); } current = current.getSuperclass(); } catch (Exception e) { current = null; } } Object proxy = Proxy.newProxyInstance(servletSession.getClass().getClassLoader(), (Class[])interfaces.toArray(new Class[interfaces.size()]), new ServletPortletSessionProxy(request.getSession(), portletWindowNamespace)); return (HttpSession)proxy; }
retval = new NamespacedNamesEnumeration(servletSession.getAttributeNames(), portletWindowPrefix); Enumeration e = new NamespacedNamesEnumeration(servletSession.getAttributeNames(), portletWindowPrefix); while (e.hasMoreElements())
/** * Save the prefs */ public void processPreferencesAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, IOException { PortletPreferences prefs = request.getPreferences(); PreferencesHelper.requestParamsToPreferences(request); prefs.store(); actionResponse.setPortletMode(PortletMode.VIEW); }
/** * Constructor which will attempt to discover the portlet window id to use as the portlet name * space and delegate construction to * {@link ServletPortletSessionProxy#createProxy(HttpServletRequest, String)}. * * @param request * @return */ public static HttpSession createProxy(HttpServletRequest request) { HttpSession servletSession = request.getSession(); PortletRequest portletRequest = (PortletRequest) request.getAttribute("javax.portlet.request"); if (portletRequest != null) { PortletSession portletSession = portletRequest.getPortletSession(); servletSession = (HttpSession)createProxy(request, "javax.portlet.p."+PortletWindowUtils.getPortletWindowId(portletSession)); } return servletSession; }
/** * Returns the name an attribute is (or will be) encoded in the PortletSession APPLICATION_SCOPE. * @param session PortletSession * @param attributeName the attribute name to encode */ public static String getApplicationScopeSessionAttributeName(PortletSession session, String attributeName) { return getApplicationScopeSessionAttributeName(getPortletWindowId(session),attributeName); }
public NamespacedNamesEnumeration(Enumeration namesEnumeration, String namespace) { this.namesEnumeration = namesEnumeration; this.namespace = namespace; hasMoreElements(); }
(Class[])interfaces.toArray(new Class[interfaces.size()]), new ServletPortletSessionProxy(request.getSession(), portletWindowNamespace)); return (HttpSession)proxy;
retval = new NamespacedNamesEnumeration(servletSession.getAttributeNames(), portletWindowPrefix); Enumeration e = new NamespacedNamesEnumeration(servletSession.getAttributeNames(), portletWindowPrefix); while (e.hasMoreElements())
PreferencesHelper.requestParamsToPreferences(request); prefs.store(); getConnection(request);
PreferencesHelper.requestParamsToPreferences(request); prefs.store(); con = getConnection(request); PreferencesHelper.requestParamsToPreferences(request); prefs.store(); response.setPortletMode(PortletMode.EDIT); PreferencesHelper.requestParamsToPreferences(request); prefs.store(); response.setPortletMode(PortletMode.VIEW);
PreferencesHelper.requestParamsToPreferences(request); prefs.store(); con = getConnection(request); PreferencesHelper.requestParamsToPreferences(request); prefs.store(); response.setPortletMode(PortletMode.EDIT); PreferencesHelper.requestParamsToPreferences(request); prefs.store(); response.setPortletMode(PortletMode.VIEW);