@Override public Object getAttribute(String name) { return ((PortletRequest)wrapped).getAttribute(name); }
@Override public PortletSession getPortletSession() { return ((PortletRequest)wrapped).getPortletSession(); }
@Override public void setAttribute(String name, Object o) { ((PortletRequest)wrapped).setAttribute(name, o); }
/** {@inheritDoc} */ public Collection<String> values() { List<String> list = new ArrayList<String>(); Enumeration<String> keys = request.getParameterNames(); while (keys.hasMoreElements()) { list.add(request.getParameter(keys.nextElement())); } return (list); }
private void _initAttributes() { if (_attributes != null) { return; } _attributes = new HashMap<>(); Enumeration<String> enumeration = _portletRequest.getAttributeNames(); while (enumeration.hasMoreElements()) { String name = enumeration.nextElement(); Object value = _portletRequest.getAttribute(name); _attributes.put(name, value); } }
PortletRequest request = (PortletRequest)mExternalContext.getRequest(); List<String> preExistingAttrs = (List<String>) request.getAttribute(BridgeImpl.PREEXISTING_ATTRIBUTE_NAMES); ArrayList<String> removeList = (ArrayList<String>) new ArrayList(preExistingAttrs.size()); Enumeration<String> e = request.getAttributeNames(); while (e.hasMoreElements()) String name = e.nextElement(); if (!preExistingAttrs.contains(name)) request.removeAttribute(iter.next()); mViewRoot = null; mElContext = null; FacesContext.setCurrentInstance(null);
@SuppressWarnings("unchecked") private Map<String, String> getPreferencesValueMap(ExternalContext extCtx) { Map<String, String> m; PortletRequest portletRequest = (PortletRequest) extCtx.getRequest(); Enumeration<String> e = portletRequest.getPreferences().getNames(); if (e.hasMoreElements()) { m = new HashMap<String, String>(); while (e.hasMoreElements()) { String name = e.nextElement(); String value = portletRequest.getPreferences().getValue(name, null); if (value != null) { m.put(name, value); } } } else { m = Collections.emptyMap(); } return m; }
ServiceContextThreadLocal.getServiceContext(); ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY); Enumeration<String> enu = portletRequest.getParameterNames(); while (enu.hasMoreElements()) { String param = enu.nextElement(); String[] values = portletRequest.getParameterValues(param); Map<String, String[]> parameterMap = portletRequest.getParameterMap();
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); }
@Override public Object getRequestAttribute(String name) { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); PortletRequest portletRequest = (PortletRequest) externalContext.getRequest(); return portletRequest.getAttribute(name); }
actionResponse.sendRedirect(url); FacesContext facesContext = FacesContext.getCurrentInstance(); PortalContext portalContext = bridgeContext.getPortletRequest().getPortalContext(); String createRenderUrlDuringActionPhaseSupport = portalContext.getProperty( BridgePortalContext.CREATE_RENDER_URL_DURING_ACTION_PHASE_SUPPORT); actionResponse.sendRedirect(bridgeURI.toString()); String contextPath = bridgeContext.getPortletRequest().getContextPath(); String newViewId = bridgeURI.getContextRelativePath(contextPath); UIViewRoot viewRoot = facesContext.getViewRoot(); String currentFacesViewId = viewRoot.getViewId(); ViewHandler viewHandler = facesContext.getApplication().getViewHandler(); UIViewRoot newViewRoot = viewHandler.createView(facesContext, newViewId); facesContext.setViewRoot(newViewRoot);
FacesContext facesContext = FacesContext.getCurrentInstance(); value = getPortletRequest(facesContext); FacesContext facesContext = FacesContext.getCurrentInstance(); value = getPortletResponse(facesContext); FacesContext facesContext = FacesContext.getCurrentInstance(); value = getPortletRequest(facesContext); value = new MutablePreferenceMap(portletRequest.getPreferences()); FacesContext facesContext = FacesContext.getCurrentInstance(); value = facesContext.getExternalContext().getSession(true); FacesContext facesContext = FacesContext.getCurrentInstance(); value = facesContext.getExternalContext().getSessionMap(); value = portletRequest.getPreferences(); value = portletRequest.getPreferences().getMap();
@Override public void setRequestAttribute(String name, Object value) { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); PortletRequest portletRequest = (PortletRequest) externalContext.getRequest(); portletRequest.setAttribute(name, value); }
@Override public String getRequestParameter(String name) { PortletRequest portletRequest = (PortletRequest) FacesContext.getCurrentInstance().getExternalContext() .getRequest(); return portletRequest.getParameter(name); }
ExternalContext extCtx = facesContext.getExternalContext(); return extCtx.getRequest(); } else return extCtx.getResponse(); } else return extCtx.getRequest(); } else return ((PortletRequest) extCtx.getRequest()).getPreferences(); case portletPreferencesValues: context.setPropertyResolved(true); return ((PortletRequest) extCtx.getRequest()).getPreferences().getMap(); default: return null;
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 FacesContext getFacesContext(final FacesContext facesContext, Object context, Object request, Object response) throws FacesException ExternalContext externalContext = facesContext.getExternalContext(); List handlers = null; boolean init = false; String nextToken = null; Map requestMap = externalContext.getRequestMap(); nextToken = portletRequest.getParameter(CONVERSATION_CONTEXT_PARAM); if (nextToken == null) nextToken = portletRequest.getParameter(REQUEST_CONTEXT_PARAM); handlers = (List) externalContext.getApplicationMap().remove(REQUEST_HANDLERS+nextToken); handlers.add(new DataSourceLeakRequestHandler()); Map reqScope = facesContext.getExternalContext().getRequestMap(); handlers.addAll(ConfigUtils.getRequestHandlers(reqScope)); nextToken = portletRequest.getParameter(CONVERSATION_CONTEXT_PARAM); if (nextToken == null) actionResponse.setRenderParameter(REQUEST_CONTEXT_PARAM, nextToken);
@Override public UIViewRoot createView(FacesContext context, String viewId) { UIViewRoot viewRoot = super.createView(context, viewId); if (PortletUtil.isPortletRequest(context)) { PortletRequest request = (PortletRequest) context.getExternalContext().getRequest(); viewRoot.setViewId(request.getParameter(MyFacesGenericPortlet.VIEW_ID)); } return viewRoot; }
_portletResponse = portletResponse; _contentType = portletRequest.getResponseContentType(); _serverName = portletRequest.getServerName(); _serverPort = portletRequest.getServerPort(); _secure = portletRequest.isSecure(); _authType = portletRequest.getAuthType(); _remoteUser = portletRequest.getRemoteUser(); _contextPath = portletRequest.getContextPath(); _locale = portletRequest.getLocale(); _portletMode = portletRequest.getPortletMode(); _portletSessionId = portletRequest.getRequestedSessionId(); _scheme = portletRequest.getScheme(); _windowState = portletRequest.getWindowState(); ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute( WebKeys.THEME_DISPLAY);
protected String getServantFuncName(PortletRequest request) { final PortletSession session = request.getPortletSession(); String fname = (String)session.getAttribute(FNAME_ATTRIBUTE); if (fname == null) { final PortletPreferences preferences = request.getPreferences(); fname = preferences.getValue(FNAME_ATTRIBUTE, null); if (fname != null) { session.setAttribute(FNAME_ATTRIBUTE, fname); } } return fname; }