Package javax.portlet

Examples of javax.portlet.ActionResponse


        // Redirect
        HttpServletResponse servletResponse = ServletActionContext.getResponse();
        PortletResponse portletResponse = ((PortletServletResponse)servletResponse).getPortletResponse();
        if (portletResponse instanceof ActionResponse)
        {
            ActionResponse actionResponse = (ActionResponse)portletResponse;
            String redirectURL = actionResponse.encodeURL(url.toString());
            actionResponse.sendRedirect( redirectURL );
        }
        else
        {
          log.error("Unable to redirect the portlet RenderRequest to " + url.toString());
        }
View Full Code Here


            String action = namespace + actionName + "!" + renderMethod;
            if (log.isInfoEnabled())
              log.info("Diverting Portlet render action: " + action);

            // set action name
            ActionResponse res = PortletActionContext.getActionResponse();
            res.setRenderParameter(PortletActionConstants.ACTION_PARAM, action);
            sessionMap.put(WebAction.PORTLET_ACTION_RESULT, resultCode);

            // remove RENDER_DIRECT_LOCATION
      sessionMap.remove(RENDER_DIRECT_LOCATION);
        }  
View Full Code Here

                    try
                    {
                        prefs.setValue("appRows", Integer.toString(EditModeForm.this.getAppRows()));
                        prefs.setValue("portletRows", Integer.toString(EditModeForm.this.getPortletRows()));
                        prefs.store();
                        ActionResponse ar = (ActionResponse)((ApplicationsListApplication)this.getApplication()).getPortletResponse();
                        ar.setPortletMode(PortletMode.VIEW);                       
                    }
                    catch (ReadOnlyException e)
                    {
                        feedback.error(getString("pam.details.message.errorReadonly"));
                    }
View Full Code Here

                }
                // The view should have been restore.
                // Pass it to the render request.
                               
                request.getPortletSession().setAttribute(createViewRootKey(context, defaultPage, viewId), context.getViewRoot());
                ActionResponse actionResponse = (ActionResponse)response;
                               
                // actionResponse.setRenderParameter(viewId, context.getViewRoot().getViewId()); // get the navigation change
            }
            else if (renderRequest)
            {
View Full Code Here

            boolean saveAccountInput = uiAccountInput.save(service, true);
            if (saveAccountInput == false)
                return;
            uiForm.getChild(UIUserProfileInputSet.class).save(service, userName, true);
            uiForm.reset();
            ActionResponse actResponse = event.getRequestContext().getResponse();
            actResponse.setEvent(new QName("NewAccountAdded"), null);
        }
View Full Code Here

                        UIPortal uiPortal = Util.getUIPortal();
                        uiPortal.clearUIPage(pageRef);
                    }

                    // Update UserToolbarDashboardPortlet
                    ActionResponse actResponse = event.getRequestContext().getResponse();
                    actResponse.setEvent(new QName("NavigationChange"), userNode.getName());
                    return;
                }
            }
        }
View Full Code Here

            UIPopupWindow uiPopup = uiForm.getParent();
            uiPopup.setShow(false);
            UIComponent opener = uiPopup.getParent();

            ActionResponse response = event.getRequestContext().getResponse();
            response.setEvent(new QName("NavigationChange"), null);

            WebuiRequestContext pcontext = event.getRequestContext();
            pcontext.addUIComponentToUpdateByAjax(opener);
        }
View Full Code Here

                // The view should have been restore.
                // Pass it to the render request.
                request.getPortletSession().setAttribute(
                        createViewRootKey(context, defaultPage, viewId),
                        context.getViewRoot());
                ActionResponse actionResponse = (ActionResponse) response;

                // save FacesMessage objects on session; so they can
                // be restored during the render phase
                saveFacesMessages(context, request.getPortletSession());
            } else if (renderRequest)
View Full Code Here

      url = actionURL.toString();
      url = url.replaceAll("\\&amp\\;", "&");
    }
    else
    { // action - write the viewId to navigational state
      ActionResponse actionResponse = (ActionResponse) getResponse();

      // set request params into navigational states
      Enumeration<String> list = queryStr.getParameterNames();
      while (list.hasMoreElements())
      {
        String param = list.nextElement();
        if (param.equals(Bridge.PORTLET_MODE_PARAMETER))
        {
          try
          {
            actionResponse.setPortletMode(new PortletMode(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            //TODO: Ignoring is probably dangerous here as it means that we are
            //      EITHER using exceptions for flow control (which is extreemly
            //      inefficient) or we should log a message saying what the issue
            //      is.  According to the Javadocs an exception is thrown here if the
            //      portlet mode is not allowed or if sendRedirect has already been
            //      called.  In either case we should log an information type message
            //      here.
            ; // do nothing -- just ignore
          }
        }
        else if (param.equals(Bridge.PORTLET_WINDOWSTATE_PARAMETER))
        {
          try
          {
            actionResponse.setWindowState(new WindowState(queryStr.getParameter(param)));
          }
          catch (Exception e)
          {
            ; // do nothing -- just ignore
          }
        }
        else if (param.equals(Bridge.PORTLET_SECURE_PARAMETER))
        {
          ; // ignore -- do nothing as can't encode into an actionResponse
        }
        else
        {
          actionResponse.setRenderParameter(param, queryStr.getParameter(param));
        }
      }
    }
    // Because we want to support translating a redirect that occurs
    // during a render as an in place navigation AND we can't reverse
View Full Code Here

     * @param location The location string
     * @param invocation The action invocation
     */
    private void executeActionResult(String location,
            ActionInvocation invocation) {
        ActionResponse res = PortletActionContext.getActionResponse();
        // View is rendered outside an action...uh oh...
        res.setRenderParameter(PortletActionConstants.ACTION_PARAM,
                "freemarkerDirect");
        res.setRenderParameter("location", location);
        res.setRenderParameter(PortletActionConstants.MODE_PARAM, PortletActionContext
                .getRequest().getPortletMode().toString());

    }
View Full Code Here

TOP

Related Classes of javax.portlet.ActionResponse

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.