@Override public void setAttribute(String name, Object o) { ((PortletRequest)wrapped).setAttribute(name, o); }
public void setPreference( PortletRequest portletRequest, String name, String[] values) { Map<String, String[]> portletPreferencesMap = (Map<String, String[]>)portletRequest.getAttribute( WebKeys.PORTLET_PREFERENCES_MAP); if (portletPreferencesMap == null) { portletPreferencesMap = new HashMap<>(); portletRequest.setAttribute( WebKeys.PORTLET_PREFERENCES_MAP, portletPreferencesMap); } portletPreferencesMap.put(name, values); }
(LiferayPortletSession)portletRequest.getPortletSession(); portletRequest.setAttribute(PORTLET_SERVLET_CONFIG, getServletConfig()); portletRequest.setAttribute(PORTLET_SERVLET_REQUEST, request); portletRequest.setAttribute(PORTLET_SERVLET_RESPONSE, response); portletRequest.setAttribute(WebKeys.PORTLET_ID, portletId);
public void setAttribute(String s, Object obj) { request.setAttribute(s, obj); } }
/** * The default behavior of this method is to call * <code>setAttribute(name, o)</code> on the wrapped request object. */ public void setAttribute(String name, Object o) { request.setAttribute(name, o); }
@Override public void setAttribute(String key, Object value) { if (mPortletRequest != null) { mPortletRequest.setAttribute(key, value); } }
public Object setValue(Object obj) { request.setAttribute(key, obj); return value; } });
@Override protected void setAttribute(String key, Object value) { _portletRequest.setAttribute(key, value); }
public static void setServantDone(PortletRequest request, Object returnValue) { request.setAttribute(SERVANT_DONE, Boolean.TRUE); if (returnValue != null) { request.setAttribute(RETURN_VALUE, returnValue); } }
/** * Set the CommandArg value, useful for commands which would like to chain * other commands * @param runtimeData * @param arg String */ protected void setCommandArg (PortletRequest request, String arg) { request.setAttribute(GROUP_COMMAND_ARG, arg); }
/** {@inheritDoc} */ public void putAll(Map<? extends String, ? extends Object> map) { Iterator<? extends String> keys = map.keySet().iterator(); while (keys.hasNext()) { String key = keys.next(); request.setAttribute(key, map.get(key)); } }
/** * Saves an attribute in the request. * * @param key the name of the request attribute. * @param value the value to set. * @return the object that was just set. */ public Object put(Object key, Object value) { entries = null; request.setAttribute(key.toString(), value); return get(key); }
protected void setDefaultPage(PortletRequest request, String page) { if (request.getAttribute(DEFAULT_PAGE) == null) { request.setAttribute(DEFAULT_PAGE, page); } }
protected void setTermCodeRequestAttribute(PortletRequest request, String termCode) { for(IParameterEvaluator evaluator : urlParamEvaluators.values()) { if(evaluator instanceof TermCodeParameterEvaluator) { request.setAttribute(((TermCodeParameterEvaluator)evaluator).getAttributeKey(),termCode); return; } } }
protected static Map getOrCreateMessages(final PortletRequest request) { Map messages = (Map) request.getAttribute(REQUEST_ATTRIBUTE_MESSAGES); if (messages == null) { messages = new LinkedHashMap(); request.setAttribute(REQUEST_ATTRIBUTE_MESSAGES, messages); } return messages; }
protected void createExcludedAttributeList(PortletRequest request) { // create excluded list ArrayList excludedNameList = new ArrayList(); Enumeration enu = request.getAttributeNames(); while (enu.hasMoreElements()) { excludedNameList.add(enu.nextElement()); } // reserved names excludedNameList.add(EXCLUDED_ATTRIBUTE_LIST); excludedNameList.add(JsfConstants.FACES_CONTEXT); request.setAttribute(EXCLUDED_ATTRIBUTE_LIST, excludedNameList); }
public Object setValue(Object value) { Object oldValue = getValue(); portletRequest.setAttribute(getKey(), value); return oldValue; } }
/** {@inheritDoc} */ public Object put(String key, Object value) { if (value == null) { return (remove(key)); } String skey = key(key); Object previous = request.getAttribute(skey); request.setAttribute(skey, value); return (previous); }
private void populateExistingList(PortletRequest renderRequest) { ThreadPool[] pools = PortletManager.getCurrentServer(renderRequest).getThreadPools(); ThreadPoolSummary[] result = new ThreadPoolSummary[pools.length]; for (int i = 0; i < pools.length; i++) { result[i] = new ThreadPoolSummary(PortletManager.getNameFor(renderRequest, pools[i]), pools[i].getPoolSize()); } Arrays.sort(result); renderRequest.setAttribute("pools", result); }
/** * expose the request to the current thread * @param request */ public static void exposeRequest(PortletRequest request) { //use same code as requestInitialized from Spring RequestContextListener PortletRequestAttributes attributes = new PortletRequestAttributes(request); request.setAttribute(REQUEST_ATTRIBUTES_ATTRIBUTE, attributes); LocaleContextHolder.setLocale(request.getLocale()); RequestContextHolder.setRequestAttributes(attributes); }