use of com.zimbra.client.ZJSONObject in project zm-mailbox by Zimbra.
the class ZModifyMessageEvent method toZJSONObject.
public ZJSONObject toZJSONObject() throws JSONException {
try {
ZJSONObject zjo = new ZJSONObject();
zjo.put("id", getId());
if (getConversationId(null) != null)
zjo.put("conversationId", getConversationId(null));
if (getFlags(null) != null)
zjo.put("flags", getFlags(null));
if (getTagIds(null) != null)
zjo.put("tags", getTagIds(null));
if (getFolderId(null) != null)
zjo.put("folderId", getFolderId(null));
return zjo;
} catch (ServiceException se) {
throw new JSONException(se);
}
}
use of com.zimbra.client.ZJSONObject in project zm-mailbox by Zimbra.
the class ZModifyTagEvent method toZJSONObject.
public ZJSONObject toZJSONObject() throws JSONException {
try {
ZJSONObject zjo = new ZJSONObject();
zjo.put("id", getId());
String name = getName(null);
if (name != null)
zjo.put("name", name);
if (getColor(null) != null)
zjo.put("color", getColor(null).name());
if (getUnreadCount(-1) != -1)
zjo.put("unreadCount", getUnreadCount(-1));
return zjo;
} catch (ServiceException se) {
throw new JSONException(se);
}
}
use of com.zimbra.client.ZJSONObject in project zm-mailbox by Zimbra.
the class ZRefreshEvent method toZJSONObject.
public ZJSONObject toZJSONObject() throws JSONException {
ZJSONObject zjo = new ZJSONObject();
zjo.put("size", getSize());
zjo.put("userRoot", mUserRoot);
zjo.put("tags", mTags);
return zjo;
}
use of com.zimbra.client.ZJSONObject in project zm-mailbox by Zimbra.
the class ZContactEvent method toZJSONObject.
public ZJSONObject toZJSONObject() throws JSONException {
ZJSONObject zjo = new ZJSONObject();
try {
zjo.put("id", getId());
if (getFlags(null) != null)
zjo.put("flags", getFlags(null));
if (getTagIds(null) != null)
zjo.put("tags", getTagIds(null));
if (getFolderId(null) != null)
zjo.put("folderId", getFolderId(null));
if (getRevision(null) != null)
zjo.put("revision", getRevision(null));
if (getFileAsStr(null) != null)
zjo.put("fileAsStr", getFileAsStr(null));
if (getEmail(null) != null)
zjo.put("email", getEmail(null));
if (getEmail2(null) != null)
zjo.put("email2", getEmail2(null));
if (getEmail3(null) != null)
zjo.put("email3", getEmail3(null));
Map<String, String> attrs = getAttrs(null);
if (attrs != null)
zjo.putMap("attrs", attrs);
} catch (ServiceException e) {
throw new RuntimeException(e);
}
return zjo;
}
use of com.zimbra.client.ZJSONObject in project zm-mailbox by Zimbra.
the class ZConversationSummaryEvent method toZJSONObject.
public ZJSONObject toZJSONObject() throws JSONException {
try {
ZJSONObject zjo = new ZJSONObject();
zjo.put("id", getId());
if (getFlags(null) != null)
zjo.put("flags", getFlags(null));
if (getTagIds(null) != null)
zjo.put("tags", getTagIds(null));
if (getSubject(null) != null)
zjo.put("subject", getSubject(null));
if (getFragment(null) != null)
zjo.put("fragment", getFragment(null));
if (getMessageCount(-1) != -1)
zjo.put("messageCount", getMessageCount(-1));
if (getDate(-1) != -1)
zjo.put("date", getDate(-1));
List<ZEmailAddress> addrs = getRecipients(null);
if (addrs != null)
zjo.put("recipients", addrs);
return zjo;
} catch (ServiceException se) {
throw new JSONException(se);
}
}
Aggregations