Search in sources :

Example 76 with Element

use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.

the class ZSelectiveCallRejection method toElement.

void toElement(Element element) throws ServiceException {
    super.toElement(element);
    for (String name : mRejectFrom) {
        Element fromEl = element.addElement(VoiceConstants.E_PHONE);
        fromEl.addAttribute(VoiceConstants.A_PHONE_NUMBER, name);
        fromEl.addAttribute(VoiceConstants.A_ACTIVE, "true");
    }
}
Also used : Element(com.zimbra.common.soap.Element)

Example 77 with Element

use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.

the class ZSelectiveCallRejection method fromElement.

synchronized void fromElement(Element element) throws ServiceException {
    super.fromElement(element);
    mRejectFrom = new ArrayList<String>();
    for (Element fromEl : element.listElements(VoiceConstants.E_PHONE)) {
        mRejectFrom.add(fromEl.getAttribute(VoiceConstants.A_PHONE_NUMBER));
    }
}
Also used : Element(com.zimbra.common.soap.Element)

Example 78 with Element

use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.

the class ZRssDataSource method toIdElement.

public Element toIdElement(Element parent) {
    Element src = parent.addElement(MailConstants.E_DS_RSS);
    src.addAttribute(MailConstants.A_ID, getId());
    return src;
}
Also used : Element(com.zimbra.common.soap.Element)

Example 79 with Element

use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.

the class ZAuthToken method fromSoap.

private void fromSoap(com.zimbra.common.soap.Element eAuthToken, boolean isAdmin) throws ServiceException {
    mType = eAuthToken.getAttribute(isAdmin ? AdminConstants.A_TYPE : AccountConstants.A_TYPE, null);
    mValue = eAuthToken.getText();
    if (mValue.length() == 0)
        mValue = null;
    String eName = isAdmin ? AdminConstants.E_A : AccountConstants.E_A;
    String aName = isAdmin ? AdminConstants.A_N : AccountConstants.A_N;
    for (Element a : eAuthToken.listElements(eName)) {
        String name = a.getAttribute(aName);
        String value = a.getText();
        if (mAttrs == null)
            mAttrs = new HashMap<String, String>();
        mAttrs.put(name, value);
    }
}
Also used : HashMap(java.util.HashMap) XMLElement(com.zimbra.common.soap.Element.XMLElement) Element(com.zimbra.common.soap.Element)

Example 80 with Element

use of com.zimbra.common.soap.Element in project zm-mailbox by Zimbra.

the class CalendarUtil method parseXParams.

public static List<ZParameter> parseXParams(Element element) throws ServiceException {
    List<ZParameter> params = new ArrayList<ZParameter>();
    for (Iterator<Element> paramIter = element.elementIterator(MailConstants.E_CAL_XPARAM); paramIter.hasNext(); ) {
        Element paramElem = paramIter.next();
        String paramName = paramElem.getAttribute(MailConstants.A_NAME);
        String paramValue = paramElem.getAttribute(MailConstants.A_VALUE, null);
        ZParameter xparam = new ZParameter(paramName, paramValue);
        params.add(xparam);
    }
    return params;
}
Also used : Element(com.zimbra.common.soap.Element) ArrayList(java.util.ArrayList) ZParameter(com.zimbra.common.calendar.ZCalendar.ZParameter)

Aggregations

Element (com.zimbra.common.soap.Element)980 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)315 XMLElement (com.zimbra.common.soap.Element.XMLElement)269 Account (com.zimbra.cs.account.Account)220 Test (org.junit.Test)175 JSONElement (com.zimbra.common.soap.Element.JSONElement)167 Provisioning (com.zimbra.cs.account.Provisioning)147 Mailbox (com.zimbra.cs.mailbox.Mailbox)138 ServiceException (com.zimbra.common.service.ServiceException)103 ItemId (com.zimbra.cs.service.util.ItemId)81 ArrayList (java.util.ArrayList)81 OperationContext (com.zimbra.cs.mailbox.OperationContext)80 HashMap (java.util.HashMap)77 ItemIdFormatter (com.zimbra.cs.service.util.ItemIdFormatter)56 SoapHttpTransport (com.zimbra.common.soap.SoapHttpTransport)54 Server (com.zimbra.cs.account.Server)49 FilterTest (com.zimbra.soap.mail.type.FilterTest)46 IOException (java.io.IOException)45 XmlAnyElement (javax.xml.bind.annotation.XmlAnyElement)44 XmlElement (javax.xml.bind.annotation.XmlElement)44