Package net.sourceforge.stripes.action

Examples of net.sourceforge.stripes.action.RedirectResolution


          tckt.changeBillNote(getSession(), getBillNoteId());
        }
      }
      tckt.save(getSession(), getSessionAttribute("user_uuid"), getProcessed(), false);
      disconnect();
      return new RedirectResolution(ListNewBillNotes.class);
      } catch (StorageException e) {
      setParam("id", getId());
        Log.out.error("EditBillNote.save() "+e.getClass().getName()+" "+e.getMessage());
      getContext().getMessages().add(new SimpleMessage("ERROR "+e.getMessage()));
      return new RedirectResolution(CaptureBillNote.class);
      } finally { close(); }
    }
View Full Code Here


      } catch (StorageException e) {
      setParam("id", getId());
        Log.out.error("EditBillNote.reopen() "+e.getClass().getName()+" "+e.getMessage());
      getContext().getMessages().add(new SimpleMessage("ERROR "+e.getMessage()));
      } finally { close(); }
      return new RedirectResolution("/EditBillNote.action?id="+getId());
    }
View Full Code Here

    return new ForwardResolution(sFwd);
  }

  @DontValidate
  public Resolution cancel() {
    return new RedirectResolution(CaptureInvoice.class);
  }
View Full Code Here

 
  public Resolution save() {
    Log.out.debug("Begin EditInvoice.save()");
    Invoice oInv = saveInvoice();
    Dms oDms;
    Resolution oRes = new RedirectResolution(ListNewInvoices.class);
    try {
      connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
      oDms = getSession().getDms();
      SortableList<Document> oNext = oDms.query("(Invoice$is_processed='0') & (Invoice$recipient_taxpayer='"+getRecipientTaxPayer()+"')");
      if (!oNext.isEmpty()) {
        oRes = new RedirectResolution("/EditInvoice.action?a=0&id="+oNext.get(0).id());
        setParam("former_id", getId());
      }
      disconnect();
      if (oInv.hasMistakes()) {
        connect();
View Full Code Here

      setApproved(true);
      setProcessed(true);
      setMistakes(false);
      saveInvoice();
      Dms oDms;
      Resolution oRes = new RedirectResolution(ListPendingInvoices.class);
      try {
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        oDms = getSession().getDms();
        SortableList<Document> oNext = oDms.query("(Invoice$is_processed='1') & (Invoice$is_approved='0') & (Invoice$recipient_taxpayer='"+getRecipientTaxPayer()+"')");
        if (!oNext.isEmpty()) {
          oRes = new RedirectResolution("/EditInvoice.action?a=1&id="+oNext.get(0).id());
          setParam("former_id", getId());
        }
        disconnect();
      } catch (Exception e) {
        Log.out.error("Invoice.approve()"+e.getClass().getName()+" "+e.getMessage());
View Full Code Here

      setApproved(false);
      setProcessed(false);
      setMistakes(true);
      Invoice oInv = saveInvoice();
      Dms oDms;
      Resolution oRes = new RedirectResolution(ListPendingInvoices.class);
      try {
        connect();
        oDms = getSession().getDms();
        Log.out.debug("Dms.query((Invoice$is_processed='1') & (Invoice$is_approved='0') & (Invoice$recipient_taxpayer='"+getRecipientTaxPayer()+"'))");
        SortableList<Document> oNext = oDms.query("(Invoice$is_processed='1') & (Invoice$is_approved='0') & (Invoice$recipient_taxpayer='"+getRecipientTaxPayer()+"')");
        if (!oNext.isEmpty()) {
          oRes = new RedirectResolution("/EditInvoice.action?a=1&id="+oNext.get(0).id());
          setParam("former_id", getId());
        }
        User oMe = new User(getSession(), getSessionAttribute("user_docid"));
        User oTo = new User(getSession(), User.forUuid(oInv.getString("captured_by")));
        Messages.notify(getSession(), oMe.getFirstName()+" "+oMe.getLastName(),
View Full Code Here

      }
      return new ForwardResolution(FORM);
    } catch (Exception e) {
      Log.out.error("CaptureBillNote.form() "+e.getClass().getName()+" "+e.getMessage());
      getContext().getMessages().add(new SimpleMessage("ERROR "+e.getMessage()));
      return new RedirectResolution(CaptureBillNote.class);
    } finally { close(); }
  }
View Full Code Here

    uid = getParam("uid","");
    passw = getParam("pwd","");
    changepassw = passw.length()>0;
   
    if (id.length()==0)
      return new RedirectResolution("/error.jsp?e=usernotfound");
    if (uid.length()==0 && passw.length()==0)
      return new RedirectResolution("/error.jsp?e=userdatanotfound");
   
    try {
      oSessionInfo = Cache.getEntryMap(id+"activationinfo");
    } catch (Exception xcpt) {
      oSessionInfo = null;
    }

    if (oSessionInfo!=null) {

      setSessionAttributes(oSessionInfo);
      email = (String) oSessionInfo.get("email");
      hasorders = ((Boolean) oSessionInfo.get("hasorders")).booleanValue();
      if (!changepassw) {
        try {
          connect();
          oUser = new User(getSession(), id);
          oUser.activate();
          oUser.save(getSession());
          DAO.log(User.class, "ACTIVATE USER", AtrilEvent.Level.INFO, email+";"+id+";"+uid);
          disconnect();
        } catch (StorageException stge) {
          Log.out.error("ActivateUser.form() "+stge.getClass().getName()+" "+stge.getMessage(), stge);
        } finally {
          close();
        }
      }
      try {
        Cache.deleteEntry(id+"activationinfo");
      } catch (SQLException ignore) { }
     
    } else {
      try {
        connect();
        oUser = new User(getSession(), id);
        if (!oUser.getNickName().equals(uid) && !oUser.getPassword().equals(passw))
          throw new AuthenticationException("User Id. does not match UUID or Password");
        email = oUser.getEmail();
        if (!changepassw) {
          oUser.activate();
          oUser.save(getSession());
          DAO.log(User.class, "ACTIVATE USER", AtrilEvent.Level.INFO, email+";"+id+";"+uid);
        }
        CustomerAccount oCacc = new CustomerAccount(getSession(), oUser);
        Employee oEmpl = new Employee();
        String sEmpl = null;
        if (oEmpl.exists(getSession(), "employee_uuid", oUser.getNickName())!=null)
          sEmpl = oUser.getNickName();
        setSessionAttributes(oUser, oCacc, oCacc.taxpayers(getSession()).byDefault(getSession(),oUser),sEmpl);
        hasorders = (oCacc.orders(getSession()).count()>0);
        disconnect();       
        } catch (AuthenticationException acpt) {
          DAO.log(User.class, "ACTIVATE USER", AtrilEvent.Level.WARNING, email+";"+id+";"+uid);
          Log.out.warn("ActivateUser.form() "+acpt.getClass().getName()+" "+acpt.getMessage(), acpt);
          return new RedirectResolution("/error.jsp?e=systemsecurity");
        } catch (StorageException stge) {
          Log.out.error("ActivateUser.form() "+stge.getClass().getName()+" "+stge.getMessage(), stge);
          return new RedirectResolution("/error.jsp?e=errorindatabaseaccess");
        } finally {
          close();
        }
     
      }
View Full Code Here

      DAO.log(User.class, "ACTIVATE USER", AtrilEvent.Level.INFO, email+";"+id+";"+uid);
      disconnect();
      setSessionAttribute("password", getPassword());
    } catch (Exception xcpt) {
      Log.out.error("ActivateUser.save() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
      return new RedirectResolution("/error.jsp?e=errorindatabaseaccess");
    } finally {
      close();
    }
    return new RedirectResolution(CaptureInvoice.class);
  }
View Full Code Here

  }

  private Resolution resolve(Class oCls, String sErrCode, String sLastURL) {
    Resolution oRes;
    if (isAjaxBean(oCls)) {
      oRes = new RedirectResolution("/ajaxerror.jsp?e="+sErrCode);     
    } else {
      oRes = new RedirectResolution("/enter.jsp?e="+sErrCode);
      if (sLastURL!=null)
        ((RedirectResolution) oRes).addParameter("lastUrl" , sLastURL);   
    }
    return oRes;
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.action.RedirectResolution

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.