use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class RdateExdate method encodeMetadata.
public Metadata encodeMetadata() {
Metadata meta = new Metadata();
meta.put(FN_IS_RDATE, isRDATE());
if (mTimeZone != null)
meta.put(FN_TZID, mTimeZone.getID());
String vt = VT_DATE_TIME;
if (!ICalTok.DATE_TIME.equals(mValueType)) {
vt = ICalTok.DATE.equals(mValueType) ? VT_DATE : VT_PERIOD;
}
meta.put(FN_VALUE_TYPE, vt);
meta.put(FN_NUM_VALUES, mValues.size());
int i = 0;
for (Object val : mValues) {
if (val instanceof ParsedDateTime) {
ParsedDateTime dt = (ParsedDateTime) val;
meta.put(FN_VALUE + i, dt.getDateTimePartString(false));
} else if (val instanceof Period) {
Period p = (Period) val;
meta.put(FN_VALUE + i, p.encodeMetadata());
}
i++;
}
return meta;
}
use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class RecurId method encodeMetadata.
public Metadata encodeMetadata() {
Metadata md = new Metadata();
md.put(FN_DT, mDateTime.toString());
md.put(FN_RANGE, mRange);
return md;
}
use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class AlarmData method encodeMetadata.
Metadata encodeMetadata() {
Metadata meta = new Metadata();
meta.put(FN_NEXT_AT, mNextAt);
meta.put(FN_NEXT_INSTANCE_START, mNextInstStart);
meta.put(FN_INV_ID, mInvId);
meta.put(FN_COMP_NUM, mCompNum);
meta.put(FN_SUMMARY, mSummary);
meta.put(FN_LOCATION, mLocation);
if (mAlarm != null)
meta.put(FN_ALARM, mAlarm.encodeMetadata());
return meta;
}
use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class Alarm method encodeMetadata.
public Metadata encodeMetadata() {
Metadata meta = new Metadata();
meta.put(FN_ACTION, abbrevAction(mAction));
meta.put(FN_TRIGGER_TYPE, abbrevTriggerType(mTriggerType));
if (TriggerType.RELATIVE.equals(mTriggerType)) {
meta.put(FN_TRIGGER_RELATED, abbrevTriggerRelated(mTriggerRelated));
meta.put(FN_TRIGGER_RELATIVE, mTriggerRelative.toString());
} else {
meta.put(FN_TRIGGER_ABSOLUTE, mTriggerAbsolute.getDateTimePartString(false));
}
if (mRepeatDuration != null) {
meta.put(FN_REPEAT_DURATION, mRepeatDuration.toString());
meta.put(FN_REPEAT_COUNT, mRepeatCount);
}
meta.put(FN_DESCRIPTION, mDescription);
meta.put(FN_SUMMARY, mSummary);
if (mAttach != null)
meta.put(FN_ATTACH, Util.encodeMetadata(mAttach));
if (mAttendees != null) {
meta.put(FN_NUM_ATTENDEES, mAttendees.size());
int i = 0;
for (Iterator<ZAttendee> iter = mAttendees.iterator(); iter.hasNext(); i++) {
ZAttendee at = iter.next();
meta.put(FN_ATTENDEE + i, at.encodeAsMetadata());
}
}
if (xProps.size() > 0)
Util.encodeXPropsAsMetadata(meta, xpropsIterator());
return meta;
}
use of com.zimbra.cs.mailbox.Metadata in project zm-mailbox by Zimbra.
the class DbScheduledTask method getEncodedMetadata.
private static String getEncodedMetadata(ScheduledTask task) {
boolean hasProperties = false;
Metadata metadata = new Metadata();
Set<String> keys = task.getPropertyNames();
for (String key : keys) {
hasProperties = true;
metadata.put(key, task.getProperty(key));
}
if (!hasProperties) {
return null;
}
return metadata.toString();
}
Aggregations