Search in sources :

Example 11 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project OpenOLAT by OpenOLAT.

the class SharedBindersController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries.isEmpty())
        return;
    Long resId = entries.get(0).getOLATResourceable().getResourceableId();
    String resName = entries.get(0).getOLATResourceable().getResourceableTypeName();
    if ("Binder".equalsIgnoreCase(resName)) {
        SharedItemRow activatedRow = null;
        List<SharedItemRow> rows = model.getObjects();
        for (SharedItemRow row : rows) {
            if (row.getBinderKey().equals(resId)) {
                activatedRow = row;
                break;
            }
        }
        if (activatedRow != null) {
            Activateable2 activeateable = doSelectBinder(ureq, activatedRow);
            if (activeateable != null) {
                List<ContextEntry> subEntries = entries.subList(1, entries.size());
                activeateable.activate(ureq, subEntries, entries.get(0).getTransientState());
            }
        }
    }
}
Also used : SharedItemRow(org.olat.modules.portfolio.model.SharedItemRow) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 12 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project OpenOLAT by OpenOLAT.

the class BusinessGroupMainRunController method doFolder.

private Activateable2 doFolder(UserRequest ureq) {
    addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLFOLDER, OlatResourceableType.sharedFolder));
    SubscriptionContext sc = new SubscriptionContext(businessGroup, INITVIEW_TOOLFOLDER);
    ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLFOLDER);
    ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ce.getOLATResourceable()));
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
    addToHistory(ureq, bwControl);
    CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
    collabToolCtr = collabTools.createFolderController(ureq, bwControl, businessGroup, isAdmin, sc);
    listenTo(collabToolCtr);
    mainPanel.setContent(collabToolCtr.getInitialComponent());
    return (Activateable2) collabToolCtr;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) CollaborationTools(org.olat.collaboration.CollaborationTools) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 13 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project OpenOLAT by OpenOLAT.

the class BusinessGroupMainRunController method doForum.

private Activateable2 doForum(UserRequest ureq) {
    addLoggingResourceable(LoggingResourceable.wrap(ORES_TOOLFORUM, OlatResourceableType.forum));
    SubscriptionContext sc = new SubscriptionContext(businessGroup, INITVIEW_TOOLFORUM);
    // calculate the new businesscontext for the forum clicked
    ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ORES_TOOLFORUM);
    WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
    addToHistory(ureq, bwControl);
    CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(businessGroup);
    collabToolCtr = collabTools.createForumController(ureq, bwControl, isAdmin, ureq.getUserSession().getRoles().isGuestOnly(), sc);
    listenTo(collabToolCtr);
    mainPanel.setContent(collabToolCtr.getInitialComponent());
    return (Activateable2) collabToolCtr;
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) CollaborationTools(org.olat.collaboration.CollaborationTools) SubscriptionContext(org.olat.core.commons.services.notifications.SubscriptionContext) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 14 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class GenericMainController method activate.

protected void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    ContextEntry entry = entries.get(0);
    TreeNode selectedNode = getMenuTree().getSelectedNode();
    String node = entry.getOLATResourceable().getResourceableTypeName();
    if (node != null && node.startsWith(GMCMT)) {
        activate(ureq, node + ":" + entries.get(0).getOLATResourceable().getResourceableId());
        if (entries.size() >= 1) {
            entries = entries.subList(1, entries.size());
        }
        if (contentCtr instanceof Activateable2) {
            ((Activateable2) contentCtr).activate(ureq, entries, entry.getTransientState());
        }
    } else {
        // maybe the node is a GAE-NavigationKey ?
        GenericActionExtension gAE = ExtManager.getInstance().getActionExtensioByNavigationKey(className, node);
        if (gAE != null) {
            // if the controller is already selected, only activate it, don't reinstanciate it
            if (selectedNode != null && selectedNode.getUserObject() != gAE) {
                activateTreeNodeByActionExtension(ureq, gAE);
            }
            if (entries.size() >= 1) {
                entries = entries.subList(1, entries.size());
            }
            if (contentCtr instanceof Activateable2) {
                ((Activateable2) contentCtr).activate(ureq, entries, entry.getTransientState());
            }
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) GenericTreeNode(org.olat.core.gui.components.tree.GenericTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) GenericActionExtension(org.olat.core.extensions.action.GenericActionExtension) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 15 with Activateable2

use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.

the class BinderListController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    String resName = entries.get(0).getOLATResourceable().getResourceableTypeName();
    if ("Binder".equalsIgnoreCase(resName)) {
        Long portfolioKey = entries.get(0).getOLATResourceable().getResourceableId();
        Activateable2 activateable = doOpenBinder(ureq, new BinderRefImpl(portfolioKey));
        if (activateable != null) {
            List<ContextEntry> subEntries = entries.subList(1, entries.size());
            activateable.activate(ureq, subEntries, entries.get(0).getTransientState());
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) BinderRefImpl(org.olat.modules.portfolio.model.BinderRefImpl) ContextEntry(org.olat.core.id.context.ContextEntry)

Aggregations

Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)78 ContextEntry (org.olat.core.id.context.ContextEntry)44 Controller (org.olat.core.gui.control.Controller)28 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)22 TreeNode (org.olat.core.gui.components.tree.TreeNode)16 WindowControl (org.olat.core.gui.control.WindowControl)16 BasicController (org.olat.core.gui.control.controller.BasicController)14 CourseNode (org.olat.course.nodes.CourseNode)12 CollaborationTools (org.olat.collaboration.CollaborationTools)10 SelectionEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent)10 MainLayoutBasicController (org.olat.core.gui.control.controller.MainLayoutBasicController)10 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)10 GTACourseNode (org.olat.course.nodes.GTACourseNode)10 FlexiTableSearchEvent (org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableSearchEvent)8 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)8 FormLink (org.olat.core.gui.components.form.flexible.elements.FormLink)6 ChiefController (org.olat.core.gui.control.ChiefController)6 VetoableCloseController (org.olat.core.gui.control.VetoableCloseController)6 BornSiteInstance (org.olat.core.gui.control.navigation.BornSiteInstance)6 OLATResourceable (org.olat.core.id.OLATResourceable)5