Package javax.portlet

Examples of javax.portlet.ActionRequest


    ExternalContext extCtx = ctx.getExternalContext();

    if (BridgeUtil.getPortletRequestPhase() ==
        Bridge.PortletPhase.ACTION_PHASE)
    {
      ActionRequest actionRequest = (ActionRequest) extCtx.getRequest();
      String contentType = extCtx.getRequestContentType();
      String actionContentType = actionRequest.getContentType();
      if ((contentType == null && actionContentType == null) ||
          contentType.equals(actionContentType))
      {
        testRunner.setTestResult(true,
                                 "extCtx.getRequestContentType() correctly returned the same value as actionRequest.getContentType()");
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
        Cocoon cocoon = getCocoon();

        // Check if cocoon was initialized
        if (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 uri = this.servletPath;
        if (uri == null) {
            uri = "portlets/" + getPortletConfig().getPortletName();
        }

        // override servlet-path by the request
        if (servletPathOverriding) {
            String reqServletPath = (String) request.getAttribute("servlet-path");

            if (reqServletPath != null) {
                uri = reqServletPath;
            } else {
                PortletPreferences prefs = request.getPreferences();
               
                if (prefs != null) {
                    uri = prefs.getValue("servlet-path", uri);
                }
            }
View Full Code Here

            Thread.currentThread().setContextClassLoader(paClassLoader);

            if (method == ContainerConstants.METHOD_ACTION)
            {
                ActionRequest actionRequest = (ActionRequest) portletRequest;
                ActionResponse actionResponse = (ActionResponse) portletResponse;

                portletInstance.processAction(actionRequest, actionResponse);
            }
            else if (method == ContainerConstants.METHOD_RENDER)
View Full Code Here

        }

        String location = null;

        InternalActionResponse _actionResponse = null;
        ActionRequest actionRequest = null;

        try
        {
            /*ActionRequest*/
            actionRequest =
View Full Code Here

    // This tests that we can encode a new mode in an actionURL
    // done by navigation rule.
    if (BridgeUtil.getPortletRequestPhase() ==
        Bridge.PortletPhase.ACTION_PHASE)
    {
      ActionRequest aRequest =
        new ActionRequestWrapper((ActionRequest) extCtx.getRequest());

      extCtx.setRequest(aRequest);
      if (extCtx.getRequest() == aRequest)
      {
View Full Code Here

    ExternalContext extCtx = ctx.getExternalContext();

    if (BridgeUtil.getPortletRequestPhase() ==
        Bridge.PortletPhase.ACTION_PHASE)
    {
      ActionRequest actionRequest = (ActionRequest) extCtx.getRequest();
      String charEncoding = extCtx.getRequestCharacterEncoding();
      String actionCharEncoding = actionRequest.getCharacterEncoding();
      if ((charEncoding == null && actionCharEncoding == null) ||
          charEncoding.equals(actionCharEncoding))
      {
        testRunner.setTestResult(true,
                                 "extCtx.getRequestCharacterEncoding() correctly returned the same value as actionRequest.getCharacterEncoding()");
View Full Code Here

    ExternalContext extCtx = ctx.getExternalContext();

    if (BridgeUtil.getPortletRequestPhase() ==
        Bridge.PortletPhase.ACTION_PHASE)
    {
      ActionRequest actionRequest = (ActionRequest) extCtx.getRequest();
      String contentType = extCtx.getRequestContentType();
      String actionContentType = actionRequest.getContentType();
      if ((contentType == null && actionContentType == null) ||
          contentType.equals(actionContentType))
      {
        testRunner.setTestResult(true,
                                 "extCtx.getRequestContentType() correctly returned the same value as actionRequest.getContentType()");
View Full Code Here

    public void setPreferenceTwo(String preferenceTwo) {
        this.preferenceTwo = preferenceTwo;
    }

    public String execute() throws Exception {
        ActionRequest req = PortletActionContext.getActionRequest();
        PortletPreferences prefs = req.getPreferences();
        prefs.setValue("preferenceOne", preferenceOne);
        prefs.setValue("preferenceTwo", preferenceTwo);
        prefs.store();
        return SUCCESS;
    }
View Full Code Here

                request.removeAttribute(ContainerConstants.PORTLET);
            }

            if (method == ContainerConstants.METHOD_ACTION)
            {
                ActionRequest actionRequest = (ActionRequest) request.getAttribute(ContainerConstants.PORTLET_REQUEST);
                ActionResponse actionResponse = (ActionResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
                // inject the current request into the actionRequest handler (o.a.j.engine.servlet.ServletRequestImpl)
                ((HttpServletRequestWrapper)((HttpServletRequestWrapper)actionRequest).getRequest()).setRequest(request);

                portlet.processAction(actionRequest, actionResponse);
View Full Code Here

            Thread.currentThread().setContextClassLoader(paClassLoader);

            if (method == ContainerConstants.METHOD_ACTION)
            {
                ActionRequest actionRequest = (ActionRequest) portletRequest;
                ActionResponse actionResponse = (ActionResponse) portletResponse;

                portletInstance.processAction(actionRequest, actionResponse);
            }
            else if (method == ContainerConstants.METHOD_RENDER)
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.