Search in sources :

Example 6 with GlossaryMainController

use of org.olat.core.commons.modules.glossary.GlossaryMainController in project openolat by klemens.

the class GlossaryHandler method createEditorController.

@Override
public Controller createEditorController(RepositoryEntry re, UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbar) {
    VFSContainer glossaryFolder = GlossaryManager.getInstance().getGlossaryRootFolder(re.getOlatResource());
    Properties glossProps = GlossaryItemManager.getInstance().getGlossaryConfig(glossaryFolder);
    boolean editableByUser = "true".equals(glossProps.getProperty(GlossaryItemManager.EDIT_USERS));
    GlossarySecurityCallback secCallback;
    if (ureq.getUserSession().getRoles().isGuestOnly()) {
        secCallback = new GlossarySecurityCallbackImpl();
    } else {
        secCallback = new GlossarySecurityCallbackImpl(true, true, editableByUser, ureq.getIdentity().getKey());
    }
    GlossaryMainController gctr = new GlossaryMainController(wControl, ureq, glossaryFolder, re.getOlatResource(), secCallback, false);
    // use on column layout
    LayoutMain3ColsController layoutCtr = new LayoutMain3ColsController(ureq, wControl, gctr);
    // dispose content on layout dispose
    layoutCtr.addDisposableChildController(gctr);
    return layoutCtr;
}
Also used : GlossarySecurityCallback(org.olat.core.commons.modules.glossary.GlossarySecurityCallback) GlossaryMainController(org.olat.core.commons.modules.glossary.GlossaryMainController) GlossarySecurityCallbackImpl(org.olat.core.commons.modules.glossary.GlossarySecurityCallbackImpl) VFSContainer(org.olat.core.util.vfs.VFSContainer) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Properties(java.util.Properties)

Aggregations

GlossaryMainController (org.olat.core.commons.modules.glossary.GlossaryMainController)6 Properties (java.util.Properties)4 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)4 GlossarySecurityCallback (org.olat.core.commons.modules.glossary.GlossarySecurityCallback)4 GlossarySecurityCallbackImpl (org.olat.core.commons.modules.glossary.GlossarySecurityCallbackImpl)4 VFSContainer (org.olat.core.util.vfs.VFSContainer)4 RepositoryEntry (org.olat.repository.RepositoryEntry)4 UserRequest (org.olat.core.gui.UserRequest)2 WindowControl (org.olat.core.gui.control.WindowControl)2 ControllerCreator (org.olat.core.gui.control.creator.ControllerCreator)2 DTab (org.olat.core.gui.control.generic.dtabs.DTab)2 DTabs (org.olat.core.gui.control.generic.dtabs.DTabs)2 ContextEntry (org.olat.core.id.context.ContextEntry)2 ICourse (org.olat.course.ICourse)2 CourseConfig (org.olat.course.config.CourseConfig)2 RepositoryService (org.olat.repository.RepositoryService)2