Results 1 to 10 of 12

Thread: ZmMailMsg

Hybrid View

  1. #1
    Join Date
    Jan 2007
    Posts
    31
    Rep Power
    8

    Default ZmMailMsg

    I have a zimlet javascript that is processing
    a ZmConv when I drop an email onto my zimlet.

    The problem I am having is how do I get a ZmMailMsg
    from the ZmConv?? I want to have access to the
    attachments and the mime mail message.

    In my javascript I tried:

    var msg = new ZmMailMsg(this._appCtxt, conv.id);

    conv.id is the msgId from the ZmConv.

    This did not yield the ZmMailMsg. I have done a checkout from
    SVN to look at examples, however nothing is registering. Any help
    would be appreciated.

    Thanx Joe

  2. #2
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    19

    Default

    http://zimbra.svn.sourceforge.net/vi...odel/ZmConv.js

    ZmConv has a load method to load the messages in it. Then use ZmConv.prototype.getFirstMsg to get the First. See that code to find the internal vars that hold the rest of the messages.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  3. #3
    Join Date
    Sep 2005
    Location
    Sunnyvale, CA
    Posts
    269
    Rep Power
    10

    Default

    Joe,

    Try checking out the Google Translator zimlet. It works by dragging a conversation onto the zimlet which then grabs the first message from the conversation and sends the contents to the translator.

    Sounds like this will help move you along.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  4. #4
    Join Date
    Jan 2007
    Posts
    31
    Rep Power
    8

    Default

    I must be an idiot, but none of these responses make sense!!!

    Here is the doDrop() code from the G Translator. Where is
    the Mail message being extracted???

    Can someone just sent me an example instead of just throwing ideas around the do not make sense?? I just want to get the Mail message out so I can pull out the attachments!!

    Com_Zimbra_Gtranslator.prototype.doDrop =
    function(zmObject) {
    this._zmObject = zmObject;
    this._isUserInput = false;

    // create a dialog if one does not already exist
    if (!this._gTranslatorDialog) {
    this._initialize();
    }

    // reset widgets
    this._contentDIV.innerHTML = AjxStringUtil.nl2br(this._zmObject.body);
    this._contentTA.style.visibility = "hidden";
    this._contentDIV.style.visibility = "visible";

    // reset widgets so user can read translated text
    this._langSelect.setSelected(0);

    this._gTranslatorDialog.popup();
    };

  5. #5
    Join Date
    Jan 2007
    Posts
    31
    Rep Power
    8

    Default

    Again,

    From My javascript file, how do I call

    ZmConv.prototype._loadMsgs =
    function(convNode) {
    // for all messages in this conversation,
    var childNodes = convNode.childNodes;
    var len = childNodes.length;
    for (var i = 0; i < len; i++) {
    if (childNodes[i].nodeName == "m")
    this.msgs.addFromDom(childNodes[i]);
    }
    };

    What do I pass in as a convNode??

    An Javascript sample of getting the ZmMailMsg from a ZmConv would be nice.

  6. #6
    Join Date
    Jan 2007
    Posts
    31
    Rep Power
    8

    Default

    Here is my Javascript being called when a ZmConv is dropped on my Zimlet.

    Com_Xythos_XythosZimlet.prototype.noteDropped = function(note) {

    this.login();

    DBG.println(AjxDebug.DBG1, "Processing Note ...");



    // Lets get the Email Message

    ZmConv.prototype._loadMsgs(note);

    var msg = ZmConv.prototype.getFirstMsg();


    When I call the _loadMsgs() ... I get _1608 has no properties Error

  7. #7
    Join Date
    Jul 2006
    Location
    Virginia Beach, VA
    Posts
    97
    Rep Power
    9

    Default Extracting from

    I could not get the ZmConv.prototype.getHotMsg function to work either.
    I want to seperate out the from from the conversation messages.
    The best way would be if it's a conversation, if the getHotMsg actually worked, use it to get an ID then get the message via id.

    I think obj.id returns the same number in both conv or msg, except conv has negative sign in front. -1403 in conv and 1403 in msg. But someone may want to test.

    This is how I'm getting around it.

    if (obj.TYPE = "ZmMailMsg"){
    this.email_from = obj.from;

    }
    if (obj.TYPE = "ZmConv"){
    this.email_from = obj.participants[0];

    }
    EricX

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •