Package com.dotcms.repackage.org.apache.struts.action

Examples of com.dotcms.repackage.org.apache.struts.action.ActionMessage


          parameters.put("from", company.getEmailAddress());
         
          EmailFactory.sendParameterizedEmail(parameters, null, host, user);
         
          ActionMessages msg = new ActionMessages();
                msg.add(Globals.MESSAGE_KEY, new ActionMessage("message.challenge_question.answer_successful", email));
                saveMessages(request.getSession(), msg);
                if(UtilMethods.isSet(referrer)) {
                return (new ActionForward(SecurityUtils.stripReferer(request, referrer + "?" + request.getQueryString())));
                } else {
                  return mapping.findForward("passwordChangeConfirmationPage");
                }
        } catch (Exception e) {
              ActionMessages msg = new ActionMessages();
                msg.add(Globals.ERROR_KEY, new ActionMessage("error.send_email"));
                request.setAttribute(Globals.ERROR_KEY, msg);
                return mapping.findForward("challengeQuestionPage");
        }
          } else {
            ActionMessages msg = new ActionMessages();
              msg.add(Globals.ERROR_KEY, new ActionMessage("message.challenge_question.answer_failure"));
              request.setAttribute(Globals.ERROR_KEY, msg);
              fpf.setAccKey(PublicEncryptionFactory.encryptString(user.getUserId()));
              fpf.setEmail(user.getEmailAddress());
             
              return mapping.findForward("challengeQuestionPage");
          }
    } catch (Exception e) {
      Logger.debug(this, "Failed - Redirecting to: loginPage");
          ActionErrors errors = new ActionErrors();
          errors.add(Globals.ERROR_KEY, new ActionMessage("error.send_email"));
          request.setAttribute(Globals.ERROR_KEY, errors);
         
          return mapping.findForward("loginPage");
    }
    }
View Full Code Here


      // the user is active
      // sending Reset Password Email
      sendResetPasswordEmail(user, request);
 
      am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("send.reset.password.email.confirmation"));
      saveMessages(request.getSession(), am);
      return mapping.findForward("emailSentConfirmationPage");

    }

    // the user does not exists
    am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.user.not.exist"));
    saveMessages(request, am);
    return mapping.findForward("loginAction");
  }
View Full Code Here

          LoginFactory.doLogin(user.getEmailAddress(), form.getNewPassword(), false, request, response);
        } else {
          LoginFactory.doLogin(user.getUserId(), form.getNewPassword(), false, request, response);
        }

        am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message.forgot.password.password.updated"));
        saveMessages(request, am);
        return mapping.findForward("passwordChangeConfirmationPage");
      }
      else {
        // the reset password email link has expired,
        // it's needed to resend the reset password email
        return sendResetPassword(mapping, lf, request, response);
      }

    }

    // the user does not exists
    am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.user.not.exist"));
    saveMessages(request, am);
    return mapping.findForward("loginPage");
  }
View Full Code Here

                LoginFactory.doLogin(user.getEmailAddress(), user.getPassword(), false, request, response);
              } else {
                LoginFactory.doLogin(user.getUserId(), user.getPassword(), false, request, response);
              }
         
          am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message.account.user.activated"));
          saveMessages(request.getSession(), am);
          ActionForward forward = mapping.findForward("confirmation");
          return forward;
        }
        else {
          // resending activation account link
          request.setAttribute("userId", user.getUserId());
          return mapping.findForward("resendPage");
        }
      }
      else {
        am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message.account.user.already.active"));
        saveMessages(request.getSession(), am);
        ActionForward forward = mapping.findForward("confirmation");
        return forward;
      }
    }

    // the user does not exists
    am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("errors.user.not.exist"));
    saveMessages(request.getSession(), am);
    return mapping.findForward("loginPage");
  }
View Full Code Here

    // sending Account Activation Email
    sendActivationAccountEmail(user, request);

    //make the redirect
    ActionMessages am = new ActionMessages();
    am.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message.account.activation.email.sent"));
    saveMessages(request.getSession(), am);
    return mapping.findForward("confirmation");
  }
View Full Code Here

    loadUserInfoInRequest(form, userId, request);

        request.getSession().removeAttribute(WebKeys.LOGGED_IN_USER_CATS);

    ActionMessages msg = new ActionMessages();
        msg.add(Globals.MESSAGE_KEY, new ActionMessage("message.interests.saved"));
        request.setAttribute(Globals.MESSAGE_KEY, msg);

        return mapping.findForward("myInterestsPage");
  }
View Full Code Here

            //if we don't have a redirect yet
            session.setAttribute(WebKeys.REDIRECT_AFTER_LOGIN, request.getRequestURI() + "?" + request.getQueryString());

            ActionMessages ams = new ActionMessages();
            ams.add(Globals.MESSAGE_KEY, new ActionMessage("message.login.required"));
            session.setAttribute(Globals.MESSAGE_KEY, ams);
            response.sendError(401);
            return;
        }
View Full Code Here

        if (!InodeUtils.isSet(parentFolder.getInode())) {
          User systemUser;
          systemUser = APILocator.getUserAPI().getSystemUser();
          Host host = APILocator.getHostAPI().find(inode, systemUser, false);
          if (host != null && InodeUtils.isSet(host.getInode())) {
            ae.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("message.folder.ishostfolder"));
          }
        }
      }
      return ae;
    } catch (Exception e) {
View Full Code Here

          ActionErrors ae = new ActionErrors ();

          Logger.debug(this, "Saving UserInfo");
         
          if(!_isNewUser(userForm.getUserID())){
            ae.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.userExists",""));
            req.setAttribute(Globals.ERROR_KEY,ae);
            setForward(req, "portlet.ext.usermanager.register_user");
            HibernateUtil.commitTransaction();
            return;
          }

          ///Validate Form
          if (!Validator.validate(req, form, mapping)) {
            Logger.debug(this, "Form Validation Failed");
            req.setAttribute(WebKeys.USERMANAGER_EDIT_FORM, form);
           
            setForward(req, "portlet.ext.usermanager.register_user");
            return;
          } else {
            try {
              userForm = (UserManagerForm) form;
              ae = new ActionErrors ();
              if(!UtilMethods.isSet(userForm.getUserID()))
              {
                if(!validateUniqueEmail(userForm.getEmailAddress()))
                {
                  ae.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.forgotPasswordClickHere","javascript:forgotPassword();"));
                }
              }

              String userId = null;
View Full Code Here

    User user = APILocator.getUserAPI().loadByUserByEmail(userForm.getEmailAddress(), APILocator.getUserAPI().getSystemUser(), false);
    if(user.isNew())
    {
      aes = new ActionErrors();
      aes.add(Globals.ERROR_KEY, new ActionMessage("error.forgotPasswordUserNotFound"));
      request.setAttribute(Globals.ERROR_KEY,aes);
      return;
    }
    String pass = PublicEncryptionFactory.getRandomPassword();
    user.setPassword(PublicEncryptionFactory.digestString(pass));
    APILocator.getUserAPI().save(user,APILocator.getUserAPI().getSystemUser(),false);
    Host host = WebAPILocator.getHostWebAPI().getCurrentHost(request);
    EmailFactory.sendForgotPassword(user, pass, host.getIdentifier());

    aes = new ActionErrors();
    aes.add(Globals.ERROR_KEY, new ActionMessage("error.forgotPasswordMailSend"));
    request.setAttribute(Globals.ERROR_KEY,aes);
    return;
  }
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.apache.struts.action.ActionMessage

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.