use of org.bedework.calfacade.BwFilterDef in project bw-calendar-engine by Bedework.
the class FilterDefsDAO method fetch.
public BwFilterDef fetch(final String name, final BwPrincipal owner) throws CalFacadeException {
final HibSession sess = getSess();
sess.createQuery(fetchFilterDefQuery);
sess.setString("ownerHref", owner.getPrincipalRef());
sess.setString("name", name);
sess.cacheableQuery();
return (BwFilterDef) sess.getUnique();
}
use of org.bedework.calfacade.BwFilterDef in project bw-calendar-engine by Bedework.
the class BwLongStringRule method end.
@Override
public void end(final String ns, final String name) throws Exception {
if (name.equals("bwlongstring")) {
// 3.5 onwards we wrapped with a tag. Do nothing
return;
}
BwLongString entity;
try {
entity = (BwLongString) pop();
if (top() instanceof BwFilterDef) {
BwFilterDef f = (BwFilterDef) top();
if (name.equals("subaddr")) {
f.addDescription(entity);
} else {
throw new Exception("unknown tag " + name);
}
return;
}
EventInfo ei = (EventInfo) top();
BwEvent e = ei.getEvent();
if (e instanceof BwEventProxy) {
e = ((BwEventProxy) e).getRef();
}
if (name.equals("description")) {
e.addDescription(entity);
} else {
throw new Exception("unknown tag " + name);
}
} catch (Throwable t) {
handleException(t);
}
}
use of org.bedework.calfacade.BwFilterDef in project bw-calendar-engine by Bedework.
the class FilterFieldRule method field.
public void field(String name) throws Exception {
BwStringBase str = null;
if (top() instanceof BwStringBase) {
str = (BwStringBase) pop();
}
BwFilterDef f = (BwFilterDef) top();
if (name.equals("name")) {
f.setName(stringFld());
} else if (name.equals("definition")) {
f.setDefinition(stringFld());
} else if (name.equals("description")) {
f.addDescription((BwLongString) str);
} else if (name.equals("displayName")) {
f.addDisplayName((BwString) str);
} else if (name.equals("descriptions")) {
// Nothing to do.
} else if (name.equals("displayNames")) {
// Nothing to do.
}
}
Aggregations