Refine search
@Override public Object getAttribute(String name) { return wrapped.getAttribute(name); }
@Override public void setAttribute(String name, Object value, int scope) { wrapped.setAttribute(name, value, scope); }
@Override public void removeAttribute(String name, int scope) { wrapped.removeAttribute(name, scope); }
public static long getLong( PortletRequest portletRequest, String param, long defaultValue) { PortletSession portletSession = portletRequest.getPortletSession(false); String portletRequestValue = portletRequest.getParameter(param); if (portletRequestValue != null) { long value = GetterUtil.getLong(portletRequestValue); portletSession.setAttribute(param, value); return value; } if (portletSession != null) { Long portletSessionValue = (Long)portletSession.getAttribute(param); if (portletSessionValue != null) { return portletSessionValue; } } return defaultValue; }
public static ManagementHelper getManagementHelper(PortletRequest request) { ManagementHelper helper = (ManagementHelper) request.getPortletSession(true).getAttribute(PLUGIN_HELPER_KEY, PortletSession.APPLICATION_SCOPE); if (helper == null) { Kernel kernel = PortletManager.getKernel(); helper = new ManagementHelper(kernel); request.getPortletSession().setAttribute(PLUGIN_HELPER_KEY, helper, PortletSession.APPLICATION_SCOPE); } return helper; }
public static void clearErrorMessage(PortletRequest request) { PortletSession pSession = request.getPortletSession(true); pSession.removeAttribute("error.message"); pSession.removeAttribute("error.output"); pSession.removeAttribute("error.map"); }
public static String getErrorOutput(PortletRequest request) { PortletSession pSession = request.getPortletSession(true); try { return (String) pSession.getAttribute("error.output"); } catch (Throwable t) { return null; } }
public String getFlowExecutionKey(PortletRequest request) { String flowExecutionKey = request.getParameter(EXECUTION_ATTRIBUTE); PortletSession session = request.getPortletSession(false); if (session != null) { if (flowExecutionKey == null && request instanceof RenderRequest) { flowExecutionKey = (String) session.getAttribute(EXECUTION_ATTRIBUTE); } else if (flowExecutionKey != null && request instanceof ActionRequest) { session.removeAttribute(EXECUTION_ATTRIBUTE); } } return flowExecutionKey; }
public static final Object consume(PortletRequest request, String messageName) { String key = messageName; Object object = request.getPortletSession().getAttribute(key, PortletSession.PORTLET_SCOPE); // consume it request.getPortletSession().removeAttribute(key, PortletSession.PORTLET_SCOPE); return object; }
protected void incrementCounter(PortletRequest portletRequest) { if ((_captchaConfiguration.maxChallenges() > 0) && Validator.isNotNull(portletRequest.getRemoteUser())) { PortletSession portletSession = portletRequest.getPortletSession(); Integer count = (Integer)portletSession.getAttribute( WebKeys.CAPTCHA_COUNT); portletSession.setAttribute( WebKeys.CAPTCHA_COUNT, incrementCounter(count)); } }
@Override protected void setAttribute(String key, Object value) { if (mPortletRequest != null) { mPortletRequest.getPortletSession(true).setAttribute(key, value, mScope); } }
/** {@inheritDoc} */ public Collection<Object> values() { List<Object> list = new ArrayList<Object>(); Enumeration<String> keys = session.getAttributeNames(PortletSession.PORTLET_SCOPE); while (keys.hasMoreElements()) { list.add(session.getAttribute(keys.nextElement())); } return (list); }
private static State getPortletState(FacesContext context, Object session) { javax.portlet.PortletSession portletSession = (javax.portlet.PortletSession) session; State state = (State) portletSession.getAttribute(WindowScopeManager.class.getName(), javax.portlet.PortletSession.APPLICATION_SCOPE); if (state == null) { state = new State(EnvUtils.getWindowScopeExpiration(context)); portletSession.setAttribute(WindowScopeManager.class.getName(), state, javax.portlet.PortletSession.APPLICATION_SCOPE); } return state; }
public Object remove(Object key) { if (sessionExists()) { String skey = key(key); Object previous = session.getAttribute(skey); session.removeAttribute(skey); return (previous); } else { return (null); } }
@Override public Enumeration<String> getKeys() { PortletSession session = request.getPortletSession(false); if (session != null) { return session.getAttributeNames(scope); } return null; }
@Override public Enumeration<String> getAttributeNames(int scope) { return wrapped.getAttributeNames(scope); }
private String createBridgeRequestScope(PortletRequest request) { // Generate an RMI UID, which is a unique identifier WITHIN the local // host. This will be used as the new lifecyleID UID uid = new UID(); return qualifyScopeId(mPortletConfig.getPortletName(), request.getPortletSession(true).getId(), request.getPortletMode().toString(), uid.toString()); }
@Override public String getId() { return wrapped.getId(); }
@Override public int getMaxInactiveInterval() { return wrapped.getMaxInactiveInterval(); }
/** Point at which the JWT expires */ protected final Date getExpiration(RenderRequest renderRequest) { // Expiration of the JWT final PortletSession portletSession = renderRequest.getPortletSession(); final Date rslt = new Date( portletSession.getLastAccessedTime() + ((long) portletSession.getMaxInactiveInterval() * 1000L)); return rslt; } }