Examples of ActionResponse


Examples of javax.portlet.ActionResponse

        String markup = caw.toString();

        _request.getSession(true).setAttribute(
                PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE, markup);

        ActionResponse response = _globals.getActionResponse();

        response.setRenderParameter(ServiceConstants.SERVICE,
                PortletConstants.EXCEPTION_SERVICE);
    }
View Full Code Here

Examples of javax.portlet.ActionResponse

        _request.getSession(true).setAttribute(
                PortletConstants.PORTLET_EXCEPTION_MARKUP_ATTRIBUTE,
                markup);

        ActionResponse response = _globals.getActionResponse();

        response.setRenderParameter(ServiceConstants.SERVICE, PortletConstants.EXCEPTION_SERVICE);
    }
View Full Code Here

Examples of javax.portlet.ActionResponse

     * @param invocation
     */
    protected void executeActionResult(String finalLocation,
            ActionInvocation invocation) {
        LOG.debug("Executing result in Event phase");
        ActionResponse res = PortletActionContext.getActionResponse();
        LOG.debug("Setting event render parameter: " + finalLocation);
        if (finalLocation.indexOf('?') != -1) {
            convertQueryParamsToRenderParams(res, finalLocation
                    .substring(finalLocation.indexOf('?') + 1));
            finalLocation = finalLocation.substring(0, finalLocation
                    .indexOf('?'));
        }
        if (finalLocation.endsWith(".action")) {
            // View is rendered with a view action...luckily...
            finalLocation = finalLocation.substring(0, finalLocation
                    .lastIndexOf("."));
            res.setRenderParameter(PortletActionConstants.ACTION_PARAM, finalLocation);
        } else {
            // View is rendered outside an action...uh oh...
            res.setRenderParameter(PortletActionConstants.ACTION_PARAM, "renderDirect");
            res.setRenderParameter("location", finalLocation);
        }
        res.setRenderParameter(PortletActionConstants.MODE_PARAM, PortletActionContext
                .getRequest().getPortletMode().toString());
    }
View Full Code Here

Examples of javax.portlet.ActionResponse

     * @param location
     * @param 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

Examples of javax.portlet.ActionResponse

            }
            proxy.execute();
            if (PortletActionConstants.EVENT_PHASE.equals(phase)) {
                // Store the executed action in the session for retrieval in the
                // render phase.
                ActionResponse actionResp = (ActionResponse) response;
                request.getPortletSession().setAttribute(EVENT_ACTION, proxy);
                actionResp.setRenderParameter(EVENT_ACTION, "true");
            }
        } catch (ConfigurationException e) {
            LOG.error("Could not find action", e);
            throw new PortletException("Could not find action " + actionName, e);
        } catch (Exception e) {
View Full Code Here

Examples of javax.portlet.ActionResponse

     * @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

Examples of javax.portlet.ActionResponse

    }

    public void authenticate(ActionFormEvent event) {
        log.debug("Entering authenticate ");
        ActionRequest request = event.getActionRequest();
        ActionResponse response = event.getActionResponse();
        String username = request.getParameter("username");
        String password = request.getParameter("password");

        AccountRequest accountRequest = null;
        try {
            authenticate(username, password);
            accountRequest = checkCurrentRequest(username);
        } catch (Exception e) {
            log.error(e.getMessage());
            response.setRenderParameter("error_message", e.getMessage());
            setNextState(request, AUTH_PROMPT_JSP);
            return ;
        }

        PortletSession session = request.getPortletSession();
View Full Code Here

Examples of javax.portlet.ActionResponse

     * @param event an ActionFormEvent
     */
    public void validatePIN(ActionFormEvent event) {
        log.debug("Entering validatePIN");
        ActionRequest request = event.getActionRequest();
        ActionResponse response = event.getActionResponse();
        PortletSession session = request.getPortletSession(false);
        if (session == null) {
            log.error("Invalid session.");
            setNextState(request, PIN_PROMPT_JSP);
            return ;
        }

        String pinNumber = request.getParameter("pinNumber");
        String pinNumberVerify = request.getParameter("pinNumberVerify");
        String username = (String)session.getAttribute("username");

        try {
            validatePINNumber(pinNumber, pinNumberVerify);
            setStatusRenew(username, pinNumber);
        } catch (Exception e) {
            log.error(e.getMessage());
            response.setRenderParameter("error_message", e.getMessage());
            setNextState(request, PIN_PROMPT_JSP);
            return ;
        }

        log.debug("Exit validatePIN");
View Full Code Here

Examples of javax.portlet.ActionResponse

     * @param event an ActionFormEvent
     */
    public void submitRequest(ActionFormEvent event) {
        log.debug("Entering submitRequest");
        PortletRequest req = event.getActionRequest();
        ActionResponse res = event.getActionResponse();
        PortletSession session = req.getPortletSession();

        String account_type = (String)session.getAttribute(ACCOUNT_TYPE);
        if (account_type == null) {
            log.error("Account Type is NULL");
            setNextState(req, DEFAULT_VIEW_PAGE);
            return;
        }
        AccountRequestAttrCollection attrs =
            (AccountRequestAttrCollection) session.getAttribute("attrs");
        if ( attrs == null) {
            log.error("Account Request Form is NULL");
            setNextState(req, DEFAULT_VIEW_PAGE);
            return;
        }

        log.info("Request confirmed by user.");
        Map attrMap = attrs.getMapNonNull();
        attrMap.put(ACCOUNT_TYPE, account_type);

        accountService.saveAccount(attrMap);

        // remove attributes from session scope
        session.removeAttribute("attrs");

        res.setRenderParameter("message", "RequestSuccess");

        setNextState(req, SUBMITTED_REQUEST_JSP);
        log.debug("Exit submitRequest");
    }
View Full Code Here

Examples of javax.portlet.ActionResponse

        DEFAULT_VIEW_PAGE = LOGIN_JSP;
    }

    public void forward(ActionFormEvent event) throws PortletException {
        ActionRequest request = event.getActionRequest();
        ActionResponse response = event.getActionResponse();

        Map parameterMap = request.getParameterMap();
        response.setRenderParameters(parameterMap);

        setNextState(request, "forward");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.