Search in sources :

Example 86 with Taxonomy

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());
    }
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy) Before(org.junit.Before)

Example 87 with Taxonomy

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());
    }
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy)

Example 88 with Taxonomy

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());
    }
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy) TaxonomyCompetence(org.olat.modules.taxonomy.TaxonomyCompetence) Identity(org.olat.core.id.Identity)

Example 89 with Taxonomy

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;
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) Taxonomy(org.olat.modules.taxonomy.Taxonomy) WindowControl(org.olat.core.gui.control.WindowControl)

Example 90 with Taxonomy

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();
}
Also used : Taxonomy(org.olat.modules.taxonomy.Taxonomy) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) TaxonomyLevel(org.olat.modules.taxonomy.TaxonomyLevel)

Aggregations

Taxonomy (org.olat.modules.taxonomy.Taxonomy)194 Test (org.junit.Test)132 TaxonomyLevel (org.olat.modules.taxonomy.TaxonomyLevel)122 Identity (org.olat.core.id.Identity)56 URI (java.net.URI)36 HttpResponse (org.apache.http.HttpResponse)36 TaxonomyCompetence (org.olat.modules.taxonomy.TaxonomyCompetence)36 TaxonomyLevelType (org.olat.modules.taxonomy.TaxonomyLevelType)34 Date (java.util.Date)22 HttpGet (org.apache.http.client.methods.HttpGet)16 ArrayList (java.util.ArrayList)14 TaxonomyService (org.olat.modules.taxonomy.TaxonomyService)14 TaxonomyRefImpl (org.olat.modules.taxonomy.model.TaxonomyRefImpl)14 HttpPut (org.apache.http.client.methods.HttpPut)12 HashMap (java.util.HashMap)10 List (java.util.List)10 VFSContainer (org.olat.core.util.vfs.VFSContainer)10 QuestionItemImpl (org.olat.modules.qpool.model.QuestionItemImpl)10 TaxonomyLevelTypeToType (org.olat.modules.taxonomy.TaxonomyLevelTypeToType)10 TaxonomyLevelRefImpl (org.olat.modules.taxonomy.model.TaxonomyLevelRefImpl)10