/** * Return the wrapped request object. * * @return the wrapped request */ public ClientDataRequest getRequest() { return (ClientDataRequest) super.getRequest(); }
@Override public String getParameter(String name) { if ("captchaText".equals(name)) { return userCaptchaTextValue; } else { return super.getParameter(name); } } }
public Map<String, String[]> getParameterMap() { if (parameterMap != null) { return Collections.unmodifiableMap(parameterMap); } return super.getParameterMap(); }
@Override public Object getAttribute(String name) { if (name == WebKeys.THEME_DISPLAY) { return themeDisplay; } return super.getAttribute(name); }
public Enumeration<String> getParameterNames() { if (parameterMap != null) { Vector<String> keyVec = new Vector<String>(parameterMap.keySet()); return keyVec.elements(); } return super.getParameterNames(); }
@Override public String getParameter(String name) { if ("captchaText".equals(name)) { return userCaptchaTextValue; } else { return super.getParameter(name); } } }
return super.getParameterMap(); mCombinedParamMap = new LinkedHashMap<String, String[]>(super.getParameterMap());
/** * Return the wrapped request object. * * @return the wrapped request */ public EventRequest getRequest() { return (EventRequest) super.getRequest(); }
public String getParameter(String name) { if (parameterMap != null) { if (!parameterMap.containsKey(name)) { //ICE-8008: defer to the actual request if the key can't be found return super.getParameter(name); } String[] values = parameterMap.get(name); if (values != null && values.length >= 1) { return values[0]; } return null; // Or "", since the key does exist? } return super.getParameter(name); }
/** * Return the wrapped request object. * * @return the wrapped request */ public RenderRequest getRequest() { return (RenderRequest) super.getRequest(); }
public static <U extends PortletRequest> U unwrap(PortletRequest wrapped, Class<U> unwrapped) { while (true) { if (wrapped instanceof PortletRequestWrapper) { PortletRequestWrapper wrapper = (PortletRequestWrapper)wrapped; wrapped = wrapper.getRequest(); } else if (unwrapped.isInstance(wrapped)) { return unwrapped.cast(wrapped); } else { throw new IllegalArgumentException(); } } }
protected PortletRequest getLiferayPortletRequest(PortletRequest portletRequest) { if (portletRequest instanceof PortletRequestWrapper) { PortletRequestWrapper portletRequestWrapper = (PortletRequestWrapper) portletRequest; PortletRequest wrappedPortletRequest = portletRequestWrapper.getRequest(); portletRequest = getLiferayPortletRequest(wrappedPortletRequest); } return portletRequest; }
protected PortletRequest getLiferayPortletRequest(PortletRequest portletRequest) { if (portletRequest instanceof PortletRequestWrapper) { PortletRequestWrapper portletRequestWrapper = (PortletRequestWrapper) portletRequest; PortletRequest wrappedPortletRequest = portletRequestWrapper.getRequest(); portletRequest = getLiferayPortletRequest(wrappedPortletRequest); } return portletRequest; }
protected PortletRequest unwrapPortletRequest(PortletRequest portletRequest) { if (portletRequest instanceof PortletRequestWrapper) { PortletRequestWrapper portletRequestWrapper = (PortletRequestWrapper) portletRequest; portletRequest = portletRequestWrapper.getRequest(); return unwrapPortletRequest(portletRequest); } else { return portletRequest; } }
private PortletRequestImpl unwrap(PortletRequest wrapped) { while (true) { if (wrapped instanceof PortletRequestImpl) { return (PortletRequestImpl)wrapped; } else if (wrapped instanceof PortletRequestWrapper) { PortletRequestWrapper wrapper = (PortletRequestWrapper)wrapped; wrapped = wrapper.getRequest(); } else { // do we need something similar to unwrap(PortletResponse) behavior? throw new IllegalArgumentException("Cannot unwrap request: " + wrapped.getClass().getName()); } } }
/** * Determines whether or not the specified {@link javax.portlet.PortletRequest} is one created by Liferay Portal. If * the specified {@link javax.portlet.PortletRequest} is an instance of {@link * javax.portlet.filter.PortletRequestWrapper} then it will work with the wrapped {@link * javax.portlet.PortletRequest}. * * @param portletRequest The current {@link javax.portlet.PortletRequest}. * * @return true if the specified portletRequest was created by Pluto. */ protected boolean isPlutoPortletRequest(PortletRequest portletRequest) { if (portletRequest != null) { while (portletRequest instanceof PortletRequestWrapper) { PortletRequestWrapper portletRequestWrapper = (PortletRequestWrapper) portletRequest; portletRequest = portletRequestWrapper.getRequest(); } return portletRequest.getClass().getName().startsWith("org.apache.pluto"); } else { return false; } }
/** * Return an appropriate request object of the specified type, if available, * unwrapping the given request as far as necessary. * @param request the portlet request to introspect * @param requiredType the desired type of request object * @return the matching request object, or <code>null</code> if none * of that type is available */ @SuppressWarnings("unchecked") public static <T> T getNativeRequest(PortletRequest request, Class<T> requiredType) { if (requiredType != null) { if (requiredType.isInstance(request)) { return (T) request; } else if (request instanceof PortletRequestWrapper) { return getNativeRequest(((PortletRequestWrapper) request).getRequest(), requiredType); } } return null; }
/** * Return an appropriate request object of the specified type, if available, * unwrapping the given request as far as necessary. * @param request the portlet request to introspect * @param requiredType the desired type of request object * @return the matching request object, or {@code null} if none * of that type is available */ @SuppressWarnings("unchecked") public static <T> T getNativeRequest(PortletRequest request, Class<T> requiredType) { if (requiredType != null) { if (requiredType.isInstance(request)) { return (T) request; } else if (request instanceof PortletRequestWrapper) { return getNativeRequest(((PortletRequestWrapper) request).getRequest(), requiredType); } } return null; }
portletRequest = portletRequestWrapper.getRequest();
portletRequest = portletRequestWrapper.getRequest();