use of org.bedework.caldav.util.filter.parse.EventQuery in project bw-calendar-engine by Bedework.
the class Filters method parse.
@Override
public ParseResult parse(final BwFilterDef val) {
final String def = val.getDefinition();
if ((def.length() > 5) && (def.startsWith("<?xml"))) {
// Assume xml filter
final ParseResult pr = new ParseResult();
try {
final FilterType f = org.bedework.caldav.util.filter.parse.Filters.parse(def);
final EventQuery eq = org.bedework.caldav.util.filter.parse.Filters.getQuery(f);
val.setFilters(eq.filter);
pr.ok = true;
} catch (final Throwable t) {
pr.ok = false;
pr.message = t.getMessage();
pr.cfe = new CalFacadeException(t);
}
return pr;
}
// Assume simple expression filter
final String source = "BwFilterDef:" + val.getOwnerHref() + ":" + val.getName();
final ParseResult pr = getSvc().getFilterParser().parse(def, false, source);
if (pr.ok) {
val.setFilters(pr.filter);
}
return pr;
}
Aggregations