Search in sources :

Example 11 with StateEntry

use of org.olat.core.id.context.StateEntry in project openolat by klemens.

the class OrdersAdminController method addSearchToHistory.

protected void addSearchToHistory(UserRequest ureq) {
    StateEntry state = searchForm == null ? null : searchForm.getStateEntry();
    ContextEntry currentEntry = getWindowControl().getBusinessControl().getCurrentContextEntry();
    if (currentEntry != null) {
        currentEntry.setTransientState(state);
    }
    addToHistory(ureq, getWindowControl());
}
Also used : StateEntry(org.olat.core.id.context.StateEntry) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 12 with StateEntry

use of org.olat.core.id.context.StateEntry in project openolat by klemens.

the class BaseFullWebappController method back.

protected void back(UserRequest ureq, HistoryPoint cstate) {
    List<ContextEntry> entries = cstate.getEntries();
    if (entries.isEmpty())
        return;
    entries = new ArrayList<ContextEntry>(entries);
    ContextEntry state = entries.remove(0);
    // no red screen for this
    if (state == null)
        return;
    OLATResourceable ores = state.getOLATResourceable();
    if (ores != null && "HomeSite".equals(ores.getResourceableTypeName())) {
        activateSite(userTools, ureq, entries, false);
    } else {
        DTab dt = getDTab(ores);
        if (dt != null) {
            doActivateDTab(dt);
            if (dt.getController() instanceof Activateable2) {
                ((Activateable2) dt.getController()).activate(ureq, entries, null);
            }
            updateBusinessPath(ureq, dt);
        } else {
            StateEntry s = state.getTransientState();
            if (s instanceof StateSite && ((StateSite) s).getSite() != null && sites != null) {
                SiteInstance site = ((StateSite) s).getSite();
                for (SiteInstance savedSite : sites) {
                    if (savedSite != null && site.getClass().equals(savedSite.getClass())) {
                        activateSite(savedSite, ureq, entries, false);
                    }
                }
            }
        }
    }
}
Also used : DTab(org.olat.core.gui.control.generic.dtabs.DTab) StateEntry(org.olat.core.id.context.StateEntry) BornSiteInstance(org.olat.core.gui.control.navigation.BornSiteInstance) SiteInstance(org.olat.core.gui.control.navigation.SiteInstance) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) OLATResourceable(org.olat.core.id.OLATResourceable) StateSite(org.olat.core.id.context.StateSite) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 13 with StateEntry

use of org.olat.core.id.context.StateEntry in project openolat by klemens.

the class AssessmentIdentityListCourseTreeController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    boolean emptyEntries = entries == null || entries.isEmpty();
    if (emptyEntries) {
        TreeNode rootNode = menuTree.getTreeModel().getRootNode();
        if (rootNode.getUserObject() instanceof CourseNode) {
            doSelectCourseNode(ureq, (CourseNode) rootNode.getUserObject());
        }
    } else {
        String resourceTypeName = entries.get(0).getOLATResourceable().getResourceableTypeName();
        if ("Node".equalsIgnoreCase(resourceTypeName)) {
            Long nodeIdent = entries.get(0).getOLATResourceable().getResourceableId();
            CourseNode courseNode = CourseFactory.loadCourse(courseEntry).getRunStructure().getNode(nodeIdent.toString());
            TreeNode courseTreeNode = TreeHelper.findNodeByUserObject(courseNode, menuTree.getTreeModel().getRootNode());
            if (courseNode != null && courseTreeNode != null) {
                doSelectCourseNode(ureq, courseNode);
                menuTree.setSelectedNode(courseTreeNode);
            }
        }
    }
    if (currentCtrl instanceof Activateable2) {
        List<ContextEntry> subEntries = emptyEntries ? entries : entries.subList(1, entries.size());
        StateEntry subState = emptyEntries ? state : entries.get(0).getTransientState();
        ((Activateable2) currentCtrl).activate(ureq, subEntries, subState);
    }
}
Also used : StateEntry(org.olat.core.id.context.StateEntry) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) TreeNode(org.olat.core.gui.components.tree.TreeNode) AssessableCourseNode(org.olat.course.nodes.AssessableCourseNode) CourseNode(org.olat.course.nodes.CourseNode) GTACourseNode(org.olat.course.nodes.GTACourseNode) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 14 with StateEntry

use of org.olat.core.id.context.StateEntry in project openolat by klemens.

the class AssessmentCourseTreeController method processSelectCourseNodeWithMemory.

private void processSelectCourseNodeWithMemory(UserRequest ureq, TreeNode tn, CourseNode cn) {
    StateEntry listState = null;
    if (currentCtrl != null && currentCtrl == identityListCtrl) {
        listState = identityListCtrl.getListState();
    }
    Controller ctrl = doSelectCourseNode(ureq, tn, cn);
    if (ctrl instanceof Activateable2) {
        ((Activateable2) ctrl).activate(ureq, null, listState);
    }
}
Also used : StateEntry(org.olat.core.id.context.StateEntry) Activateable2(org.olat.core.gui.control.generic.dtabs.Activateable2) LayoutMain3ColsController(org.olat.core.commons.fullWebApp.LayoutMain3ColsController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController)

Aggregations

StateEntry (org.olat.core.id.context.StateEntry)14 ContextEntry (org.olat.core.id.context.ContextEntry)10 Activateable2 (org.olat.core.gui.control.generic.dtabs.Activateable2)6 OLATResourceable (org.olat.core.id.OLATResourceable)4 CatalogEntry (org.olat.repository.CatalogEntry)4 LayoutMain3ColsController (org.olat.core.commons.fullWebApp.LayoutMain3ColsController)2 TreeNode (org.olat.core.gui.components.tree.TreeNode)2 Controller (org.olat.core.gui.control.Controller)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 DTab (org.olat.core.gui.control.generic.dtabs.DTab)2 BornSiteInstance (org.olat.core.gui.control.navigation.BornSiteInstance)2 SiteInstance (org.olat.core.gui.control.navigation.SiteInstance)2 Identity (org.olat.core.id.Identity)2 StateSite (org.olat.core.id.context.StateSite)2 AssessableCourseNode (org.olat.course.nodes.AssessableCourseNode)2 CourseNode (org.olat.course.nodes.CourseNode)2 GTACourseNode (org.olat.course.nodes.GTACourseNode)2