use of org.olat.upgrade.model.BGResourceRelation in project OpenOLAT by OpenOLAT.
the class OLATUpgrade_10_0_0 method processRelationToRepo.
private void processRelationToRepo(BusinessGroupUpgrade businessGroup) {
try {
List<BGResourceRelation> relationsToRepo = findRelations(businessGroup);
if (relationsToRepo.size() > 0) {
Group refGroup = businessGroup.getBaseGroup();
for (BGResourceRelation relationToRepo : relationsToRepo) {
RepositoryEntryUpgrade entry = lookupRepositoryEntry(relationToRepo.getResource());
if (entry == null) {
continue;
}
boolean found = false;
Set<RepositoryEntryUpgradeToGroupRelation> groupRelations = entry.getGroups();
for (RepositoryEntryUpgradeToGroupRelation groupRelation : groupRelations) {
if (groupRelation.getGroup().equals(refGroup)) {
found = true;
}
}
if (!found) {
create(entry, refGroup, false);
}
}
}
dbInstance.commit();
} catch (Exception e) {
log.error("", e);
throw e;
}
}
use of org.olat.upgrade.model.BGResourceRelation in project openolat by klemens.
the class OLATUpgrade_10_0_0 method processRelationToRepo.
private void processRelationToRepo(BusinessGroupUpgrade businessGroup) {
try {
List<BGResourceRelation> relationsToRepo = findRelations(businessGroup);
if (relationsToRepo.size() > 0) {
Group refGroup = businessGroup.getBaseGroup();
for (BGResourceRelation relationToRepo : relationsToRepo) {
RepositoryEntryUpgrade entry = lookupRepositoryEntry(relationToRepo.getResource());
if (entry == null) {
continue;
}
boolean found = false;
Set<RepositoryEntryUpgradeToGroupRelation> groupRelations = entry.getGroups();
for (RepositoryEntryUpgradeToGroupRelation groupRelation : groupRelations) {
if (groupRelation.getGroup().equals(refGroup)) {
found = true;
}
}
if (!found) {
create(entry, refGroup, false);
}
}
}
dbInstance.commit();
} catch (Exception e) {
log.error("", e);
throw e;
}
}
Aggregations