diff --git a/src/main/java/org/olat/course/run/RunMainController.java b/src/main/java/org/olat/course/run/RunMainController.java index ae018953271b18d8332897c5a2796c28cbd3e447..7f1b9f3c617835f948cf1446265b28deafb2b9b6 100644 --- a/src/main/java/org/olat/course/run/RunMainController.java +++ b/src/main/java/org/olat/course/run/RunMainController.java @@ -803,7 +803,7 @@ public class RunMainController extends MainLayoutBasicController implements Gene ContextEntry firstEntry = entries.get(0); String type = firstEntry.getOLATResourceable().getResourceableTypeName(); - if("CourseNode".equalsIgnoreCase(type)) { + if("CourseNode".equalsIgnoreCase(type) || "Part".equalsIgnoreCase(type)) { CourseNode cn = course.getRunStructure().getNode(firstEntry.getOLATResourceable().getResourceableId().toString()); if(currentCourseNode == null || !currentCourseNode.equals(cn)) { getWindowControl().makeFlat(); diff --git a/src/main/java/org/olat/dispatcher/AuthenticatedDispatcher.java b/src/main/java/org/olat/dispatcher/AuthenticatedDispatcher.java index 01504f82e2cfaf3afef0efe45f46b3f209135a09..c20801732bb025387ed4d410e275afd68fed349c 100644 --- a/src/main/java/org/olat/dispatcher/AuthenticatedDispatcher.java +++ b/src/main/java/org/olat/dispatcher/AuthenticatedDispatcher.java @@ -215,7 +215,6 @@ public class AuthenticatedDispatcher implements Dispatcher { // valid uri for dispatching (has timestamp, componentid and windowid) processValidDispatchURI(ureq, usess, request, response); } else { - final String origUri = request.getRequestURI(); String restPart = origUri.substring(uriPrefix.length()); try { @@ -225,7 +224,10 @@ public class AuthenticatedDispatcher implements Dispatcher { } String[] split = restPart.split("/"); - if (split.length > 0 && split.length % 2 == 0) { + if(restPart.startsWith("repo/go")) { + businessPath = convertJumpInURL(restPart, ureq); + processBusinessPath(businessPath, ureq, usess); + } else if (split.length > 0 && split.length % 2 == 0) { businessPath = BusinessControlFactory.getInstance().formatFromURI(restPart); processBusinessPath(businessPath, ureq, usess); } else { @@ -257,6 +259,27 @@ public class AuthenticatedDispatcher implements Dispatcher { } } + /** + * http://localhost:8080/olat/auth/repo/go?rid=819242&par=77013818723561 + * @param requestPart + * @param ureq + * @return + */ + private String convertJumpInURL(String requestPart, UserRequest ureq) { + String repoId = ureq.getParameter("rid"); + String businessPath = "[RepositoryEntry:" + repoId + "]"; + String par = ureq.getParameter("par"); + if(StringHelper.containsNonWhitespace(par) && StringHelper.isLong(par)) { + try { + Long parLong = Long.parseLong(par); + businessPath += "[Part:" + parLong + "]"; + } catch(NumberFormatException e) { + //it can happen + } + } + return businessPath; + } + private void processValidDispatchURI(UserRequest ureq, UserSession usess, HttpServletRequest request, HttpServletResponse response) { Windows ws = Windows.getWindows(ureq); Window window = ws.getWindow(ureq);