use of org.olat.core.id.context.ContextEntry in project openolat by klemens.
the class StudentCoursesController method openHome.
private void openHome(UserRequest ureq) {
List<ContextEntry> ces = new ArrayList<ContextEntry>(4);
ces.add(BusinessControlFactory.getInstance().createContextEntry(student));
BusinessControl bc = BusinessControlFactory.getInstance().createFromContextEntries(ces);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(bc, getWindowControl());
NewControllerFactory.getInstance().launch(ureq, bwControl);
}
use of org.olat.core.id.context.ContextEntry in project openolat by klemens.
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 klemens.
the class CourseController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty())
return;
ContextEntry ce = entries.get(0);
OLATResourceable ores = ce.getOLATResourceable();
if ("Identity".equals(ores.getResourceableTypeName())) {
Long identityKey = ores.getResourceableId();
for (EfficiencyStatementEntry entry : model.getObjects()) {
if (identityKey.equals(entry.getIdentityKey())) {
doSelectDetails(ureq, entry);
statementCtrl.activate(ureq, entries.subList(1, entries.size()), ce.getTransientState());
break;
}
}
}
}
use of org.olat.core.id.context.ContextEntry in project openolat by klemens.
the class LecturesToolController method activate.
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
if (entries == null || entries.isEmpty())
return;
ContextEntry entry = entries.get(0);
String type = entry.getOLATResourceable().getResourceableTypeName();
if ("coach".equalsIgnoreCase(type)) {
if (segmentView != null) {
segmentView.select(teacherLink);
}
List<ContextEntry> subEntries = entries.subList(1, entries.size());
doOpenTeacherView(ureq).activate(ureq, subEntries, entry.getTransientState());
} else if ("attendee".equalsIgnoreCase(type)) {
if (segmentView != null) {
segmentView.select(participantLink);
}
List<ContextEntry> subEntries = entries.subList(1, entries.size());
doOpenParticipantView(ureq).activate(ureq, subEntries, entry.getTransientState());
}
}
use of org.olat.core.id.context.ContextEntry in project openolat by klemens.
the class BaseFullWebappController method updateBusinessPath.
private String updateBusinessPath(UserRequest ureq, SiteInstance site) {
if (site == null)
return null;
try {
String businessPath = siteToBornSite.get(site).getController().getWindowControlForDebug().getBusinessControl().getAsString();
HistoryPoint point = ureq.getUserSession().getLastHistoryPoint();
int index = businessPath.indexOf(':');
if (index > 0 && point != null && point.getBusinessPath() != null) {
String start = businessPath.substring(0, index);
if (!point.getBusinessPath().startsWith(start)) {
// if a controller has not set its business path, don't pollute the mapping
List<ContextEntry> entries = siteToBornSite.get(site).getController().getWindowControlForDebug().getBusinessControl().getEntries();
siteToBusinessPath.put(site, new HistoryPointImpl(ureq.getUuid(), businessPath, entries));
return BusinessControlFactory.getInstance().getAsRestPart(entries, true);
}
List<ContextEntry> entries = siteToBornSite.get(site).getController().getWindowControlForDebug().getBusinessControl().getEntries();
businessPath = BusinessControlFactory.getInstance().getAsRestPart(entries, true);
}
siteToBusinessPath.put(site, point);
return businessPath;
} catch (Exception e) {
logError("", e);
return null;
}
}
Aggregations