Search in sources :

Example 1 with DirectoryInfo

use of org.bedework.calfacade.DirectoryInfo in project bw-calendar-engine by Bedework.

the class Users method setRoots.

private static void setRoots(final CalSvcI svc) throws CalFacadeException {
    if (principalRoot != null) {
        return;
    }
    final DirectoryInfo di = svc.getDirectories().getDirectoryInfo();
    principalRoot = di.getPrincipalRoot();
    userPrincipalRoot = di.getUserPrincipalRoot();
    groupPrincipalRoot = di.getGroupPrincipalRoot();
    // principalRootLen = principalRoot.length();
    // userPrincipalRootLen = userPrincipalRoot.length();
    groupPrincipalRootLen = groupPrincipalRoot.length();
}
Also used : DirectoryInfo(org.bedework.calfacade.DirectoryInfo)

Example 2 with DirectoryInfo

use of org.bedework.calfacade.DirectoryInfo in project bw-calendar-engine by Bedework.

the class AbstractDirImpl method getDirectoryInfo.

@Override
public DirectoryInfo getDirectoryInfo() throws CalFacadeException {
    final DirectoryInfo info = new DirectoryInfo();
    info.setPrincipalRoot(BwPrincipal.principalRoot);
    info.setUserPrincipalRoot(BwPrincipal.userPrincipalRoot);
    info.setGroupPrincipalRoot(BwPrincipal.groupPrincipalRoot);
    info.setBwadmingroupPrincipalRoot(BwPrincipal.bwadmingroupPrincipalRoot);
    info.setTicketPrincipalRoot(BwPrincipal.ticketPrincipalRoot);
    info.setResourcePrincipalRoot(BwPrincipal.resourcePrincipalRoot);
    info.setVenuePrincipalRoot(BwPrincipal.venuePrincipalRoot);
    info.setHostPrincipalRoot(BwPrincipal.hostPrincipalRoot);
    return info;
}
Also used : DirectoryInfo(org.bedework.calfacade.DirectoryInfo)

Example 3 with DirectoryInfo

use of org.bedework.calfacade.DirectoryInfo in project bw-calendar-engine by Bedework.

the class RestoreGlobals method setRoots.

public static void setRoots(final CalSvcI svc) throws CalFacadeException {
    if (principalRoot != null) {
        return;
    }
    final DirectoryInfo di = svc.getDirectories().getDirectoryInfo();
    principalRoot = di.getPrincipalRoot();
    userPrincipalRoot = di.getUserPrincipalRoot();
    groupPrincipalRoot = di.getGroupPrincipalRoot();
    // principalRootLen = principalRoot.length();
    // userPrincipalRootLen = userPrincipalRoot.length();
    groupPrincipalRootLen = groupPrincipalRoot.length();
}
Also used : DirectoryInfo(org.bedework.calfacade.DirectoryInfo)

Example 4 with DirectoryInfo

use of org.bedework.calfacade.DirectoryInfo in project bw-calendar-engine by Bedework.

the class ProcessCreate method createAdminGroup.

private boolean createAdminGroup(final String account) throws Throwable {
    if (debug) {
        debug("About to create admin group " + account);
    }
    if (account == null) {
        addError("Must supply account");
        return false;
    }
    try {
        open();
        final BwAdminGroup grp = new BwAdminGroup();
        grp.setAccount(account);
        final DirectoryInfo di = getDirectoryInfo();
        String href = di.getBwadmingroupPrincipalRoot();
        if (!href.endsWith("/")) {
            href += "/";
        }
        grp.setPrincipalRef(href + account);
        grp.setDescription(quotedVal());
        if (grp.getDescription() == null) {
            addError("Must supply admin group description");
            return false;
        }
        final String adgGroupOwner = word();
        if (adgGroupOwner == null) {
            addError("Must supply admin group owner");
            return false;
        }
        final BwPrincipal adgPr = getUserAlways(adgGroupOwner);
        if (adgPr == null) {
            return false;
        }
        grp.setGroupOwnerHref(adgPr.getPrincipalRef());
        String adgEventOwner = word();
        if (adgEventOwner == null) {
            adgEventOwner = "agrp_" + account;
        }
        final BwPrincipal adePr = getUserAlways(adgEventOwner);
        if (adePr == null) {
            return false;
        }
        grp.setOwnerHref(adePr.getPrincipalRef());
        getSvci().getAdminDirectories().addGroup(grp);
        return true;
    } finally {
        close();
    }
}
Also used : BwPrincipal(org.bedework.calfacade.BwPrincipal) DirectoryInfo(org.bedework.calfacade.DirectoryInfo) BwAdminGroup(org.bedework.calfacade.svc.BwAdminGroup)

Aggregations

DirectoryInfo (org.bedework.calfacade.DirectoryInfo)4 BwPrincipal (org.bedework.calfacade.BwPrincipal)1 BwAdminGroup (org.bedework.calfacade.svc.BwAdminGroup)1