Package org.jresearch.gossip.forms

Examples of org.jresearch.gossip.forms.SubscribeForm


      throws SystemException {
    ForumDAO dao = ForumDAO.getInstance();
    HttpSession session = request.getSession();
    ActionErrors errors = new ActionErrors();
    MessageResources messages = getResources(request);
    SubscribeForm sForm = (SubscribeForm) form;
    User user = (User) session.getAttribute(IConst.SESSION.USER_KEY);
    String uname = null;
    String inputForward = null;
    String email = null;
    if (user.getStatus() == 0) {
      inputForward = "unsubscribe";
      if ((sForm.getEmail() == null) || sForm.getEmail().equals("")) {
        errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(
            "errors.required", new Object[]{messages
                .getMessage("user.U_MAIL")}));
        saveErrors(request, errors);
        return (mapping.findForward(inputForward));
      } else {
        email = sForm.getEmail();
        uname = "<%>";
      }
    } else {
      inputForward = "subscriptions";
      uname = user.getName();
      email = user.getInfo().getEmail();
    }
    try {
     
      if (dao.unsubscribe(email, uname, sForm.getTid())) {
        if (user.getStatus() == 0) {
          setStatusMessage(request, "mails.OK1");
        }
      } else if (user.getStatus() == 0) {
        errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(
View Full Code Here

TOP

Related Classes of org.jresearch.gossip.forms.SubscribeForm

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.