本文整理汇总了Java中net.fortuna.ical4j.model.Component.VFREEBUSY属性的典型用法代码示例。如果您正苦于以下问题:Java Component.VFREEBUSY属性的具体用法?Java Component.VFREEBUSY怎么用?Java Component.VFREEBUSY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.fortuna.ical4j.model.Component
的用法示例。
在下文中一共展示了Component.VFREEBUSY属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createQueryFilters
private CalendarFilter[] createQueryFilters(CollectionItem collection, Period period) {
DateTime start = period.getStart();
DateTime end = period.getEnd();
CalendarFilter[] filters = new CalendarFilter[2];
TimeZone tz = null;
// Create calendar-filter elements designed to match
// VEVENTs/VFREEBUSYs within the specified time range.
//
// <C:filter>
// <C:comp-filter name="VCALENDAR">
// <C:comp-filter name="VEVENT">
// <C:time-range start="20051124T000000Z"
// end="20051125T000000Z"/>
// </C:comp-filter>
// <C:comp-filter name="VFREEBUSY">
// <C:time-range start="20051124T000000Z"
// end="20051125T000000Z"/>
// </C:comp-filter>
// </C:comp-filter>
// </C:filter>
// If the calendar collection has a timezone attribute,
// then use that to convert floating date/times to UTC
CalendarCollectionStamp ccs = StampUtils.getCalendarCollectionStamp(collection);
if (ccs!=null) {
tz = ccs.getTimezone();
}
ComponentFilter eventFilter = new ComponentFilter(Component.VEVENT);
eventFilter.setTimeRangeFilter(new TimeRangeFilter(start, end));
if(tz!=null) {
eventFilter.getTimeRangeFilter().setTimezone(tz.getVTimeZone());
}
ComponentFilter calFilter = new ComponentFilter(Calendar.VCALENDAR);
calFilter.getComponentFilters().add(eventFilter);
CalendarFilter filter = new CalendarFilter();
filter.setFilter(calFilter);
filters[0] = filter;
ComponentFilter freebusyFilter = new ComponentFilter(
Component.VFREEBUSY);
freebusyFilter.setTimeRangeFilter(new TimeRangeFilter(start, end));
if(tz!=null) {
freebusyFilter.getTimeRangeFilter().setTimezone(tz.getVTimeZone());
}
calFilter = new ComponentFilter(Calendar.VCALENDAR);
calFilter.getComponentFilters().add(freebusyFilter);
filter = new CalendarFilter();
filter.setFilter(calFilter);
filters[1] = filter;
return filters;
}