Search in sources :

Example 1 with ShareType

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();
    }
}
Also used : SetType(org.bedework.caldav.util.sharing.SetType) CalSvcI(org.bedework.calsvci.CalSvcI) BwCalendar(org.bedework.calfacade.BwCalendar) AccessType(org.bedework.caldav.util.sharing.AccessType) ShareType(org.bedework.caldav.util.sharing.ShareType)

Aggregations

AccessType (org.bedework.caldav.util.sharing.AccessType)1 SetType (org.bedework.caldav.util.sharing.SetType)1 ShareType (org.bedework.caldav.util.sharing.ShareType)1 BwCalendar (org.bedework.calfacade.BwCalendar)1 CalSvcI (org.bedework.calsvci.CalSvcI)1