Search in sources :

Example 36 with ContextEntry

use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.

the class VideoListingController method doShowVideo.

/**
 * Launch a single video and add to breadcrumb
 * @param ureq
 * @param id the video resource ID
 */
private void doShowVideo(UserRequest ureq, Long id) {
    RepositoryEntry videoEntry = repositoryManager.lookupRepositoryEntry(id);
    if (repositoryManager.isAllowed(ureq, videoEntry).canLaunch()) {
        boolean readOnly = repositoryManager.createRepositoryEntryStatus(videoEntry.getStatusCode()).isClosed();
        VideoDisplayController videoDisplayCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, true, true, true, true, null, false, true, null, readOnly);
        listenTo(videoDisplayCtr);
        toolbarPanel.pushController(videoEntry.getDisplayname(), videoDisplayCtr);
        // Update launch counter
        repositoryService.incrementLaunchCounter(videoEntry);
        // Update business path and URL
        ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(videoEntry);
        ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ce.getOLATResourceable()));
        WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
        addToHistory(ureq, bwControl);
    }
}
Also used : RepositoryEntry(org.olat.repository.RepositoryEntry) WindowControl(org.olat.core.gui.control.WindowControl) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 37 with ContextEntry

use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.

the class MembersOverviewController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    ContextEntry currentEntry = entries.get(0);
    String segment = currentEntry.getOLATResourceable().getResourceableTypeName();
    List<ContextEntry> subEntries = entries.subList(1, entries.size());
    if (SEG_ALL_MEMBERS.equals(segment)) {
        updateAllMembers(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
        segmentView.select(allMembersLink);
    } else if (SEG_OWNERS_MEMBERS.equals(segment)) {
        updateOwners(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
        segmentView.select(ownersLink);
    } else if (SEG_TUTORS_MEMBERS.equals(segment)) {
        updateTutors(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
        segmentView.select(tutorsLink);
    } else if (SEG_PARTICIPANTS_MEMBERS.equals(segment)) {
        updateParticipants(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
        segmentView.select(participantsLink);
    } else if (SEG_WAITING_MEMBERS.equals(segment)) {
        updateWaitingList(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
        segmentView.select(waitingListLink);
    } else if (SEG_SEARCH_MEMBERS.equals(segment)) {
        updateSearch(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
        segmentView.select(searchLink);
    }
}
Also used : ContextEntry(org.olat.core.id.context.ContextEntry)

Example 38 with ContextEntry

use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.

the class CoachMainController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty()) {
        selectMenuItem(ureq, "Members");
    } else {
        ContextEntry currentEntry = entries.get(0);
        String cmd = currentEntry.getOLATResourceable().getResourceableTypeName();
        Activateable2 selectedCtrl = selectMenuItem(ureq, cmd);
        if (selectedCtrl == null) {
            selectMenuItem(ureq, "Members");
        } else {
            List<ContextEntry> subEntries = entries.subList(1, entries.size());
            selectedCtrl.activate(ureq, subEntries, currentEntry.getTransientState());
        }
    }
}
Also used : Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 39 with ContextEntry

use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.

the class DocumentPoolMainController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty()) {
        if (taxonomyTree.getTreeModel().getRootNode().getChildCount() > 0) {
            doSelectTaxonomy(ureq);
        }
    } else {
        String resourceName = entries.get(0).getOLATResourceable().getResourceableTypeName();
        if ("Templates".equals(resourceName) || resourceName.startsWith("path=")) {
            TreeNode rootNode = taxonomyTree.getTreeModel().getRootNode();
            if (rootNode.getChildCount() > 0) {
                TaxonomyTreeNode node = (TaxonomyTreeNode) rootNode.getChildAt(0);
                if (node.getType() == TaxonomyTreeNodeType.templates) {
                    DocumentDirectoryController directoryCtrl = doSelectTemplatesDirectory(ureq, node);
                    if (directoryCtrl != null) {
                        taxonomyTree.setSelectedNode(node);
                        List<ContextEntry> subEntries = entries.subList(1, entries.size());
                        directoryCtrl.activate(ureq, subEntries, entries.get(0).getTransientState());
                    }
                }
            }
        } else if ("TaxonomyLevel".equalsIgnoreCase(resourceName)) {
            String levelKey = entries.get(0).getOLATResourceable().getResourceableId().toString();
            TaxonomyTreeNode node = (TaxonomyTreeNode) taxonomyTree.getTreeModel().getNodeById(levelKey);
            if (node != null) {
                DocumentPoolLevelController levelCtrl = doSelectTaxonomyLevel(ureq, node);
                if (levelCtrl != null) {
                    taxonomyTree.setSelectedNode(node);
                    List<ContextEntry> subEntries = entries.subList(1, entries.size());
                    levelCtrl.activate(ureq, subEntries, entries.get(0).getTransientState());
                }
            }
        }
    }
}
Also used : TreeNode(org.olat.core.gui.components.tree.TreeNode) TaxonomyTreeNode(org.olat.modules.taxonomy.model.TaxonomyTreeNode) TaxonomyTreeNode(org.olat.modules.taxonomy.model.TaxonomyTreeNode) List(java.util.List) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 40 with ContextEntry

use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.

the class QuestionPoolMainEditorController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty())
        return;
    OLATResourceable resource = entries.get(0).getOLATResourceable();
    if ("QuestionItem".equalsIgnoreCase(resource.getResourceableTypeName())) {
        activateQuestionItem(ureq, resource.getResourceableId(), entries);
    } else {
        TreeNode rootNode = menuTree.getTreeModel().getRootNode();
        TreeNode node = TreeHelper.findNodeByResourceableUserObject(resource, rootNode);
        if (node == null) {
            node = TreeHelper.findNodeByUserObject(resource.getResourceableTypeName(), rootNode);
        }
        if (node != null) {
            List<ContextEntry> subEntries = entries.subList(1, entries.size());
            stackPanel.popUpToRootController(ureq);
            doSelectControllerTreeNode(ureq, node, subEntries, entries.get(0).getTransientState());
            menuTree.setSelectedNode(node);
        }
    }
}
Also used : OLATResourceable(org.olat.core.id.OLATResourceable) MyQuestionsTreeNode(org.olat.modules.qpool.ui.tree.MyQuestionsTreeNode) ControllerTreeNode(org.olat.modules.qpool.ui.tree.ControllerTreeNode) CollectionTreeNode(org.olat.modules.qpool.ui.tree.CollectionTreeNode) TreeNode(org.olat.core.gui.components.tree.TreeNode) MarkedQuestionsTreeNode(org.olat.modules.qpool.ui.tree.MarkedQuestionsTreeNode) ContextEntry(org.olat.core.id.context.ContextEntry)

Aggregations

ContextEntry (org.olat.core.id.context.ContextEntry)270 OLATResourceable (org.olat.core.id.OLATResourceable)78 WindowControl (org.olat.core.gui.control.WindowControl)58 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)44 ArrayList (java.util.ArrayList)42 TreeNode (org.olat.core.gui.components.tree.TreeNode)30 Controller (org.olat.core.gui.control.Controller)26 RepositoryEntry (org.olat.repository.RepositoryEntry)24 List (java.util.List)22 Identity (org.olat.core.id.Identity)22 BusinessControl (org.olat.core.id.context.BusinessControl)22 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)20 BusinessControlFactory (org.olat.core.id.context.BusinessControlFactory)18 HistoryPoint (org.olat.core.id.context.HistoryPoint)18 CollaborationTools (org.olat.collaboration.CollaborationTools)16 GenericTreeNode (org.olat.core.gui.components.tree.GenericTreeNode)14 UserSession (org.olat.core.util.UserSession)14 CourseNode (org.olat.course.nodes.CourseNode)14 SubscriptionContext (org.olat.core.commons.services.notifications.SubscriptionContext)12 Translator (org.olat.core.gui.translator.Translator)12