KB 1886        Last updated on 2015-07-13  

(0 votes)

Rough Draft, I have to go.

If your a php programmer, this will really help out. If your already a strong object oriented programmer, hopefully this can save some time hunting down functions and classes.

I'm starting with ZmMailMsg.js and going backwards. PHP is rather weak on the idea of objects and the concept of inheritance. Basically it's like the layers in an onion. You have to peel off one layer so you can get to the layer underneath. I will be going through the layers here trying to explain where different things come from.

ZmMailMsg.js is the outside layer of your onion.

on line 53 of ZmMailMsg.js we see ZmMailMsg.prototype = new ZmMailItem;. ZmMailItem is the next layer down. If we open ZmMailItem we see on line 62 ZmItem.prototype = new ZmModel;. ZmModel is the next layer down in our onion.

Here is our Direct Line outline from the beginning. If a function in a class creates a new instance of some other class, that is not in our direct line, but a branch.

ZmMailMsg.js ZmMailItem.js ZmItem.js ZmModel.js ZmEvent.js and AjxEventMrg and same time.

This is as far as I'm going to go for now.

If I scan through ZmMailMsg.js, I see out of nowhere this.participants. What type is it, how does the participants.removeAll(); work. We have to start pealing down our onion.


Participants and ZmMailItem.js

Participants are all the people involved in an email message. The functions used in ZmMailMsg.js are found in ZmMailItem.js. On line 110 we can see that participants is type AjxVector(). If we want to find out all the things we can do with type AjxVector, just open AjxVector.js. But this is a branch so lets go back to the direct line and chase some other objects down.

Email FROM, TO, CC, BCC, Reply_To, SENDER

Line 44 we have this._addrs = new array();. Then we have this loop. The loop is pointing to ZmMailMsg.ADDRS which comes farther down in our code? Welcome to object oriented code, well sort of. One way to think about this is the start of our code really begins with ZmMailMsg.prototype = new ZmMailItem; which starts a chain reaction of creating new whatever down our list of .js files listed above. Or drilling down through the layers of the onion.

So, Simply this._addrs is really just an array of ... uh, I don't know. I've looked up and down the chain and I can't find anything.

But wait! There is ZmMailAssistant.js which is built on ZmAssistant.js.

The From, To, CC, BCC, and other stuff is processed in ZmMailAssistant.js. The new message starts in ZmMailAssistant.js. I think...

Verified Against: Unknown Date Created: 2/15/2007
Article ID: Date Modified: 2015-07-13

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search