Search in sources :

Example 1 with ExpandType

use of ietf.params.xml.ns.caldav.ExpandType in project bw-calendar-engine by Bedework.

the class BwSysIntfImpl method getRrm.

private RecurringRetrievalMode getRrm(final RetrievalMode rm) throws WebdavException {
    if (rm == null) {
        return RecurringRetrievalMode.overrides;
    }
    try {
        if (rm.getExpand() != null) {
            /* expand with time range */
            ExpandType ex = rm.getExpand();
            DateTime s = new DateTime(XcalUtil.getIcalFormatDateTime(ex.getStart()));
            DateTime e = new DateTime(XcalUtil.getIcalFormatDateTime(ex.getEnd()));
            return new RecurringRetrievalMode(Rmode.expanded, getBwDt(s), getBwDt(e));
        }
        if (rm.getLimitRecurrenceSet() != null) {
            /* Only return master event and overrides in range */
            LimitRecurrenceSetType l = rm.getLimitRecurrenceSet();
            DateTime s = new DateTime(XcalUtil.getIcalFormatDateTime(l.getStart()));
            DateTime e = new DateTime(XcalUtil.getIcalFormatDateTime(l.getEnd()));
            return new RecurringRetrievalMode(Rmode.overrides, getBwDt(s), getBwDt(e));
        }
    } catch (Throwable t) {
        throw new WebdavBadRequest(CaldavTags.validFilter, "Invalid time-range");
    }
    /* Return master + overrides */
    return RecurringRetrievalMode.overrides;
}
Also used : WebdavBadRequest(org.bedework.webdav.servlet.shared.WebdavBadRequest) RecurringRetrievalMode(org.bedework.calfacade.RecurringRetrievalMode) LimitRecurrenceSetType(ietf.params.xml.ns.caldav.LimitRecurrenceSetType) ExpandType(ietf.params.xml.ns.caldav.ExpandType) DateTime(net.fortuna.ical4j.model.DateTime) BwDateTime(org.bedework.calfacade.BwDateTime)

Aggregations

ExpandType (ietf.params.xml.ns.caldav.ExpandType)1 LimitRecurrenceSetType (ietf.params.xml.ns.caldav.LimitRecurrenceSetType)1 DateTime (net.fortuna.ical4j.model.DateTime)1 BwDateTime (org.bedework.calfacade.BwDateTime)1 RecurringRetrievalMode (org.bedework.calfacade.RecurringRetrievalMode)1 WebdavBadRequest (org.bedework.webdav.servlet.shared.WebdavBadRequest)1