use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZDateTime method toElement.
public Element toElement(String name, Element parent) {
Element dtEl = parent.addElement(name);
dtEl.addAttribute(MailConstants.A_CAL_DATETIME, mDateTime);
if (mTimeZoneId != null)
dtEl.addAttribute(MailConstants.A_CAL_TIMEZONE, mTimeZoneId);
return dtEl;
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZCalDataSource method toIdElement.
public Element toIdElement(Element parent) {
Element src = parent.addElement(MailConstants.E_DS_CAL);
src.addAttribute(MailConstants.A_ID, getId());
return src;
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZCalDataSource method toElement.
public Element toElement(Element parent) {
Element src = parent.addElement(MailConstants.E_DS_CAL);
src.addAttribute(MailConstants.A_ID, data.getId());
src.addAttribute(MailConstants.A_NAME, data.getName());
src.addAttribute(MailConstants.A_DS_IS_ENABLED, data.isEnabled());
src.addAttribute(MailConstants.A_FOLDER, data.getFolderId());
return src;
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method createDataSource.
/**
* Creates a data source.
*
* @return the new data source id
*/
public String createDataSource(ZDataSource source) throws ServiceException {
Element req = newRequestElement(MailConstants.CREATE_DATA_SOURCE_REQUEST);
source.toElement(req);
return invoke(req).listElements().get(0).getAttribute(MailConstants.A_ID);
}
use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.
the class ZMailbox method createMountpoint.
/**
* create a new mountpoint in the specified parent folder.
*
* @param parentId parent folder id
* @param name name of new folder
* @param defaultView default view of new folder.
* @param color
* @param flags
* @param ownerBy used to specify whether owner is an id or account name (email address)
* @param owner either the id or name of the owner
* @param itemBy used to specify whether sharedItem is an id or path to the shared item
* @param sharedItem either the id or path of the item
* @param reminderEnabled whether client should show reminders on appointments/tasks
*
* @return newly created folder
* @throws ServiceException on error
* @param color initial color
* @param flags initial flags
*/
public ZMountpoint createMountpoint(String parentId, String name, ZFolder.View defaultView, ZFolder.Color color, String flags, OwnerBy ownerBy, String owner, SharedItemBy itemBy, String sharedItem, boolean reminderEnabled) throws ServiceException {
Element req = newRequestElement(MailConstants.CREATE_MOUNTPOINT_REQUEST);
Element linkEl = req.addUniqueElement(MailConstants.E_MOUNT);
linkEl.addAttribute(MailConstants.A_NAME, name);
linkEl.addAttribute(MailConstants.A_FOLDER, parentId);
if (defaultView != null) {
linkEl.addAttribute(MailConstants.A_DEFAULT_VIEW, defaultView.name());
}
if (color != null) {
if (StringUtil.equal(color.getName(), Color.RGBCOLOR)) {
linkEl.addAttribute(MailConstants.A_RGB, color.getRgbColorValue());
} else {
linkEl.addAttribute(MailConstants.A_COLOR, color.getValue());
}
}
if (flags != null) {
linkEl.addAttribute(MailConstants.A_FLAGS, flags);
}
linkEl.addAttribute(ownerBy == OwnerBy.BY_ID ? MailConstants.A_ZIMBRA_ID : MailConstants.A_OWNER_NAME, owner);
linkEl.addAttribute(itemBy == SharedItemBy.BY_ID ? MailConstants.A_REMOTE_ID : MailConstants.A_PATH, sharedItem);
linkEl.addAttribute(MailConstants.A_REMINDER, reminderEnabled);
Element newMountEl = invoke(req).getElement(MailConstants.E_MOUNT);
ZMountpoint newMount = getMountpointById(newMountEl.getAttribute(MailConstants.A_ID));
return newMount != null ? newMount : new ZMountpoint(newMountEl, null, this);
}
Aggregations