use of org.bedework.calfacade.BwEventAnnotation in project bw-calendar-engine by Bedework.
the class EventStringKeyRule method field.
public void field(String name) throws Throwable {
try {
/* Top should now be an event object */
EventInfo ei = (EventInfo) getTop(EventInfo.class, name);
BwEventAnnotation ann = null;
BwEvent e = ei.getEvent();
if (e instanceof BwEventProxy) {
ann = ((BwEventProxy) e).getRef();
if (ann.getOverride()) {
// Overrides have everything set already
return;
}
String match = getDigester().getMatch();
if (match.contains("/target/")) {
e = ann.getTarget();
} else if (match.contains("/master/")) {
e = ann.getMaster();
} else {
e = ann;
}
}
if (name.equals("uid")) {
e.setUid(stringFld());
} else if (name.equals("recurrenceId")) {
e.setRecurrenceId(stringFld());
} else {
unknownTag(name);
}
} catch (Throwable t) {
handleException(t);
}
}
use of org.bedework.calfacade.BwEventAnnotation in project bw-calendar-engine by Bedework.
the class ContainerPathRule method field.
public void field(String name) throws Throwable {
if (name.equals("path")) {
/* If the top is an override skip this - container is set already. */
BwEventAnnotation ann = null;
BwEvent e = null;
if (top() instanceof EventInfo) {
EventInfo ei = (EventInfo) getTop(EventInfo.class, name);
e = ei.getEvent();
if (e instanceof BwEventProxy) {
ann = ((BwEventProxy) e).getRef();
if (ann.getOverride()) {
// Overrides have everything set already
return;
}
}
}
BwCalendar cal = globals.rintf.getCalendar(stringFld());
if (cal == null) {
error("No calendar for path " + stringFld());
}
if (top() instanceof BwShareableContainedDbentity) {
BwShareableContainedDbentity scde = (BwShareableContainedDbentity) top();
scde.setColPath(stringFld());
} else if (top() instanceof EventInfo) {
if (ann != null) {
/* Could be target or master */
String match = getDigester().getMatch();
if (match.contains("/target/")) {
ann.getTarget().setColPath(stringFld());
} else if (match.contains("/master/")) {
ann.getMaster().setColPath(stringFld());
} else {
ann.setColPath(stringFld());
}
}
e.setColPath(stringFld());
} else {
handleException(new Exception("Unexpected stack top "));
}
} else {
unknownTag(name);
}
}
Aggregations