Search in sources :

Example 11 with BusinessGroupUpgrade

use of org.olat.upgrade.model.BusinessGroupUpgrade in project OpenOLAT by OpenOLAT.

the class OLATUpgrade_10_0_3 method upgradeBusinessGroups.

private boolean upgradeBusinessGroups(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
    if (!uhd.getBooleanDataValue(TASK_BUSINESS_GROUPS)) {
        int counter = 0;
        List<BusinessGroupUpgrade> businessGroups;
        do {
            businessGroups = findBusinessGroups(counter, BATCH_SIZE);
            for (BusinessGroupUpgrade businessGroup : businessGroups) {
                processRightGroup(businessGroup);
            }
            counter += businessGroups.size();
            log.audit("Rights groups processed: " + businessGroups.size() + ", total processed (" + counter + ")");
            dbInstance.commitAndCloseSession();
        } while (businessGroups.size() == BATCH_SIZE);
        uhd.setBooleanDataValue(TASK_BUSINESS_GROUPS, true);
        upgradeManager.setUpgradesHistory(uhd, VERSION);
    }
    return true;
}
Also used : BusinessGroupUpgrade(org.olat.upgrade.model.BusinessGroupUpgrade)

Example 12 with BusinessGroupUpgrade

use of org.olat.upgrade.model.BusinessGroupUpgrade in project openolat by klemens.

the class OLATUpgrade_10_0_0 method upgradeBusinessGroups.

private boolean upgradeBusinessGroups(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
    if (!uhd.getBooleanDataValue(TASK_BUSINESS_GROUPS)) {
        int counter = 0;
        List<BusinessGroupUpgrade> businessGroups;
        do {
            businessGroups = findBusinessGroups(counter, BATCH_SIZE);
            for (BusinessGroupUpgrade businessGroup : businessGroups) {
                processBusinessGroup(businessGroup);
            }
            counter += businessGroups.size();
            log.audit("Business groups processed: " + businessGroups.size() + ", total processed (" + counter + ")");
            dbInstance.commitAndCloseSession();
        } while (businessGroups.size() == BATCH_SIZE);
        uhd.setBooleanDataValue(TASK_BUSINESS_GROUPS, true);
        upgradeManager.setUpgradesHistory(uhd, VERSION);
    }
    return true;
}
Also used : BusinessGroupUpgrade(org.olat.upgrade.model.BusinessGroupUpgrade)

Aggregations

BusinessGroupUpgrade (org.olat.upgrade.model.BusinessGroupUpgrade)12 BaseSecurity (org.olat.basesecurity.BaseSecurity)2 SecurityGroup (org.olat.basesecurity.SecurityGroup)2 DBQuery (org.olat.core.commons.persistence.DBQuery)2 Identity (org.olat.core.id.Identity)2 BGContextImpl (org.olat.upgrade.model.BGContextImpl)2