Package org.geogrid.aist.tsukubagama.services.request

Examples of org.geogrid.aist.tsukubagama.services.request.AccountRequest


        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());
View Full Code Here


            throw new Exception("Authentication failed.");
        }
    }

    private AccountRequest checkCurrentRequest(String username) throws Exception {
        AccountRequest accountRequest =
            accountService.getAccountRequestByUsername(username);
        if (accountRequest == null) {
            throw new Exception("No AccountRequest found for " + username);
        }

        if (accountRequest.isRenewRequest()) {
            throw new Exception("Already renewed");
        } else if (accountRequest.isResetRequest()) {
            throw new Exception("Couldn't renew this account.");
        }

        return accountRequest;
    }
View Full Code Here

        }
    }

    private void setStatusRenew(String username, String pinNumber)
        throws Exception {
        AccountRequest accountRequest =
            accountService.getAccountRequestByUsername(username);
        if (accountRequest == null) {
            throw new Exception("No AccountRequest found for " + username);
        }
        Map params = new HashMap();
View Full Code Here

     *
     * @param requests
     */
    private void setOrderedOids(List requests) {
        if ( (requests != null) && (! requests.isEmpty()) ) {
            AccountRequest request = null;
            LinkedHashSet oids = new LinkedHashSet();
            for (Iterator itr = requests.iterator(); itr.hasNext(); ) {
                request = (AccountRequest) itr.next();
                oids.add(request.getOid());
            }
            this.orderedOids = oids;
        } else {
            this.orderedOids = Collections.emptySet();
        }
View Full Code Here

        PortletRequest req = event.getActionRequest();
        ActionResponse res = event.getActionResponse();
        PortletSession session = req.getPortletSession();

        String oid = event.getAction().getParameter("oid");
        AccountRequest accountRequest =
            accountService.getAccountRequestByOid(oid);
        if (accountRequest == null) {
            log.error("AccountRequest was already deleted.");
            res.setRenderParameter("message", "Account was already deleted.");
            return;
        }

        String[] prevAndNextOids = getPrevAndNextOids(oid);
        String prevOid = prevAndNextOids[0];
        String nextOid = prevAndNextOids[1];

        TextAreaBean adminCommentsBean =
            event.getTextAreaBean("adminCommentsBean");
        adminCommentsBean.setValue(accountRequest.getAdminComments());

        String message = event.getAction().getParameter("message");
        if ((message != null) && (!message.equals(""))) {
            res.setRenderParameter("message", message);
        }

        session.setAttribute(ACCOUNT_REQUEST, accountRequest);
        session.setAttribute(PREVIOUS_REQUEST, prevOid);
        session.setAttribute(NEXT_REQUEST, nextOid);

        if (log.isDebugEnabled()) {
            log.debug("account_type: " + accountRequest.getAccountType());
        }
        AccountRequestAttrCollection attrs =
            accountService.newAccountRequestAttrCollection(accountRequest.getAccountType());
        Map attributes = accountRequest.getAttributes();
        for (Iterator itr = attrs.iterator(); itr.hasNext(); ) {
            AccountRequestAttr attr = (AccountRequestAttr)itr.next();
            Object valueObj = attributes.get(attr.getName());
            if (valueObj != null) {
                attr.setValue((String)valueObj);
View Full Code Here

        PortletRequest req = event.getActionRequest();
        ActionResponse res = event.getActionResponse();
        PortletSession session = req.getPortletSession();

        String oid = event.getAction().getParameter("oid");
        AccountRequest accountRequest =
            accountService.getAccountRequestByOid(oid);
        if (accountRequest == null) {
            log.error("AccountRequest was already deleted.");
            res.setRenderParameter("message", "Account was already deleted.");
            return ;
        }

        ListBoxBean statusType = event.getListBoxBean("requestStatusType");
        AccountRequest.Status nextStatus =
            AccountRequest.Status.valueOf( statusType.getSelectedValue() );

        String link = PortletRequestUtil.buildPortalUrl(req);
        link += REQUEST_URI_FOR_ACTIVATION;
        Map params = new HashMap();
        params.put("activation_url", link);
        params.put("operator", req.getRemoteUser());

        AccountRequestResult result =
            accountService.updateAccount(accountRequest, nextStatus, params);

        event.getAction().addParameter("oid", accountRequest.getOid());
        if (result.isError()) {
            String updateMessage = result.getMessage();
            event.getAction().addParameter("message", updateMessage);
        }
View Full Code Here

        PortletRequest req = event.getActionRequest();
        ActionResponse res = event.getActionResponse();
        PortletSession session = req.getPortletSession();

        String oid = event.getAction().getParameter("oid");
        AccountRequest accountRequest =
            accountService.getAccountRequestByOid(oid);
        if (accountRequest == null) {
            log.error("AccountRequest was already deleted.");
            res.setRenderParameter("message", "Account was already deleted.");
            return;
View Full Code Here

        PortletRequest req = event.getActionRequest();
        ActionResponse res = event.getActionResponse();
        PortletSession session = req.getPortletSession();

        String oid = event.getAction().getParameter("oid");
        AccountRequest accountRequest =
            accountService.getAccountRequestByOid(oid);
        if (accountRequest == null) {
            log.error("AccountRequest was already deleted.");
            res.setRenderParameter("message", "Account was already deleted.");
            return;
View Full Code Here

        log.debug("Entered sendRenewalNotice");
        PortletRequest req = event.getActionRequest();
        ActionResponse res = event.getActionResponse();

        String oid = event.getAction().getParameter("oid");
        AccountRequest accountRequest =
            accountService.getAccountRequestByOid(oid);
        if (accountRequest == null) {
            log.error("AccountRequest was already deleted.");
            res.setRenderParameter("message", "Account was already deleted.");
            return ;
View Full Code Here

        log.debug("Entered sendActivationInstruction");
        PortletRequest req = event.getActionRequest();
        ActionResponse res = event.getActionResponse();

        String oid = event.getAction().getParameter("oid");
        AccountRequest accountRequest =
            accountService.getAccountRequestByOid(oid);
        if (accountRequest == null) {
            log.error("AccountRequest was already deleted.");
            res.setRenderParameter("message", "Account was already deleted.");
            return ;
View Full Code Here

TOP

Related Classes of org.geogrid.aist.tsukubagama.services.request.AccountRequest

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.