Package javax.portlet

Examples of javax.portlet.ActionRequest


        PortletEnvironmentService envService = getContainerServices().getPortletEnvironmentService();
        PortletInvokerService invoker = getContainerServices().getPortletInvokerService();

        PortletRequestContext requestContext = rcService.getPortletActionRequestContext(this, request, response, portletWindow);
        PortletActionResponseContext responseContext = rcService.getPortletActionResponseContext(this, request, response, portletWindow);
        ActionRequest portletRequest = envService.createActionRequest(requestContext, responseContext);
        ActionResponse portletResponse = envService.createActionResponse(responseContext);

        FilterManager filterManager = filterInitialisation(portletWindow,PortletRequest.ACTION_PHASE);

        String location = null;
View Full Code Here


    url.setParameter(VIEW_ID, viewId);
    return url.toString();
  }

  public static void ensureEncoding(FacesContext facesContext) throws UnsupportedEncodingException {
    ActionRequest request = (ActionRequest) facesContext.getExternalContext().getRequest();
    if (request.getCharacterEncoding() == null) {
      request.setCharacterEncoding("UTF-8");
    }
  }
View Full Code Here

    public void presentStaleSessionException(IRequestCycle cycle, StaleSessionException cause)
    {
        String markup = PortletMessages.staleSession();

        ActionRequest request = _globals.getActionRequest();

        request.getPortletSession(true).setAttribute(
                PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE,
                markup);

        ActionResponse response = _globals.getActionResponse();
View Full Code Here

        // add the cocoon header timestamp
        res.setProperty("X-Cocoon-Version", Constants.VERSION);

        // get the request (wrapped if contains multipart-form data)
        ActionRequest request;
        try {
            if (this.enableUploads) {
                request = requestFactory.getServletRequest(req);
            } else {
                request = req;
            }
        } catch (Exception e) {
            if (getLogger().isErrorEnabled()) {
                getLogger().error("Problem with Cocoon portlet", e);
            }

            manageException(req, res, null, null,
                            "Problem in creating the Request", null, null, e);
            return;
        }

        // Get the cocoon engine instance
        getCocoon(request.getParameter(Constants.RELOAD_PARAM));

        // Check if cocoon was initialized
        if (this.cocoon == null) {
            manageException(request, res, null, null,
                            "Initialization Problem",
                            null /* "Cocoon was not initialized" */,
                            null /* "Cocoon was not initialized, cannot process request" */,
                            this.exception);
            return;
        }

        // We got it... Process the request
        String servletPath = this.servletPath;
        if (servletPath == null) {
            servletPath = "portlets/" + getPortletConfig().getPortletName() + '/';
        }

        String uri = servletPath;
        String pathInfo = request.getParameter(PortletEnvironment.PARAMETER_PATH_INFO);
        if (pathInfo != null) {
            if (pathInfo.length() > 0 && pathInfo.charAt(0) == '/') {
                pathInfo = pathInfo.substring(1);
            }
            uri += pathInfo;
View Full Code Here

     * methods that allow easier connection to those objects since the servlet
     * API doesn't provide those methods directly.
     */
    public ActionRequest getServletRequest(ActionRequest request)
    throws IOException, MultipartException {
        ActionRequest req = request;
        String contentType = request.getContentType();

        if ((contentType != null) && (contentType.toLowerCase().indexOf("multipart/form-data") > -1)) {
            if (request.getContentLength() > maxUploadSize) {
                throw new IOException("Content length exceeds maximum upload size.");
View Full Code Here

    {
        try
        {
            String markup = PortletMessages.staleSession();

            ActionRequest request = _globals.getActionRequest();

            request.getPortletSession(true).setAttribute(
                    PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE,
                    markup);

            ActionResponse response = _globals.getActionResponse();
View Full Code Here

        boolean encoded = contentType != null
                && contentType.startsWith("multipart/form-data");

        try
        {
            ActionRequest newRequest = encoded ? _decoder.decode(request)
                    : request;

            servicer.service(newRequest, response);
        }
        finally
View Full Code Here

    }

    public void testActionBridgeSuccess() throws Exception
    {
        ActionRequest request = (ActionRequest) newMock(ActionRequest.class);

        MockControl responsec = newControl(ActionResponse.class);
        ActionResponse response = (ActionResponse) responsec.getMock();

        PortletRequestGlobals prg = (PortletRequestGlobals) newMock(PortletRequestGlobals.class);
        WebRequestServicerFixture wrs = new WebRequestServicerFixture();

        prg.store(request, response);

        request.removeAttribute("FOO");
        response.encodeURL("FOO");
        responsec.setReturnValue(null);

        replayControls();
View Full Code Here

        verifyControls();
    }

    public void testActionBridgeFailure() throws Exception
    {
        ActionRequest request = (ActionRequest) newMock(ActionRequest.class);
        ActionResponse response = (ActionResponse) newMock(ActionResponse.class);
        PortletRequestGlobals prg = (PortletRequestGlobals) newMock(PortletRequestGlobals.class);

        MockControl control = newControl(WebRequestServicer.class);
        WebRequestServicer servicer = (WebRequestServicer) control.getMock();
View Full Code Here

    public void presentStaleLinkException(IRequestCycle cycle, StaleLinkException cause)
    {
        try
        {
            ActionRequest request = _globals.getActionRequest();

            request.getPortletSession(true).setAttribute(
                    PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE,
                    cause.getMessage());

            ActionResponse response = _globals.getActionResponse();
View Full Code Here

TOP

Related Classes of javax.portlet.ActionRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.