Search in sources :

Example 6 with CalSvcFactoryDefault

use of org.bedework.calsvci.CalSvcFactoryDefault in project bw-calendar-engine by Bedework.

the class SystemConf method getSvci.

/* ====================================================================
   *                   Private methods
   * ==================================================================== */
/**
 * Get an svci object and return it. Also embed it in this object.
 *
 * @return svci object
 * @throws org.bedework.calfacade.exc.CalFacadeException
 */
private CalSvcI getSvci() throws CalFacadeException {
    if (getConfig() == null) {
        return null;
    }
    if ((svci != null) && svci.isOpen()) {
        return svci;
    }
    if (getRootUsers() == null) {
        return null;
    }
    final String[] rootUsers = getRootUsers().split(",");
    if ((rootUsers.length == 0) || (rootUsers[0] == null)) {
        return null;
    }
    final CalSvcIPars pars = CalSvcIPars.getServicePars(getServiceName(), rootUsers[0], // publicAdmin
    true, // Allow super user
    true);
    svci = new CalSvcFactoryDefault().getSvc(pars);
    svci.open();
    svci.beginTransaction();
    return svci;
}
Also used : CalSvcFactoryDefault(org.bedework.calsvci.CalSvcFactoryDefault) CalSvcIPars(org.bedework.calsvci.CalSvcIPars)

Example 7 with CalSvcFactoryDefault

use of org.bedework.calsvci.CalSvcFactoryDefault in project bw-calendar-engine by Bedework.

the class NotificationConf method getSvci.

/* ====================================================================
   *                   Private methods
   * ==================================================================== */
/**
 * Get an svci object and return it. Also embed it in this object.
 *
 * @param account of user to run as
 * @return svci object
 * @throws org.bedework.calfacade.exc.CalFacadeException
 */
private CalSvcI getSvci(final String account) throws CalFacadeException {
    if ((svci != null) && svci.isOpen()) {
        return svci;
    }
    if (svci == null) {
        final CalSvcIPars pars = CalSvcIPars.getServicePars("notifications", account, // publicAdmin
        false, // Allow super user
        true);
        svci = new CalSvcFactoryDefault().getSvc(pars);
    }
    svci.open();
    svci.beginTransaction();
    return svci;
}
Also used : CalSvcFactoryDefault(org.bedework.calsvci.CalSvcFactoryDefault) CalSvcIPars(org.bedework.calsvci.CalSvcIPars)

Aggregations

CalSvcFactoryDefault (org.bedework.calsvci.CalSvcFactoryDefault)7 CalSvcIPars (org.bedework.calsvci.CalSvcIPars)5 BwString (org.bedework.calfacade.BwString)1 BasicSystemProperties (org.bedework.calfacade.configs.BasicSystemProperties)1 Configurations (org.bedework.calfacade.configs.Configurations)1 SystemProperties (org.bedework.calfacade.configs.SystemProperties)1 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)1 CalSvcI (org.bedework.calsvci.CalSvcI)1 IcalTranslator (org.bedework.icalendar.IcalTranslator)1 WebdavException (org.bedework.webdav.servlet.shared.WebdavException)1