Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-24-2007, 03:16 PM
Project Contributor
 
Posts: 31
Default Zimlet Email Processing

I want to drap and drop an email from the Inbox into my Zimlet. The Object type I am getting a ZmConv. I actually expected to get the ZmMailMsg. Why is it be treated as such?? How do I get to the emal message and attachments to the email message? Also, is there way to convert the email message to an XML format for offline storage?? I want to take the entire email and attachments and store them to an offline storage area for archiving.

Thanx Joe
Reply With Quote
  #2 (permalink)  
Old 01-25-2007, 05:04 PM
Zimlet Guru & Moderator
 
Posts: 467
Default

Quote:
Originally Posted by jfavero View Post
I want to drap and drop an email from the Inbox into my Zimlet. The Object type I am getting a ZmConv. I actually expected to get the ZmMailMsg. Why is it be treated as such?? How do I get to the emal message and attachments to the email message? Also, is there way to convert the email message to an XML format for offline storage?? I want to take the entire email and attachments and store them to an offline storage area for archiving.

Thanx Joe
ZmConv is the "Conversation" (ie, threaded mail messages) that was dragged over. ZmConv is actually derived from ZmMailItem item, which means you should be able to access it just like a regular message.

According to the notes in ZmConv.js (if you haven't done a SVN checkout of the Zimbra tree, grab it. Javascript is surprisingly readable) the following messages on the conv will return the messages:
getHotMsg -- Returns the searched for message, or the newest message.
getFirstMsg -- Should be pretty obvious.

.msgs should contain the rest of the messages.

Note: I haven't tried this yet, but go ahead and give it a shot and let me know what you find. Also note that ZmMailItem consists of multiple parts, attachments, etc. That could be hairy, and you may want to look at the JSP taglib rather then pure javascript to see if that is a easier way to go about it.
Reply With Quote
  #3 (permalink)  
Old 01-26-2007, 06:46 PM
Project Contributor
 
Posts: 31
Default

I have pulled the source code from SVN, however I still am having problems understanding how this all works.

I have a ZmConv (Conversation) object. How do I access the attachements, from/to addresses etc.

I tried

zmConv.firstMsg to get the first message, however this is undefined.

I have looked at the java classes, Conversation and Mailitem, however I am not sure how they map to what is exposed in the JavaScript. Can you provide an example of getting the list of FROM addresses from a ZmConv??

Thanx Joe
Reply With Quote
  #4 (permalink)  
Old 02-20-2007, 08:08 PM
Loyal Member
 
Posts: 97
Default Workaround

I got around it by only allowing the mail message to drag and drop.
I've just finished basically what you are trying to do.
<dragSource type="ZmMailMsg" />

If you read the wiki, I posted code to extract the email using REST commands.
The code on my wiki ends with the files on the web server, I was able to use php ftp class to move the files to the project folders on the windows server.

I'm on an intranet so I can get away with some of these things. I think I'd do it a bit differently if I were live on the net.


http://wiki.zimbra.com/index.php?title=Zimbra_to_PHP
__________________
EricX
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.