use of org.olat.upgrade.model.RepositoryEntryUpgrade in project openolat by klemens.
the class OLATUpgrade_10_0_0 method upgradeRepositoryEntries.
private boolean upgradeRepositoryEntries(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
if (!uhd.getBooleanDataValue(TASK_REPOENTRIES)) {
int counter = 0;
List<RepositoryEntryUpgrade> repoEntries;
do {
repoEntries = findRepositoryEntries(counter, BATCH_SIZE);
for (RepositoryEntryUpgrade repoEntry : repoEntries) {
processRepositoryEntry(repoEntry);
}
counter += repoEntries.size();
log.audit("Repository entries processed: " + repoEntries.size() + ", total processed (" + counter + ")");
dbInstance.commitAndCloseSession();
} while (repoEntries.size() == BATCH_SIZE);
uhd.setBooleanDataValue(TASK_REPOENTRIES, true);
upgradeManager.setUpgradesHistory(uhd, VERSION);
}
return true;
}
use of org.olat.upgrade.model.RepositoryEntryUpgrade in project openolat by klemens.
the class OLATUpgrade_7_1_1 method queryEntries.
public List<RepositoryEntryUpgrade> queryEntries(int firstResult) {
StringBuilder sb = new StringBuilder();
sb.append("select v from ").append(RepositoryEntryUpgrade.class.getName()).append(" v inner join fetch v.olatResource as res order by v.key asc");
DBQuery dbquery = DBFactory.getInstance().createQuery(sb.toString());
dbquery.setFirstResult(firstResult);
dbquery.setMaxResults(REPO_ENTRIES_BATCH_SIZE);
@SuppressWarnings("unchecked") List<RepositoryEntryUpgrade> entries = dbquery.list();
return entries;
}
use of org.olat.upgrade.model.RepositoryEntryUpgrade in project openolat by klemens.
the class OLATUpgrade_7_1_1 method migrateSecurityGroups.
// fxdiff VCRP-1: access control repository entry
private void migrateSecurityGroups(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
if (!uhd.getBooleanDataValue(MIGRATE_SECURITY_GROUP)) {
log.audit("+-----------------------------------------------------------------------------+");
log.audit("+... Migrate the repository entry security groups from business groups ...+");
log.audit("+-----------------------------------------------------------------------------+");
int counter = 0;
List<RepositoryEntryUpgrade> entries;
do {
entries = queryEntries(counter);
for (RepositoryEntryUpgrade entry : entries) {
createRepoEntrySecurityGroups(entry);
migrateRepoEntrySecurityGroups(entry);
}
counter += entries.size();
log.audit("Processed entries: " + entries.size());
} while (entries.size() == REPO_ENTRIES_BATCH_SIZE);
log.audit("+... Migration processed " + counter + " repository entries ...+");
uhd.setBooleanDataValue(MIGRATE_SECURITY_GROUP, true);
upgradeManager.setUpgradesHistory(uhd, VERSION);
}
}
use of org.olat.upgrade.model.RepositoryEntryUpgrade in project OpenOLAT by OpenOLAT.
the class OLATUpgrade_7_1_1 method queryEntries.
public List<RepositoryEntryUpgrade> queryEntries(int firstResult) {
StringBuilder sb = new StringBuilder();
sb.append("select v from ").append(RepositoryEntryUpgrade.class.getName()).append(" v inner join fetch v.olatResource as res order by v.key asc");
DBQuery dbquery = DBFactory.getInstance().createQuery(sb.toString());
dbquery.setFirstResult(firstResult);
dbquery.setMaxResults(REPO_ENTRIES_BATCH_SIZE);
@SuppressWarnings("unchecked") List<RepositoryEntryUpgrade> entries = dbquery.list();
return entries;
}
use of org.olat.upgrade.model.RepositoryEntryUpgrade in project OpenOLAT by OpenOLAT.
the class OLATUpgrade_7_1_1 method migrateSecurityGroups.
// fxdiff VCRP-1: access control repository entry
private void migrateSecurityGroups(UpgradeManager upgradeManager, UpgradeHistoryData uhd) {
if (!uhd.getBooleanDataValue(MIGRATE_SECURITY_GROUP)) {
log.audit("+-----------------------------------------------------------------------------+");
log.audit("+... Migrate the repository entry security groups from business groups ...+");
log.audit("+-----------------------------------------------------------------------------+");
int counter = 0;
List<RepositoryEntryUpgrade> entries;
do {
entries = queryEntries(counter);
for (RepositoryEntryUpgrade entry : entries) {
createRepoEntrySecurityGroups(entry);
migrateRepoEntrySecurityGroups(entry);
}
counter += entries.size();
log.audit("Processed entries: " + entries.size());
} while (entries.size() == REPO_ENTRIES_BATCH_SIZE);
log.audit("+... Migration processed " + counter + " repository entries ...+");
uhd.setBooleanDataValue(MIGRATE_SECURITY_GROUP, true);
upgradeManager.setUpgradesHistory(uhd, VERSION);
}
}
Aggregations