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;
}
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;
}
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);
}
}
Aggregations