use of org.bedework.caldav.util.sharing.ShareType in project bw-calendar-engine by Bedework.
the class NotificationConf method sendInvite.
/* ========================================================================
* Operations
* ======================================================================== */
@Override
public String sendInvite(final String cua, final String href) {
try {
final ShareType share = new ShareType();
final SetType set = new SetType();
set.setHref(cua);
set.setSummary("Test Collection");
final AccessType at = new AccessType();
at.setRead(true);
set.setAccess(at);
share.getSet().add(set);
try (CalSvcI svci = getSvci(getNotifierId())) {
final BwCalendar col = svci.getCalendarsHandler().get(href);
if (col == null) {
return "No such collection";
}
svci.getSharingHandler().share(col, share);
}
svci.endTransaction();
return "ok";
} catch (final Throwable t) {
error(t);
return t.getLocalizedMessage();
}
}
Aggregations