Search in sources :

Example 1 with GlossaryMarkupItemController

use of org.olat.core.gui.control.generic.textmarker.GlossaryMarkupItemController in project openolat by klemens.

the class CourseGlossaryFactory method createGlossaryMarkupWrapper.

/**
 * The glossary wrapper enables the glossary in the given component. Meaning,
 * within the component the glossary terms are highlighted. The controller hides
 * itself, the user won't see anything besides the glossary terms.
 *
 * @param ureq
 * @param wControl
 * @param tmComponent the component to which the glossary should be applied
 * @param courseConfig use the glossary configuration from the given course
 *          configuration
 */
public static GlossaryMarkupItemController createGlossaryMarkupWrapper(UserRequest ureq, WindowControl wControl, Component tmComponent, CourseConfig courseConfig) {
    if (courseConfig.hasGlossary()) {
        RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(courseConfig.getGlossarySoftKey(), false);
        if (repoEntry == null) {
            // seems to be removed
            return null;
        }
        VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(repoEntry.getOlatResource());
        String glossaryId = repoEntry.getOlatResource().getResourceableId().toString();
        return new GlossaryMarkupItemController(ureq, wControl, tmComponent, glossaryFolder, glossaryId);
    }
    return null;
}
Also used : GlossaryMarkupItemController(org.olat.core.gui.control.generic.textmarker.GlossaryMarkupItemController) VFSContainer(org.olat.core.util.vfs.VFSContainer) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 2 with GlossaryMarkupItemController

use of org.olat.core.gui.control.generic.textmarker.GlossaryMarkupItemController in project OpenOLAT by OpenOLAT.

the class CourseGlossaryFactory method createGlossaryMarkupWrapper.

/**
 * The glossary wrapper enables the glossary in the given component. Meaning,
 * within the component the glossary terms are highlighted. The controller hides
 * itself, the user won't see anything besides the glossary terms.
 *
 * @param ureq
 * @param wControl
 * @param tmComponent the component to which the glossary should be applied
 * @param courseConfig use the glossary configuration from the given course
 *          configuration
 */
public static GlossaryMarkupItemController createGlossaryMarkupWrapper(UserRequest ureq, WindowControl wControl, Component tmComponent, CourseConfig courseConfig) {
    if (courseConfig.hasGlossary()) {
        RepositoryEntry repoEntry = RepositoryManager.getInstance().lookupRepositoryEntryBySoftkey(courseConfig.getGlossarySoftKey(), false);
        if (repoEntry == null) {
            // seems to be removed
            return null;
        }
        VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(repoEntry.getOlatResource());
        String glossaryId = repoEntry.getOlatResource().getResourceableId().toString();
        return new GlossaryMarkupItemController(ureq, wControl, tmComponent, glossaryFolder, glossaryId);
    }
    return null;
}
Also used : GlossaryMarkupItemController(org.olat.core.gui.control.generic.textmarker.GlossaryMarkupItemController) VFSContainer(org.olat.core.util.vfs.VFSContainer) RepositoryEntry(org.olat.repository.RepositoryEntry)

Aggregations

GlossaryMarkupItemController (org.olat.core.gui.control.generic.textmarker.GlossaryMarkupItemController)2 VFSContainer (org.olat.core.util.vfs.VFSContainer)2 RepositoryEntry (org.olat.repository.RepositoryEntry)2