use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class VideoListingController method doShowVideo.
/**
* Launch a single video and add to breadcrumb
* @param ureq
* @param id the video resource ID
*/
private void doShowVideo(UserRequest ureq, Long id) {
RepositoryEntry videoEntry = repositoryManager.lookupRepositoryEntry(id);
if (repositoryManager.isAllowed(ureq, videoEntry).canLaunch()) {
boolean readOnly = repositoryManager.createRepositoryEntryStatus(videoEntry.getStatusCode()).isClosed();
VideoDisplayController videoDisplayCtr = new VideoDisplayController(ureq, getWindowControl(), videoEntry, true, true, true, true, null, false, true, null, readOnly);
listenTo(videoDisplayCtr);
toolbarPanel.pushController(videoEntry.getDisplayname(), videoDisplayCtr);
// Update launch counter
repositoryService.incrementLaunchCounter(videoEntry);
// Update business path and URL
ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(videoEntry);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ce.getOLATResourceable()));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl());
addToHistory(ureq, bwControl);
}
}
use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class MembersOverviewController 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 segment = currentEntry.getOLATResourceable().getResourceableTypeName();
List<ContextEntry> subEntries = entries.subList(1, entries.size());
if (SEG_ALL_MEMBERS.equals(segment)) {
updateAllMembers(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
segmentView.select(allMembersLink);
} else if (SEG_OWNERS_MEMBERS.equals(segment)) {
updateOwners(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
segmentView.select(ownersLink);
} else if (SEG_TUTORS_MEMBERS.equals(segment)) {
updateTutors(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
segmentView.select(tutorsLink);
} else if (SEG_PARTICIPANTS_MEMBERS.equals(segment)) {
updateParticipants(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
segmentView.select(participantsLink);
} else if (SEG_WAITING_MEMBERS.equals(segment)) {
updateWaitingList(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
segmentView.select(waitingListLink);
} else if (SEG_SEARCH_MEMBERS.equals(segment)) {
updateSearch(ureq).activate(ureq, subEntries, currentEntry.getTransientState());
segmentView.select(searchLink);
}
}
use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class CoachMainController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty()) {
selectMenuItem(ureq, "Members");
} else {
ContextEntry currentEntry = entries.get(0);
String cmd = currentEntry.getOLATResourceable().getResourceableTypeName();
Activateable2 selectedCtrl = selectMenuItem(ureq, cmd);
if (selectedCtrl == null) {
selectMenuItem(ureq, "Members");
} else {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
selectedCtrl.activate(ureq, subEntries, currentEntry.getTransientState());
}
}
}
use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class DocumentPoolMainController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty()) {
if (taxonomyTree.getTreeModel().getRootNode().getChildCount() > 0) {
doSelectTaxonomy(ureq);
}
} else {
String resourceName = entries.get(0).getOLATResourceable().getResourceableTypeName();
if ("Templates".equals(resourceName) || resourceName.startsWith("path=")) {
TreeNode rootNode = taxonomyTree.getTreeModel().getRootNode();
if (rootNode.getChildCount() > 0) {
TaxonomyTreeNode node = (TaxonomyTreeNode) rootNode.getChildAt(0);
if (node.getType() == TaxonomyTreeNodeType.templates) {
DocumentDirectoryController directoryCtrl = doSelectTemplatesDirectory(ureq, node);
if (directoryCtrl != null) {
taxonomyTree.setSelectedNode(node);
List<ContextEntry> subEntries = entries.subList(1, entries.size());
directoryCtrl.activate(ureq, subEntries, entries.get(0).getTransientState());
}
}
}
} else if ("TaxonomyLevel".equalsIgnoreCase(resourceName)) {
String levelKey = entries.get(0).getOLATResourceable().getResourceableId().toString();
TaxonomyTreeNode node = (TaxonomyTreeNode) taxonomyTree.getTreeModel().getNodeById(levelKey);
if (node != null) {
DocumentPoolLevelController levelCtrl = doSelectTaxonomyLevel(ureq, node);
if (levelCtrl != null) {
taxonomyTree.setSelectedNode(node);
List<ContextEntry> subEntries = entries.subList(1, entries.size());
levelCtrl.activate(ureq, subEntries, entries.get(0).getTransientState());
}
}
}
}
}
use of org.olat.core.id.context.ContextEntry in project OpenOLAT by OpenOLAT.
the class QuestionPoolMainEditorController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty())
return;
OLATResourceable resource = entries.get(0).getOLATResourceable();
if ("QuestionItem".equalsIgnoreCase(resource.getResourceableTypeName())) {
activateQuestionItem(ureq, resource.getResourceableId(), entries);
} else {
TreeNode rootNode = menuTree.getTreeModel().getRootNode();
TreeNode node = TreeHelper.findNodeByResourceableUserObject(resource, rootNode);
if (node == null) {
node = TreeHelper.findNodeByUserObject(resource.getResourceableTypeName(), rootNode);
}
if (node != null) {
List<ContextEntry> subEntries = entries.subList(1, entries.size());
stackPanel.popUpToRootController(ureq);
doSelectControllerTreeNode(ureq, node, subEntries, entries.get(0).getTransientState());
menuTree.setSelectedNode(node);
}
}
}
Aggregations