Search in sources :

Example 1 with StateEntry

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

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 2 with StateEntry

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

the class CatalogNodeManagerController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty()) {
        return;
    }
    ContextEntry entry = entries.get(0);
    String type = entry.getOLATResourceable().getResourceableTypeName();
    if ("CatalogEntry".equalsIgnoreCase(type)) {
        Long entryKey = entry.getOLATResourceable().getResourceableId();
        if (entryKey != null && entryKey.longValue() > 0) {
            activateRoot(ureq, entryKey);
        }
    } else if ("Node".equalsIgnoreCase(type)) {
        // the "Node" is only for internal usage
        StateEntry stateEntry = entry.getTransientState();
        if (stateEntry instanceof CatalogStateEntry) {
            CatalogEntry catEntry = ((CatalogStateEntry) stateEntry).getEntry();
            CatalogNodeManagerController nextCtrl = selectCatalogEntry(ureq, catEntry);
            if (nextCtrl != null && entries.size() > 1) {
                nextCtrl.activate(ureq, entries.subList(1, entries.size()), null);
            }
        }
    }
}
Also used : StateEntry(org.olat.core.id.context.StateEntry) CatalogEntry(org.olat.repository.CatalogEntry) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 3 with StateEntry

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

the class CatalogNodeController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty()) {
        return;
    }
    ContextEntry entry = entries.get(0);
    String type = entry.getOLATResourceable().getResourceableTypeName();
    if ("CatalogEntry".equalsIgnoreCase(type)) {
        Long entryKey = entry.getOLATResourceable().getResourceableId();
        if (entryKey != null && entryKey.longValue() > 0) {
            activateRoot(ureq, entryKey);
        }
    } else if ("Node".equalsIgnoreCase(type)) {
        // the "Node" is only for internal usage
        StateEntry stateEntry = entry.getTransientState();
        if (stateEntry instanceof CatalogStateEntry) {
            CatalogEntry catalogEntry = ((CatalogStateEntry) stateEntry).getEntry();
            CatalogNodeController nextCtrl = selectCatalogEntry(ureq, catalogEntry);
            if (nextCtrl != null && entries.size() > 1) {
                nextCtrl.activate(ureq, entries.subList(1, entries.size()), null);
            }
        }
    }
}
Also used : StateEntry(org.olat.core.id.context.StateEntry) CatalogEntry(org.olat.repository.CatalogEntry) ContextEntry(org.olat.core.id.context.ContextEntry)

Example 4 with StateEntry

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

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)

Example 5 with StateEntry

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

the class CatalogNodeController method activate.

@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
    if (entries == null || entries.isEmpty()) {
        return;
    }
    ContextEntry entry = entries.get(0);
    String type = entry.getOLATResourceable().getResourceableTypeName();
    if ("CatalogEntry".equalsIgnoreCase(type)) {
        Long entryKey = entry.getOLATResourceable().getResourceableId();
        if (entryKey != null && entryKey.longValue() > 0) {
            activateRoot(ureq, entryKey);
        }
    } else if ("Node".equalsIgnoreCase(type)) {
        // the "Node" is only for internal usage
        StateEntry stateEntry = entry.getTransientState();
        if (stateEntry instanceof CatalogStateEntry) {
            CatalogEntry catalogEntry = ((CatalogStateEntry) stateEntry).getEntry();
            CatalogNodeController nextCtrl = selectCatalogEntry(ureq, catalogEntry);
            if (nextCtrl != null && entries.size() > 1) {
                nextCtrl.activate(ureq, entries.subList(1, entries.size()), null);
            }
        }
    }
}
Also used : StateEntry(org.olat.core.id.context.StateEntry) CatalogEntry(org.olat.repository.CatalogEntry) ContextEntry(org.olat.core.id.context.ContextEntry)

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