use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class IdentityListCourseNodeController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
String filter = null;
List<FlexiTableFilter> extendedFilters = null;
if (state instanceof AssessedIdentityListState) {
AssessedIdentityListState listState = (AssessedIdentityListState) state;
if (StringHelper.containsNonWhitespace(listState.getFilter())) {
filter = listState.getFilter();
}
extendedFilters = listState.getExtendedFilters();
}
tableEl.setSelectedFilterKey(filter);
if (extendedFilters != null) {
tableEl.setSelectedExtendedFilters(extendedFilters);
}
loadModel(ureq);
if (entries != null && entries.size() > 0) {
ContextEntry entry = entries.get(0);
String resourceType = entry.getOLATResourceable().getResourceableTypeName();
if ("Identity".equals(resourceType)) {
Long identityKey = entries.get(0).getOLATResourceable().getResourceableId();
for (int i = usersTableModel.getRowCount(); i-- > 0; ) {
AssessedIdentityElementRow row = usersTableModel.getObject(i);
if (row.getIdentityKey().equals(identityKey)) {
Controller ctrl = doSelect(ureq, row);
if (ctrl instanceof Activateable2) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
((Activateable2) ctrl).activate(ureq, subEntries, entry.getTransientState());
}
}
}
}
}
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 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.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class AssessmentCourseTreeController 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) {
if (view == null) {
view = View.users;
}
doSelectCourseNode(ureq, rootNode, (CourseNode) rootNode.getUserObject());
menuTree.setSelectedNode(rootNode);
}
} else {
ContextEntry entry = entries.get(0);
String resourceTypeName = entry.getOLATResourceable().getResourceableTypeName();
if ("Identity".equalsIgnoreCase(resourceTypeName)) {
TreeNode treeNode = menuTree.getTreeModel().getRootNode();
CourseNode courseNode = (CourseNode) treeNode.getUserObject();
if (courseNode != null) {
view = View.users;
Controller ctrl = doSelectCourseNode(ureq, treeNode, courseNode);
if (ctrl instanceof Activateable2) {
((Activateable2) ctrl).activate(ureq, entries, null);
}
menuTree.setSelectedNode(treeNode);
}
} else if ("Node".equalsIgnoreCase(resourceTypeName) || "CourseNode".equalsIgnoreCase(resourceTypeName)) {
Long nodeIdent = entries.get(0).getOLATResourceable().getResourceableId();
CourseNode courseNode = CourseFactory.loadCourse(courseEntry).getRunStructure().getNode(nodeIdent.toString());
TreeNode treeNode = TreeHelper.findNodeByUserObject(courseNode, menuTree.getTreeModel().getRootNode());
if (courseNode != null) {
if (view == null) {
view = View.users;
}
Controller ctrl = doSelectCourseNode(ureq, treeNode, courseNode);
if (ctrl instanceof Activateable2) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
((Activateable2) ctrl).activate(ureq, subEntries, entry.getTransientState());
}
menuTree.setSelectedNode(treeNode);
}
}
}
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 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);
}
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class MembersManagementMainController 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 cmd = currentEntry.getOLATResourceable().getResourceableTypeName();
Controller selectedCtrl = selectMenuItem(ureq, cmd);
if (selectedCtrl instanceof Activateable2) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
((Activateable2) selectedCtrl).activate(ureq, subEntries, currentEntry.getTransientState());
}
}
Aggregations