use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method sendMessage.
public ZSendMessageResponse sendMessage(ZOutgoingMessage message, String sendUid, boolean needCalendarSentByFixup) throws ServiceException {
Element req = newRequestElement(MailConstants.SEND_MSG_REQUEST);
if (sendUid != null && sendUid.length() > 0) {
req.addAttribute(MailConstants.A_SEND_UID, sendUid);
}
if (needCalendarSentByFixup) {
req.addAttribute(MailConstants.A_NEED_CALENDAR_SENTBY_FIXUP, needCalendarSentByFixup);
}
ZMountpoint mountpoint = getMountpoint(message);
//noinspection UnusedDeclaration
getMessageElement(req, message, mountpoint);
String requestedAccountId = mountpoint == null ? null : mountpoint.getOwnerId();
Element resp = invoke(req, requestedAccountId);
Element msg = resp.getOptionalElement(MailConstants.E_MSG);
String id = msg == null ? null : msg.getAttribute(MailConstants.A_ID, null);
return new ZSendMessageResponse(id);
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZShare method toElement.
public Element toElement(Element parent) {
Element e = parent.addElement(E_SHARE);
e.addAttribute(A_VERSION, mVersion);
e.addAttribute(A_ACTION, mAction.toString());
if (mGrantee != null)
mGrantee.toElement(e);
if (mGrantor != null)
mGrantor.toElement(e);
if (mLink != null)
return mLink.toElement(e);
return e;
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZSearchResult method init.
private void init(Element resp, Element el, TimeZone tz) throws ServiceException {
sortBy = resp.getAttribute(MailConstants.A_SORTBY);
hasMore = resp.getAttributeBool(MailConstants.A_QUERY_MORE);
offset = (int) resp.getAttributeLong(MailConstants.A_QUERY_OFFSET, -1);
hits = new ArrayList<ZSearchHit>();
for (Element h : el.listElements()) {
if (h.getName().equals(MailConstants.E_CONV)) {
hits.add(new ZConversationHit(h));
} else if (h.getName().equals(MailConstants.E_MSG)) {
hits.add(new ZMessageHit(h));
} else if (h.getName().equals(MailConstants.E_CONTACT)) {
hits.add(new ZContactHit(h));
} else if (h.getName().equals(MailConstants.E_APPOINTMENT)) {
ZAppointmentHit.addInstances(h, hits, tz, false);
} else if (h.getName().equals(MailConstants.E_TASK)) {
ZAppointmentHit.addInstances(h, hits, tz, true);
} else if (h.getName().equals(MailConstants.E_DOC)) {
hits.add(new ZDocumentHit(h));
} else if (h.getName().equals(MailConstants.E_WIKIWORD)) {
hits.add(new ZWikiHit(h));
} else if (h.getName().equals(VoiceConstants.E_VOICEMSG)) {
hits.add(new ZVoiceMailItemHit(h));
} else if (h.getName().equals(VoiceConstants.E_CALLLOG)) {
hits.add(new ZCallHit(h));
}
}
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZSelectiveCallForwarding method fromElement.
synchronized void fromElement(Element element) throws ServiceException {
super.fromElement(element);
mForwardFrom = new ArrayList<String>();
for (Element fromEl : element.listElements(VoiceConstants.E_PHONE)) {
mForwardFrom.add(fromEl.getAttribute(VoiceConstants.A_PHONE_NUMBER));
}
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZSelectiveCallForwarding method toElement.
void toElement(Element element) throws ServiceException {
super.toElement(element);
for (String name : mForwardFrom) {
Element fromEl = element.addElement(VoiceConstants.E_PHONE);
fromEl.addAttribute(VoiceConstants.A_PHONE_NUMBER, name);
fromEl.addAttribute(VoiceConstants.A_ACTIVE, "true");
}
}
Aggregations