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());
}
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);
}
}
}
}
}
}
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);
}
}
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);
}
}
Aggregations