use of org.bedework.calfacade.util.ChangeTableEntry in project bw-calendar-engine by Bedework.
the class Events method doCats.
private void doCats(final RealiasResult resp, final String colHref, final BwEvent ev) {
try {
final Set<BwCategory> cats = getCols().getCategorySet(colHref);
if (Util.isEmpty(cats)) {
return;
}
resp.getCats().addAll(cats);
for (final BwCategory cat : cats) {
if (ev.addCategory(cat)) {
final ChangeTable changes = ev.getChangeset(getPrincipalHref());
final ChangeTableEntry cte = changes.getEntry(PropertyInfoIndex.CATEGORIES);
cte.addAddedValue(cat);
}
}
} catch (final Throwable t) {
Response.error(new RealiasResult(null), t.getMessage());
}
}
use of org.bedework.calfacade.util.ChangeTableEntry in project bw-calendar-engine by Bedework.
the class SchedulingBase method addChangeInfo.
private void addChangeInfo(final EventInfo ei, final StringBuilder changeInfo, final String entity) throws CalFacadeException {
if (ei.getChangeset(getPrincipalHref()).isEmpty()) {
// Forced update?
appendEntity(changeInfo, entity);
return;
}
boolean changed = false;
Collection<ChangeTableEntry> ctes = ei.getChangeset(getPrincipalHref()).getEntries();
for (ChangeTableEntry cte : ctes) {
if (!cte.getChanged()) {
continue;
}
if (!changed) {
appendEntity(changeInfo, entity);
changeInfo.append(";CHANGES");
}
changed = true;
changeInfo.append(";");
/* TODO - fix this at source */
if ((cte.getIndex() == PropertyInfoIndex.DTEND) && (ei.getEvent().getEntityType() == IcalDefs.entityTypeTodo)) {
changeInfo.append(PropertyInfoIndex.DUE.toString());
} else {
changeInfo.append(cte.getIndex().toString());
}
}
}
Aggregations