Package com.zesped.model

Examples of com.zesped.model.Message


  public Resolution form() {
    final String sId = getParam("id");
    final String sUid = getSessionAttribute("user_uuid");
    try {
      connect();
        msg = new Message(getSession().getDms(), sId);
        if (!msg.getReaded()) {
          msg.setReaded(true);
          msg.save(getSession());
        }
        if (msg.getRelatedDocument()!=null) {
          if (msg.getRelatedDocument().length()>0) {
            lnk = "Edit"+getSession().getDms().getDocument(msg.getRelatedDocument()).type().name()+".action?a=0&id="+msg.getRelatedDocument();
          }
        }
        disconnect();
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
      } finally {
        close();
      }
    if (!msg.getStringNull("sender_id", "").equals(sUid) && !msg.getStringNull("recipient_id", "").equals(sUid)) {
        Log.out.error("SecurityException user "+sUid+" is trying to view message "+sId+" which is not for him");
      msg = new Message();
    }
    return new ForwardResolution(FORM);
  }
View Full Code Here


  public Resolution archive() {
    final String sId = getParam("id");
    if (getErrorsCount()==0) {
      try {
        connect();
        Message oMsg = new Message(getSession().getDms(), sId);
        oMsg.archive(getSession());
        disconnect();
          addDataLine("id",oMsg.id());
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
        addError(new SimpleError(xcpt.getMessage()));
      } finally {
        close();
View Full Code Here

    if (getErrorsCount()==0) {
      try {
        connect();
        User oMe = new User(getSession(), getSessionAttribute("user_docid"));
        User oRe = new User(getSession(), User.forUuid(sReciptId));
        Message oMsg = Messages.reply(getSession(), sThreadId,
                        oMe.getFullName(), oMe.getEmail(), oMe.getNickName(),
                             oRe.getEmail(), oRe.getNickName(), sSubject, sBody);
        disconnect();
          addDataLine("id",oMsg.id());
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
        addError(new SimpleError(xcpt.getMessage()));
      } finally {
        close();
View Full Code Here

    final String sId = getParam("id");
    final String sUid = getSessionAttribute("user_uuid");
    if (getErrorsCount()==0) {
      try {
        connect();
        Message oMsg = new Message(getSession().getDms(), sId);
        if (oMsg.getStringNull("sender_id", "").equals(sUid) || oMsg.getStringNull("recipient_id", "").equals(sUid))
          Message.delete(getSession(), sId);
        disconnect();
          addDataLine("id",sId);
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
View Full Code Here

  public Resolution form() {
    id = getParam("id");
    action = getParam("a","r").equals("f") ? "forward" : "reply";
    try {
      connect();
      setMessage(new Message(getSession().getDms(), id));
      CustomerAccount cac = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
      recipients = cac.getUsers(getSession());
      disconnect();
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
View Full Code Here

TOP

Related Classes of com.zesped.model.Message

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.