use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project OpenOLAT by OpenOLAT.
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 OpenOLAT.
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 OpenOLAT.
the class AssessmentIdentityListCourseTreeController method event.
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if (source == menuTree) {
if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
Object uo = menuTree.getSelectedNode().getUserObject();
if (uo instanceof CourseNode) {
CourseNode cn = (CourseNode) uo;
Controller ctrl = doSelectCourseNode(ureq, cn);
if (ctrl instanceof Activateable2) {
((Activateable2) ctrl).activate(ureq, null, null);
}
fireEvent(ureq, new CourseNodeEvent(CourseNodeEvent.SELECT_COURSE_NODE, cn.getIdent()));
}
}
}
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project OpenOLAT by OpenOLAT.
the class AssessmentCourseTreeController method switchToBusinessGroupsView.
protected void switchToBusinessGroupsView(UserRequest ureq) {
view = View.groups;
TreeNode treeNode = menuTree.getSelectedNode();
CourseNode courseNode = (CourseNode) treeNode.getUserObject();
Controller ctrl = doSelectCourseNode(ureq, treeNode, courseNode);
if (ctrl instanceof Activateable2) {
((Activateable2) ctrl).activate(ureq, null, null);
}
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project OpenOLAT by OpenOLAT.
the class AssessmentCourseTreeController method switchToUsersView.
/**
* Switch to the user list
*
* @param ureq
* @param stateOfUserList Optional
*/
protected void switchToUsersView(UserRequest ureq, StateEntry stateOfUserList) {
view = View.users;
TreeNode treeNode = menuTree.getSelectedNode();
CourseNode courseNode = (CourseNode) treeNode.getUserObject();
Controller ctrl = doSelectCourseNode(ureq, treeNode, courseNode);
if (ctrl instanceof Activateable2) {
((Activateable2) ctrl).activate(ureq, null, stateOfUserList);
}
}
Aggregations