use of org.olat.modules.taxonomy.Taxonomy in project openolat by klemens.
the class QTIImportProcessorTest method setup.
@Before
public void setup() {
if (owner == null) {
owner = JunitTestHelper.createAndPersistIdentityAsUser("QTI-imp-owner-" + UUID.randomUUID().toString());
}
Taxonomy taxonomy = null;
String taxonomyTreeKey = qPoolModule.getTaxonomyQPoolKey();
if (StringHelper.isLong(taxonomyTreeKey)) {
taxonomy = taxonomyDao.loadByKey(new Long(taxonomyTreeKey));
}
if (taxonomy == null) {
taxonomy = taxonomyDao.createTaxonomy("DP-1", "Doc-pool", "Taxonomy for document pool", null);
dbInstance.commitAndCloseSession();
qPoolModule.setTaxonomyQPoolKey(taxonomy.getKey().toString());
}
}
use of org.olat.modules.taxonomy.Taxonomy in project openolat by klemens.
the class QuestionPoolModule method initTaxonomy.
private void initTaxonomy() {
if (!StringHelper.isLong(taxonomyQPoolKey)) {
Taxonomy taxonomy = taxonomyDao.createTaxonomy(DEFAULT_TAXONOMY_QPOOL_IDENTIFIER, "Question pool", "taxonomy for the question pool", DEFAULT_TAXONOMY_QPOOL_IDENTIFIER);
dbInstance.commitAndCloseSession();
setTaxonomyQPoolKey(taxonomy.getKey().toString());
}
}
use of org.olat.modules.taxonomy.Taxonomy in project OpenOLAT by OpenOLAT.
the class TaxonomyLevelCompetenceController method doAddCompetence.
private void doAddCompetence(List<Identity> identities, TaxonomyCompetenceTypes comptenceType) {
Taxonomy taxonomy = taxonomyLevel.getTaxonomy();
for (Identity identity : identities) {
TaxonomyCompetence competence = taxonomyService.addTaxonomyLevelCompetences(taxonomyLevel, identity, comptenceType, null);
String after = taxonomyService.toAuditXml(competence);
taxonomyService.auditLog(TaxonomyCompetenceAuditLog.Action.addCompetence, null, after, null, taxonomy, competence, identity, getIdentity());
}
}
use of org.olat.modules.taxonomy.Taxonomy in project OpenOLAT by OpenOLAT.
the class TaxonomyListAdminController method doOpenTaxonomy.
private TaxonomyOverviewController doOpenTaxonomy(UserRequest ureq, TaxonomyRow row) {
removeAsListenerAndDispose(taxonomyCtrl);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Taxonomy", row.getKey());
WindowControl bwControl = addToHistory(ureq, ores, null);
Taxonomy taxonomy = taxonomyService.getTaxonomy(row);
taxonomyCtrl = new TaxonomyOverviewController(ureq, bwControl, taxonomy);
taxonomyCtrl.setBreadcrumbPanel(stackPanel);
listenTo(taxonomyCtrl);
stackPanel.changeDisplayname(translate("admin.menu.title"));
stackPanel.pushController(row.getDisplayName(), taxonomyCtrl);
return taxonomyCtrl;
}
use of org.olat.modules.taxonomy.Taxonomy in project OpenOLAT by OpenOLAT.
the class TaxonomyLevelOverviewController method doConfirmDelete.
private void doConfirmDelete(UserRequest ureq) {
taxonomyLevel = taxonomyService.getTaxonomyLevel(taxonomyLevel);
if (TaxonomyLevelManagedFlag.isManaged(taxonomyLevel.getManagedFlags(), TaxonomyLevelManagedFlag.delete)) {
showWarning("warning.atleastone.level");
return;
}
taxonomyLevel = taxonomyService.getTaxonomyLevel(taxonomyLevel);
Taxonomy taxonomy = taxonomyLevel.getTaxonomy();
List<TaxonomyLevel> levelToDelete = Collections.singletonList(taxonomyLevel);
confirmDeleteCtrl = new DeleteTaxonomyLevelController(ureq, getWindowControl(), levelToDelete, taxonomy);
listenTo(confirmDeleteCtrl);
String title = translate("confirmation.delete.level.title");
cmc = new CloseableModalController(getWindowControl(), "close", confirmDeleteCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
Aggregations