use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project OpenOLAT by OpenOLAT.
the class CoachMainController method selectMenuItem.
private Activateable2 selectMenuItem(UserRequest ureq, String cmd) {
Controller selectedCtrl = null;
if ("members".equalsIgnoreCase(cmd) || "students".equalsIgnoreCase(cmd)) {
if (studentListCtrl == null) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Members", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
studentListCtrl = new StudentListController(ureq, bwControl, content);
listenTo(studentListCtrl);
}
selectedCtrl = studentListCtrl;
} else if ("groups".equalsIgnoreCase(cmd)) {
if (groupListCtrl == null) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Groups", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
groupListCtrl = new GroupListController(ureq, bwControl, content);
listenTo(groupListCtrl);
}
selectedCtrl = groupListCtrl;
} else if ("courses".equalsIgnoreCase(cmd)) {
if (courseListCtrl == null) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Courses", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
courseListCtrl = new CourseListController(ureq, bwControl, content);
listenTo(courseListCtrl);
}
selectedCtrl = courseListCtrl;
} else if ("lectures".equalsIgnoreCase(cmd)) {
if (lecturesSearchCtrl == null) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Lectures", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
lecturesSearchCtrl = new LecturesSearchController(ureq, bwControl, content);
listenTo(lecturesSearchCtrl);
}
selectedCtrl = lecturesSearchCtrl;
} else if ("search".equalsIgnoreCase(cmd)) {
if (userSearchCtrl == null) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Search", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
userSearchCtrl = new UserSearchController(ureq, bwControl, content);
listenTo(userSearchCtrl);
}
selectedCtrl = userSearchCtrl;
}
if (selectedCtrl != null) {
TreeNode selTreeNode = TreeHelper.findNodeByUserObject(cmd, menu.getTreeModel().getRootNode());
if (selTreeNode != null && !selTreeNode.getIdent().equals(menu.getSelectedNodeId())) {
menu.setSelectedNodeId(selTreeNode.getIdent());
}
content.rootController(selTreeNode.getTitle(), selectedCtrl);
addToHistory(ureq, selectedCtrl);
}
return (Activateable2) selectedCtrl;
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class MySharedItemsController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
MySharedItemRow row = model.getObject(se.getIndex());
if ("select".equals(cmd)) {
Activateable2 activateable = doSelectBinder(ureq, row);
if (activateable != null) {
activateable.activate(ureq, null, null);
}
}
} else if (event instanceof FlexiTableSearchEvent) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
loadModel(se.getSearch());
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class MySharedItemsController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty())
return;
String resName = entries.get(0).getOLATResourceable().getResourceableTypeName();
if ("Binder".equalsIgnoreCase(resName)) {
Long resId = entries.get(0).getOLATResourceable().getResourceableId();
MySharedItemRow activatedRow = null;
for (MySharedItemRow row : model.getObjects()) {
if (row.getBinderKey().equals(resId)) {
activatedRow = row;
break;
}
}
if (activatedRow != null) {
Activateable2 activeateable = doSelectBinder(ureq, activatedRow);
if (activeateable != null) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
activeateable.activate(ureq, subEntries, entries.get(0).getTransientState());
}
}
}
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class SharedBindersController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries.isEmpty())
return;
Long resId = entries.get(0).getOLATResourceable().getResourceableId();
String resName = entries.get(0).getOLATResourceable().getResourceableTypeName();
if ("Binder".equalsIgnoreCase(resName)) {
SharedItemRow activatedRow = null;
List<SharedItemRow> rows = model.getObjects();
for (SharedItemRow row : rows) {
if (row.getBinderKey().equals(resId)) {
activatedRow = row;
break;
}
}
if (activatedRow != null) {
Activateable2 activeateable = doSelectBinder(ureq, activatedRow);
if (activeateable != null) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
activeateable.activate(ureq, subEntries, entries.get(0).getTransientState());
}
}
}
}
use of org.olat.core.gui.control.generic.dtabs.Activateable2 in project openolat by klemens.
the class SharedBindersController method doSelectSection.
private void doSelectSection(UserRequest ureq) {
try {
String row = ureq.getParameter("select-section");
int index = Integer.parseInt(row);
SharedItemRow itemRow = model.getObject(index);
if (itemRow != null) {
String sectionParam = ureq.getParameter("section");
int sectionIndex = Integer.parseInt(sectionParam);
AssessedBinderSection section = itemRow.getSections().get(sectionIndex);
Activateable2 activeateable = doSelectBinder(ureq, itemRow);
if (activeateable != null) {
List<ContextEntry> entries = new ArrayList<>(2);
entries.add(BusinessControlFactory.getInstance().createContextEntry(OresHelper.createOLATResourceableInstance("Entries", 0l)));
entries.add(BusinessControlFactory.getInstance().createContextEntry(OresHelper.createOLATResourceableInstance("Section", section.getSectionKey())));
activeateable.activate(ureq, entries, null);
}
}
} catch (Exception e) {
logError("", e);
}
}
Aggregations