Search in sources :

Example 26 with ZParameter

use of com.zimbra.common.calendar.ZCalendar.ZParameter in project zm-mailbox by Zimbra.

the class RecurId method toProperty.

public ZProperty toProperty(boolean useOutlookCompatMode) {
    //        ZProperty toRet = new ZProperty(ICalTok.RECURRENCE_ID, toString());
    //        return toRet;
    ZProperty toRet = mDateTime.toProperty(ICalTok.RECURRENCE_ID, useOutlookCompatMode);
    String range = getRangeStr();
    if (range != null)
        toRet.addParameter(new ZParameter(ICalTok.RANGE, range));
    return toRet;
}
Also used : ZProperty(com.zimbra.common.calendar.ZCalendar.ZProperty) ZParameter(com.zimbra.common.calendar.ZCalendar.ZParameter)

Example 27 with ZParameter

use of com.zimbra.common.calendar.ZCalendar.ZParameter in project zm-mailbox by Zimbra.

the class Util method decodeXParamsFromMetadata.

public static List<ZParameter> decodeXParamsFromMetadata(Metadata meta) throws ServiceException {
    int xparamCount = (int) meta.getLong(FN_NUM_XPROPS_OR_XPARAMS, 0);
    if (xparamCount > 0) {
        List<ZParameter> list = new ArrayList<ZParameter>(xparamCount);
        for (int paramNum = 0; paramNum < xparamCount; paramNum++) {
            Metadata paramMeta = meta.getMap(FN_XPROP_OR_XPARAM + paramNum, true);
            if (paramMeta == null)
                continue;
            String paramName = paramMeta.get(FN_NAME, null);
            if (paramName == null)
                continue;
            String paramValue = paramMeta.get(FN_VALUE, null);
            ZParameter xparam = new ZParameter(paramName, paramValue);
            list.add(xparam);
        }
        return list;
    }
    return null;
}
Also used : ArrayList(java.util.ArrayList) Metadata(com.zimbra.cs.mailbox.Metadata) ZParameter(com.zimbra.common.calendar.ZCalendar.ZParameter)

Example 28 with ZParameter

use of com.zimbra.common.calendar.ZCalendar.ZParameter in project zm-mailbox by Zimbra.

the class CalendarUtil method encodeXParams.

/**
     * Use JAXB e.g. {@link com.zimbra.soap.mail.type.XParam} where possible
     * instead of using this
     */
public static void encodeXParams(Element parent, Iterator<ZParameter> xparamsIterator) {
    while (xparamsIterator.hasNext()) {
        ZParameter xparam = xparamsIterator.next();
        String paramName = xparam.getName();
        if (paramName == null)
            continue;
        Element paramElem = parent.addElement(MailConstants.E_CAL_XPARAM);
        paramElem.addAttribute(MailConstants.A_NAME, paramName);
        String paramValue = xparam.getValue();
        if (paramValue != null)
            paramElem.addAttribute(MailConstants.A_VALUE, paramValue);
    }
}
Also used : Element(com.zimbra.common.soap.Element) ZParameter(com.zimbra.common.calendar.ZCalendar.ZParameter)

Aggregations

ZParameter (com.zimbra.common.calendar.ZCalendar.ZParameter)28 ZProperty (com.zimbra.common.calendar.ZCalendar.ZProperty)20 ParsedDateTime (com.zimbra.common.calendar.ParsedDateTime)8 ArrayList (java.util.ArrayList)8 ICalTok (com.zimbra.common.calendar.ZCalendar.ICalTok)7 ZComponent (com.zimbra.common.calendar.ZCalendar.ZComponent)7 ParseException (java.text.ParseException)5 ParsedDuration (com.zimbra.common.calendar.ParsedDuration)4 Metadata (com.zimbra.cs.mailbox.Metadata)4 TimeZoneMap (com.zimbra.common.calendar.TimeZoneMap)3 Element (com.zimbra.common.soap.Element)3 IRecurrence (com.zimbra.cs.mailbox.calendar.Recurrence.IRecurrence)3 Attach (com.zimbra.common.calendar.Attach)2 Geo (com.zimbra.common.calendar.Geo)2 ServiceException (com.zimbra.common.service.ServiceException)2 Account (com.zimbra.cs.account.Account)2 CalendarItem (com.zimbra.cs.mailbox.CalendarItem)2 MailItem (com.zimbra.cs.mailbox.MailItem)2 Mailbox (com.zimbra.cs.mailbox.Mailbox)2 Invite (com.zimbra.cs.mailbox.calendar.Invite)2