use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method getAvailableSkins.
public List<String> getAvailableSkins() throws ServiceException {
Element req = newRequestElement(AccountConstants.GET_AVAILABLE_SKINS_REQUEST);
Element resp = invoke(req);
List<String> result = new ArrayList<String>();
for (Element skin : resp.listElements(AccountConstants.E_SKIN)) {
String name = skin.getAttribute(AccountConstants.A_NAME, null);
if (name != null) {
result.add(name);
}
}
Collections.sort(result);
return result;
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method invokeJaxbOnTargetAccount.
@SuppressWarnings("unchecked")
public <T> T invokeJaxbOnTargetAccount(Object jaxbObject, String requestedAccountId) throws ServiceException {
Element req = JaxbUtil.jaxbToElement(jaxbObject);
Element res = invoke(req, requestedAccountId);
return (T) JaxbUtil.elementToJaxb(res);
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method deleteSignature.
public synchronized void deleteSignature(String id) throws ServiceException {
Element req = newRequestElement(AccountConstants.DELETE_SIGNATURE_REQUEST);
req.addElement(AccountConstants.E_SIGNATURE).addAttribute(AccountConstants.A_ID, id);
invoke(req);
updateSigs();
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method getAppointment.
public ZAppointment getAppointment(String id) throws ServiceException {
Element req = newRequestElement(MailConstants.GET_APPOINTMENT_REQUEST);
req.addAttribute(MailConstants.A_ID, id);
req.addAttribute(MailConstants.A_SYNC, true);
return new ZAppointment(invoke(req).getElement(MailConstants.E_APPOINTMENT));
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method addMessage.
/**
* @param folderId (required) folderId of folder to add message to
* @param flags non-comma-separated list of flags, e.g. "sf" for "sent by me and flagged",
* or <tt>null</tt>
* @param tags coma-spearated list of tags, or null for no tags, or <tt>null</tt>
* @param receivedDate time the message was originally received, in MILLISECONDS since the epoch,
* or <tt>0</tt> for the current time
* @param content message content
* @param noICal if TRUE, then don't process iCal attachments.
* @param filterSent if TRUE, then do outgoing message filtering
* @return ID of newly created message
* @throws com.zimbra.common.service.ServiceException on error
*/
public String addMessage(String folderId, String flags, String tags, long receivedDate, String content, boolean noICal, boolean filterSent) throws ServiceException {
Element req = newRequestElement(MailConstants.ADD_MSG_REQUEST);
if (filterSent) {
req.addAttribute(MailConstants.A_FILTER_SENT, filterSent);
}
Element m = req.addUniqueElement(MailConstants.E_MSG);
m.addAttribute(MailConstants.A_FOLDER, folderId);
if (flags != null && flags.length() > 0) {
m.addAttribute(MailConstants.A_FLAGS, flags);
}
if (tags != null && tags.length() > 0) {
m.addAttribute(MailConstants.A_TAGS, tags);
}
if (receivedDate != 0) {
m.addAttribute(MailConstants.A_DATE, receivedDate);
}
m.addAttribute(MailConstants.A_NO_ICAL, noICal);
m.addElement(MailConstants.E_CONTENT).setText(content);
return invoke(req).getElement(MailConstants.E_MSG).getAttribute(MailConstants.A_ID);
}
Aggregations