diff --git a/src/main/java/de/bps/course/nodes/den/DENManager.java b/src/main/java/de/bps/course/nodes/den/DENManager.java index 39d4a9dfa07bdbefb8217c8380a30348408e3004..ca08e4b90b49bdeb9f4debdd0532829712337bce 100644 --- a/src/main/java/de/bps/course/nodes/den/DENManager.java +++ b/src/main/java/de/bps/course/nodes/den/DENManager.java @@ -47,13 +47,15 @@ import org.olat.core.gui.translator.Translator; import org.olat.core.id.Identity; import org.olat.core.id.OLATResourceable; import org.olat.core.id.UserConstants; +import org.olat.core.id.context.BusinessControlFactory; +import org.olat.core.id.context.ContextEntry; import org.olat.core.util.CodeHelper; -import org.olat.core.util.WebappHelper; import org.olat.core.util.coordinate.CoordinatorManager; import org.olat.core.util.coordinate.SyncerExecutor; import org.olat.core.util.mail.ContactList; import org.olat.core.util.mail.ContactMessage; import org.olat.core.util.mail.MailTemplate; +import org.olat.core.util.resource.OresHelper; import org.olat.course.CourseFactory; import org.olat.course.ICourse; import org.olat.course.nodes.CourseNodeFactory; @@ -854,12 +856,16 @@ public class DENManager { private void createKalendarEventLinks(ICourse course, DENCourseNode courseNode, KalendarEvent event) { List kalendarEventLinks = event.getKalendarEventLinks(); - StringBuilder extLink = new StringBuilder(); - extLink.append(WebappHelper.getContextRoot()).append("/auth/repo/go?rid="); RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(course, true); - extLink.append(re.getKey()).append("&par=").append(courseNode.getIdent()); + + OLATResourceable oresNode = OresHelper.createOLATResourceableInstance("CourseNode", Long.valueOf(courseNode.getIdent())); + List<ContextEntry> ces = new ArrayList<ContextEntry>(); + ces.add(BusinessControlFactory.getInstance().createContextEntry(re)); + ces.add(BusinessControlFactory.getInstance().createContextEntry(oresNode)); + String extLink = BusinessControlFactory.getInstance().getAsURIString(ces, false); + String iconCssClass = CourseNodeFactory.getInstance().getCourseNodeConfiguration(courseNode.getType()).getIconCSSClass(); - KalendarEventLink link = new KalendarEventLink("COURSE", courseNode.getIdent(), courseNode.getShortTitle(), extLink.toString(), iconCssClass); + KalendarEventLink link = new KalendarEventLink("COURSE", courseNode.getIdent(), courseNode.getShortTitle(), extLink, iconCssClass); kalendarEventLinks.clear(); kalendarEventLinks.add(link); } diff --git a/src/main/java/org/olat/bookmark/BookmarkManager.java b/src/main/java/org/olat/bookmark/BookmarkManager.java index fb73b0e395f46624e64c0422a2494c6956a8daa6..4df68948153e930eb5d8dd268b82e00059cb3e56 100644 --- a/src/main/java/org/olat/bookmark/BookmarkManager.java +++ b/src/main/java/org/olat/bookmark/BookmarkManager.java @@ -54,7 +54,7 @@ public abstract class BookmarkManager extends BasicManager { * @param identity * @return a List of found bookmarks of given subject */ - public abstract List findBookmarksByIdentity(Identity identity); + public abstract List<Bookmark> findBookmarksByIdentity(Identity identity); /** * Finds bookmarks of a specific type for an identity @@ -63,7 +63,7 @@ public abstract class BookmarkManager extends BasicManager { * @param type * @return list of bookmarks for this identity */ - public abstract List findBookmarksByIdentity(Identity identity, String type); + public abstract List<Bookmark> findBookmarksByIdentity(Identity identity, String type); /** * @param changedBookmark diff --git a/src/main/java/org/olat/catalog/CatalogBookmarkHandler.java b/src/main/java/org/olat/catalog/CatalogBookmarkHandler.java index b99e319c16a7a7ca9b7fa73d291ab736e63c844a..ca80f3c77828b6b2c0690d2e5d5dd1f94982b047 100644 --- a/src/main/java/org/olat/catalog/CatalogBookmarkHandler.java +++ b/src/main/java/org/olat/catalog/CatalogBookmarkHandler.java @@ -19,6 +19,8 @@ */ package org.olat.catalog; +import java.util.Collections; + import org.olat.bookmark.Bookmark; import org.olat.bookmark.BookmarkHandler; import org.olat.bookmark.BookmarkManager; @@ -26,6 +28,9 @@ import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.generic.dtabs.DTabs; import org.olat.core.id.OLATResourceable; +import org.olat.core.id.context.BusinessControlFactory; +import org.olat.core.id.context.ContextEntry; +import org.olat.core.util.resource.OresHelper; import org.olat.repository.site.RepositorySite; /** @@ -63,8 +68,10 @@ public class CatalogBookmarkHandler implements BookmarkHandler { public String createJumpInURL(Bookmark bookmark) { OLATResourceable reores = BookmarkManager.getInstance().getLaunchOlatResourceable(bookmark); // only create jump in urls for bookmarks of type catalog entry - if(reores.getResourceableTypeName().equals(CatalogManager.CATALOGENTRY)){ - return CatalogJumpInHandlerFactory.buildRepositoryDispatchURI(bookmark.getOlatreskey()); + if(reores.getResourceableTypeName().equals(CatalogManager.CATALOGENTRY)){ + OLATResourceable ores = OresHelper.createOLATResourceableInstance(CatalogManager.CATALOGENTRY, bookmark.getOlatreskey()); + ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ores); + return BusinessControlFactory.getInstance().getAsURIString(Collections.singletonList(ce), false); } return null; } diff --git a/src/main/java/org/olat/catalog/CatalogJumpInHandlerFactory.java b/src/main/java/org/olat/catalog/CatalogJumpInHandlerFactory.java index ddd9f11021c06cdde5adeb956f75a0ebe9d16c69..591babd0b1f94795b323ad0418c6e678b13f8944 100644 --- a/src/main/java/org/olat/catalog/CatalogJumpInHandlerFactory.java +++ b/src/main/java/org/olat/catalog/CatalogJumpInHandlerFactory.java @@ -19,15 +19,11 @@ */ package org.olat.catalog; -import java.util.Locale; - -import org.olat.core.dispatcher.DispatcherAction; import org.olat.core.dispatcher.jumpin.JumpInHandlerFactory; import org.olat.core.dispatcher.jumpin.JumpInReceptionist; import org.olat.core.dispatcher.jumpin.JumpInResult; import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.WindowControl; -import org.olat.core.helpers.Settings; import org.olat.core.id.OLATResourceable; import org.olat.core.util.resource.OresHelper; import org.olat.repository.site.RepositorySite; @@ -44,44 +40,11 @@ import org.olat.repository.site.RepositorySite; public class CatalogJumpInHandlerFactory implements JumpInHandlerFactory { public static final String CONST_CAID = "caid"; - private static final String CONST_EXTLINK = "cata/go"; public JumpInReceptionist createJumpInHandler(UserRequest ureq) { String catEntryId = ureq.getParameter(CONST_CAID); return new CatalogJumpInReceptionist(catEntryId); } - - /** - * Build a dispatch URI which a user can use to call re directly by entering - * the dispatch URI into his/her browser location bar. - * - * @param catEntryId The catalog entry key - * @return Complete dispatch URI. - */ - public static String buildRepositoryDispatchURI(long catEntryId) { - StringBuffer sb = new StringBuffer(); - sb.append(Settings.getServerContextPathURI()).append(DispatcherAction.PATH_AUTHENTICATED).append(CONST_EXTLINK).append("?").append( - CONST_CAID).append("=").append(catEntryId); - return sb.toString(); - } - - /** - * Build a dispatch URI which a guest user can use to call re directly by - * entering the dispatch URI into his/her browser location bar. - * <p> - * When displaying the URL in a HTML page, don't forget to format the URL with - * Formatter.esc() because this URL contains & characters. - * - * @param catEntryId The catalog entry key - * @param loc The users language - * @return Complete dispatch URI. - */ - public static String buildRepositoryDispatchGuestURI(long catEntryId, Locale loc) { - StringBuffer sb = new StringBuffer(); - sb.append(buildRepositoryDispatchURI(catEntryId)).append("&guest=true&lang=").append(loc.toString()); - return sb.toString(); - } - } /** diff --git a/src/main/java/org/olat/core/dispatcher/DispatcherAction.java b/src/main/java/org/olat/core/dispatcher/DispatcherAction.java index 9df9971e7add21f3f4c0a8d66a8777c1347c7248..71c33de88511d33774c8b2d7a9d9a30b9454eb8a 100644 --- a/src/main/java/org/olat/core/dispatcher/DispatcherAction.java +++ b/src/main/java/org/olat/core/dispatcher/DispatcherAction.java @@ -75,7 +75,6 @@ public class DispatcherAction implements Dispatcher { private Map<String, Dispatcher> dispatchers; // brasato::remove!! - // used by core.dispatcher.jumpin.JumpInManager.getJumpInUri // ............used by BusinessGroupMainRunController // ............used by DropboxScoringViewController // used by olat.basesecurity.AuthHelper.doLogin diff --git a/src/main/java/org/olat/core/dispatcher/jumpin/JumpInHandlerFactory.java b/src/main/java/org/olat/core/dispatcher/jumpin/JumpInHandlerFactory.java index 04469d036f20857645cf372f78e7bfa7de6f22f1..5b6a629d1d0e850d9cd15d07264674e3513ffa95 100644 --- a/src/main/java/org/olat/core/dispatcher/jumpin/JumpInHandlerFactory.java +++ b/src/main/java/org/olat/core/dispatcher/jumpin/JumpInHandlerFactory.java @@ -33,6 +33,7 @@ import org.olat.core.gui.UserRequest; * Initial Date: 23.02.2005 <br> * * @author Felix Jost + * @deprecated Use business path instead */ public interface JumpInHandlerFactory { public JumpInReceptionist createJumpInHandler(UserRequest ureq); diff --git a/src/main/java/org/olat/core/dispatcher/jumpin/JumpInManager.java b/src/main/java/org/olat/core/dispatcher/jumpin/JumpInManager.java index 6920cd60a5cfe3fffb83a602606ba32e44e9c609..d86ff9e1470a108a7d1e28305350ace18c6959f2 100644 --- a/src/main/java/org/olat/core/dispatcher/jumpin/JumpInManager.java +++ b/src/main/java/org/olat/core/dispatcher/jumpin/JumpInManager.java @@ -45,6 +45,7 @@ import org.olat.core.util.servlets.URLEncoder; * Initial Date: 23.02.2005 <br> * * @author Felix Jost + * @deprecated Use business path instead */ public class JumpInManager extends BasicManager { private static JumpInManager INSTANCE; diff --git a/src/main/java/org/olat/core/gui/components/Window.java b/src/main/java/org/olat/core/gui/components/Window.java index 756c5b6caeca24cf25b15eeac7b8d19c73f1a2a0..8583faa5c00da2c59f886d9c56e579d8cac77dc9 100644 --- a/src/main/java/org/olat/core/gui/components/Window.java +++ b/src/main/java/org/olat/core/gui/components/Window.java @@ -426,11 +426,6 @@ public class Window extends Container { long durationAfterHandleDirties = System.currentTimeMillis() - debug_start; Tracing.logDebug("Perf-Test: Window durationAfterHandleDirties=" + durationAfterHandleDirties, Window.class); } - //DUMP FOR EACH CLICK THE CURRENT JumpInPath -> for later usage and debugging. - //System.err.println("V^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^V"); - WindowControl current = (WindowControl)wbackofficeImpl.getWindow().getAttribute("BUSPATH"); - //System.err.println(current != null ? JumpInManager.getRestJumpInUri(current.getBusinessControl()) : "NONE"); - //System.err.println("T^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^T"); wbackofficeImpl.fireCycleEvent(AFTER_INLINE_RENDERING); if (co != null) { // see method handleDirties for the rare case of co == null even if there are dirty components; wbackofficeImpl.sendCommandTo(co); @@ -733,11 +728,6 @@ public class Window extends Container { debugMsg.append("inl_comp:").append(diff).append(LOG_SEPARATOR); } - //DUMP FOR EACH CLICK THE CURRENT JumpInPath -> for later usage and debugging. - //System.err.println("VV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^VV"); - //WindowControl current = (WindowControl)wbackofficeImpl.getWindow().getAttribute("BUSPATH"); - //System.err.println(current != null ? JumpInManager.getRestJumpInUri(current.getBusinessControl()) : "NONE"); - //System.err.println("TT^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^TT"); wbackofficeImpl.fireCycleEvent(AFTER_INLINE_RENDERING); ServletUtil.serveStringResource(request, response, result); if (isDebugLog) { diff --git a/src/main/java/org/olat/core/id/context/BusinessControlFactory.java b/src/main/java/org/olat/core/id/context/BusinessControlFactory.java index 9d39b648c26a62b7a4c7aeb0c1e6ba621fba933f..a7641cbb606f0f67b85d232fc62a153bc438bead 100644 --- a/src/main/java/org/olat/core/id/context/BusinessControlFactory.java +++ b/src/main/java/org/olat/core/id/context/BusinessControlFactory.java @@ -339,7 +339,6 @@ public class BusinessControlFactory { retVal.append(Settings.getServerContextPathURI()) .append("/url/"); - //see code in JumpInManager, cannot be used, as it needs BusinessControl-Elements, not the path String lastEntryString = null; for (ContextEntry contextEntry : ceList) { String ceStr = contextEntry != null ? contextEntry.toString() : "NULL_ENTRY"; @@ -412,7 +411,6 @@ public class BusinessControlFactory { if(ceList == null || ceList.isEmpty()) return ""; StringBuilder retVal = new StringBuilder(); - //see code in JumpInManager, cannot be used, as it needs BusinessControl-Elements, not the path for (ContextEntry contextEntry : ceList) { String ceStr = contextEntry != null ? contextEntry.toString() : "NULL_ENTRY"; if(ceStr.startsWith("[path")) { diff --git a/src/main/java/org/olat/course/archiver/ScoreAccountingArchiveController.java b/src/main/java/org/olat/course/archiver/ScoreAccountingArchiveController.java index d0f98a0022a23985fcc678f54a4402b376ca5ed6..4d73b384b464115ee824cc834b9135686d261f0f 100644 --- a/src/main/java/org/olat/course/archiver/ScoreAccountingArchiveController.java +++ b/src/main/java/org/olat/course/archiver/ScoreAccountingArchiveController.java @@ -47,6 +47,7 @@ import org.olat.core.util.ExportUtil; import org.olat.core.util.Util; import org.olat.course.CourseFactory; import org.olat.course.ICourse; +import org.olat.course.nodes.AssessableCourseNode; import org.olat.user.UserManager; /** @@ -95,7 +96,7 @@ public class ScoreAccountingArchiveController extends DefaultController { if (source == startButton) { ICourse course = CourseFactory.loadCourse(ores); List<Identity> users = ScoreAccountingHelper.loadUsers(course.getCourseEnvironment()); - List nodes = ScoreAccountingHelper.loadAssessableNodes(course.getCourseEnvironment()); + List<AssessableCourseNode> nodes = ScoreAccountingHelper.loadAssessableNodes(course.getCourseEnvironment()); String result = ScoreAccountingHelper.createCourseResultsOverviewTable(users, nodes, course, ureq.getLocale()); diff --git a/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java b/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java index 7f8119b944d2ac1520dfef6bab707e1e62b86c2f..78cbb7be22d2d4454c7b4454189da0ec80c0e6ee 100644 --- a/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java +++ b/src/main/java/org/olat/course/archiver/ScoreAccountingHelper.java @@ -404,7 +404,10 @@ public class ScoreAccountingHelper { secGroups.add(re.getParticipantGroup()); } - return securityManager.getIdentitiesOfSecurityGroups(secGroups); + List<Identity> userList = securityManager.getIdentitiesOfSecurityGroups(secGroups); + List<Identity> assessedList = courseEnv.getCoursePropertyManager().getAllIdentitiesWithCourseAssessmentData(userList); + userList.addAll(assessedList); + return userList; } /** diff --git a/src/main/java/org/olat/course/assessment/AssessmentMainController.java b/src/main/java/org/olat/course/assessment/AssessmentMainController.java index 60eee9af80108b4af509e233f9d6d9537dc5a3a0..6903e3a84314955f269b09372cfa69afb691342c 100644 --- a/src/main/java/org/olat/course/assessment/AssessmentMainController.java +++ b/src/main/java/org/olat/course/assessment/AssessmentMainController.java @@ -29,11 +29,9 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Set; import org.apache.commons.lang.StringEscapeUtils; import org.olat.admin.user.UserTableDataModel; @@ -290,7 +288,7 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea if(focusOnIdentity != null) { //fill the user list for the this.mode = MODE_USERFOCUS; - this.identitiesList = getAllIdentitisFromGroupmanagement(); + this.identitiesList = getAllAssessableIdentities(); //fxdiff FXOLAT-108: improve results table of tests doUserChooseWithData(ureq, identitiesList, null, null); @@ -331,7 +329,7 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea main.setContent(index); } else if (cmd.equals(CMD_USERFOCUS)) { this.mode = MODE_USERFOCUS; - this.identitiesList = getAllIdentitisFromGroupmanagement(); + this.identitiesList = getAllAssessableIdentities(); //fxdiff FXOLAT-108: improve results table of tests doUserChooseWithData(ureq, identitiesList, null, null); } else if (cmd.equals(CMD_GROUPFOCUS)) { @@ -346,7 +344,7 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea } } } else if (source == allUsersButton){ - this.identitiesList = getAllIdentitisFromGroupmanagement(); + this.identitiesList = getAllAssessableIdentities(); // Init the user list with this identitites list this.currentGroup = null; doUserChooseWithData(ureq, this.identitiesList, null, this.currentCourseNode); @@ -469,7 +467,7 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea this.currentCourseNode = (AssessableCourseNode) node; // cast should be save, only assessable nodes are selectable if((repoTutor && coachedGroups.isEmpty()) || (callback.mayAssessAllUsers() || callback.mayViewAllUsersAssessments())) { - identitiesList = getAllIdentitisFromGroupmanagement(); + identitiesList = getAllAssessableIdentities(); doUserChooseWithData(ureq, this.identitiesList, null, currentCourseNode); } else { doGroupChoose(ureq); @@ -601,69 +599,32 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea } /** - * @return List of all course participants + * Load the identities which are participants of a group attached to the course, + * participants of the course as members and all users which have make the tests. + * @return List of identities */ - /*List<Identity> getAllIdentitisFromGroupmanagement() { - List<Identity> allUsersList = new ArrayList<Identity>(); - BaseSecurity secMgr = BaseSecurityManager.getInstance(); - Iterator<BusinessGroup> iter = this.coachedGroups.iterator(); - List<SecurityGroup> secGroups = new ArrayList<SecurityGroup>(); - while (iter.hasNext()) { - BusinessGroup group = iter.next(); - SecurityGroup secGroup = group.getPartipiciantGroup(); - secGroups.add(secGroup); - List<Identity> identities = secMgr.getIdentitiesOfSecurityGroup(secGroup); - for (Iterator<Identity> identitiyIter = identities.iterator(); identitiyIter.hasNext();) { - Identity identity = identitiyIter.next(); - if (!PersistenceHelper.listContainsObjectByKey(allUsersList, identity)) { - // only add if not already in list - allUsersList.add(identity); - } - } - } - - List<Long> idKeys = secMgr.getIdentitiesOfSecurityGroups(secGroups); - System.out.println(); - - //fxdiff VCRP-1,2: access control of resources - if((repoTutor && coachedGroups.isEmpty()) || (callback.mayAssessAllUsers() || callback.mayViewAllUsersAssessments())) { - RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(ores, false); - if(re.getParticipantGroup() != null) { - for (Identity identity : secMgr.getIdentitiesOfSecurityGroup(re.getParticipantGroup())) { - if (!PersistenceHelper.listContainsObjectByKey(allUsersList, identity)) { - allUsersList.add(identity); - } - } - } - } - - return allUsersList; - }*/ - - List<Identity> getAllIdentitisFromGroupmanagement() { + private List<Identity> getAllAssessableIdentities() { List<SecurityGroup> secGroups = new ArrayList<SecurityGroup>(); for (BusinessGroup group: coachedGroups) { secGroups.add(group.getPartipiciantGroup()); } - - BaseSecurity secMgr = BaseSecurityManager.getInstance(); - List<Identity> usersList = secMgr.getIdentitiesOfSecurityGroups(secGroups); - Set<Identity> smashDuplicates = new HashSet<Identity>(usersList); - List<Identity> allUsersList = new ArrayList<Identity>(usersList); - + //fxdiff VCRP-1,2: access control of resources if((repoTutor && coachedGroups.isEmpty()) || (callback.mayAssessAllUsers() || callback.mayViewAllUsersAssessments())) { RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(ores, false); if(re.getParticipantGroup() != null) { - for (Identity identity : secMgr.getIdentitiesOfSecurityGroup(re.getParticipantGroup())) { - if (!smashDuplicates.contains(identity)) { - allUsersList.add(identity); - } - } + secGroups.add(re.getParticipantGroup()); } } - return allUsersList; + BaseSecurity secMgr = BaseSecurityManager.getInstance(); + List<Identity> usersList = secMgr.getIdentitiesOfSecurityGroups(secGroups); + + ICourse course = CourseFactory.loadCourse(ores); + CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager(); + List<Identity> assessedRsers = pm.getAllIdentitiesWithCourseAssessmentData(usersList); + usersList.addAll(assessedRsers); + return usersList; } /** @@ -888,7 +849,7 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea private void doBulkChoose(UserRequest ureq) { ICourse course = CourseFactory.loadCourse(ores); - List<Identity> allowedIdentities = getAllIdentitisFromGroupmanagement(); + List<Identity> allowedIdentities = getAllAssessableIdentities(); removeAsListenerAndDispose(bamc); bamc = new BulkAssessmentMainController(ureq, getWindowControl(), course, allowedIdentities); listenTo(bamc); @@ -1178,7 +1139,7 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea course.getCourseEnvironment().getAssessmentManager().preloadCache(); // 2) preload controller local user environment cache start = System.currentTimeMillis(); - List<Identity> identities = getAllIdentitisFromGroupmanagement(); + List<Identity> identities = getAllAssessableIdentities(); CourseNode node = course.getCourseEnvironment().getRunStructure().getRootNode(); CoursePropertyManager pm = course.getCourseEnvironment().getCoursePropertyManager(); @@ -1250,7 +1211,7 @@ AssessmentMainController(UserRequest ureq, WindowControl wControl, OLATResourcea } mode = MODE_USERFOCUS; - identitiesList = getAllIdentitisFromGroupmanagement(); + identitiesList = getAllAssessableIdentities(); doUserChooseWithData(ureq, identitiesList, null, currentCourseNode); menuTree.setSelectedNode(userNode); diff --git a/src/main/java/org/olat/course/nodes/ScormCourseNode.java b/src/main/java/org/olat/course/nodes/ScormCourseNode.java index 3fc1a06874f96165544e18b725b45910f3645148..79ad393b46e66c75ede4ad0934be5d5acc5796ee 100644 --- a/src/main/java/org/olat/course/nodes/ScormCourseNode.java +++ b/src/main/java/org/olat/course/nodes/ScormCourseNode.java @@ -183,13 +183,15 @@ public class ScormCourseNode extends AbstractAccessableCourseNode implements Ass config.setBooleanEntry(NodeEditController.CONFIG_COMPONENT_MENU, Boolean.TRUE.booleanValue()); config.setBooleanEntry(ScormEditController.CONFIG_SHOWNAVBUTTONS, Boolean.TRUE.booleanValue()); config.set(ScormEditController.CONFIG_HEIGHT, ScormEditController.CONFIG_HEIGHT_AUTO); + config.set(NodeEditController.CONFIG_CONTENT_ENCODING, NodeEditController.CONFIG_CONTENT_ENCODING_AUTO); + config.set(NodeEditController.CONFIG_JS_ENCODING, NodeEditController.CONFIG_JS_ENCODING_AUTO); //fxdiff FXOLAT-116: SCORM improvements - config.setBooleanEntry(ScormEditController.CONFIG_FULLWINDOW, false); + config.setBooleanEntry(ScormEditController.CONFIG_FULLWINDOW, true); config.setBooleanEntry(ScormEditController.CONFIG_CLOSE_ON_FINISH, false); config.setBooleanEntry(ScormEditController.CONFIG_ADVANCESCORE, true); config.setBooleanEntry(ScormEditController.CONFIG_ATTEMPTSDEPENDONSCORE, false); config.setIntValue(ScormEditController.CONFIG_MAXATTEMPTS, 0); - config.setConfigurationVersion(1); + config.setConfigurationVersion(CURRENT_CONFIG_VERSION); } else { int version = config.getConfigurationVersion(); if (version < CURRENT_CONFIG_VERSION) { diff --git a/src/main/java/org/olat/course/nodes/iq/IQEditForm.java b/src/main/java/org/olat/course/nodes/iq/IQEditForm.java index e6262d2af8cb9a6d0eb338b5e570c93ab1929583..fd88c46bbdf83b19940183bb73f0e3665daf058c 100644 --- a/src/main/java/org/olat/course/nodes/iq/IQEditForm.java +++ b/src/main/java/org/olat/course/nodes/iq/IQEditForm.java @@ -189,7 +189,7 @@ class IQEditForm extends FormBasicController { Boolean fullWindow = (Boolean) modConfig.get(IQEditController.CONFIG_FULLWINDOW); fullWindowEl = uifactory.addCheckboxesVertical("fullwindow", "qti.form.fullwindow", formLayout, new String[]{"fullwindow"}, new String[]{null}, null, 1); - fullWindowEl.select("fullwindow", fullWindow == null ? false : fullWindow.booleanValue()); + fullWindowEl.select("fullwindow", fullWindow == null ? true : fullWindow.booleanValue()); Boolean CdisplayMenu = (Boolean)modConfig.get(IQEditController.CONFIG_KEY_DISPLAYMENU); displayMenu = uifactory.addCheckboxesVertical("qti_displayMenu", "qti.form.menudisplay", formLayout, new String[]{"xx"}, new String[]{null}, null, 1); diff --git a/src/main/java/org/olat/course/nodes/iq/IQRunController.java b/src/main/java/org/olat/course/nodes/iq/IQRunController.java index 6405088135ea301e3a1df7a72d8759d17b4fab19..235a5220a781815eea089db57c009393b00ab965 100644 --- a/src/main/java/org/olat/course/nodes/iq/IQRunController.java +++ b/src/main/java/org/olat/course/nodes/iq/IQRunController.java @@ -407,8 +407,8 @@ public class IQRunController extends BasicController implements GenericEventList Controller disposedRestartController = new LayoutMain3ColsController(ureq, getWindowControl(), empty, empty, courseCloser.getInitialComponent(), "disposed course whily in iqRun" + callingResId); displayContainerController.setDisposedMessageController(disposedRestartController); - final Boolean fullWindow = (Boolean)modConfig.get(IQEditController.CONFIG_FULLWINDOW); - if(fullWindow != null && fullWindow.booleanValue()) { + final Boolean fullWindow = (Boolean)modConfig.getBooleanSafe(IQEditController.CONFIG_FULLWINDOW, true); + if(fullWindow.booleanValue()) { displayContainerController.setAsFullscreen(ureq); } displayContainerController.activate(); diff --git a/src/main/java/org/olat/course/nodes/scorm/ScormEditController.java b/src/main/java/org/olat/course/nodes/scorm/ScormEditController.java index daa50fef038001f97089db82fde7d3f13092d056..8b9b10667a7ffcaacac950883533ccd737787ecc 100644 --- a/src/main/java/org/olat/course/nodes/scorm/ScormEditController.java +++ b/src/main/java/org/olat/course/nodes/scorm/ScormEditController.java @@ -192,7 +192,7 @@ public class ScormEditController extends ActivateableTabbableDefaultController i String encContent = (String) config.get(NodeEditController.CONFIG_CONTENT_ENCODING); String encJS = (String) config.get(NodeEditController.CONFIG_JS_ENCODING); //fxdiff FXOLAT-116: SCORM improvements - boolean fullWindow = config.getBooleanSafe(CONFIG_FULLWINDOW, false); + boolean fullWindow = config.getBooleanSafe(CONFIG_FULLWINDOW, true); boolean closeOnFinish = config.getBooleanSafe(CONFIG_CLOSE_ON_FINISH, false); //= conf.get(CONFIG_CUTVALUE); @@ -235,7 +235,7 @@ public class ScormEditController extends ActivateableTabbableDefaultController i } else { File cpRoot = FileResourceManager.getInstance().unzipFileResource(re.getOlatResource()); boolean showMenu = config.getBooleanSafe(CONFIG_SHOWMENU, true); - boolean fullWindow = config.getBooleanSafe(CONFIG_FULLWINDOW, false); + boolean fullWindow = config.getBooleanSafe(CONFIG_FULLWINDOW, true); if (previewLayoutCtr != null) previewLayoutCtr.dispose(); ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapScormRepositoryEntry(re)); diff --git a/src/main/java/org/olat/course/nodes/scorm/ScormRunController.java b/src/main/java/org/olat/course/nodes/scorm/ScormRunController.java index 53358bb821f8a0d8aa1b465609a0b843132915bc..69c0df24e3c5e73280727a375f45efd762a75a3b 100644 --- a/src/main/java/org/olat/course/nodes/scorm/ScormRunController.java +++ b/src/main/java/org/olat/course/nodes/scorm/ScormRunController.java @@ -258,7 +258,7 @@ public class ScormRunController extends BasicController implements ScormAPICallb String courseId; boolean showMenu = config.getBooleanSafe(ScormEditController.CONFIG_SHOWMENU, true); // fxdiff FXOLAT-116: SCORM improvements - final boolean fullWindow = config.getBooleanSafe(ScormEditController.CONFIG_FULLWINDOW, false); + final boolean fullWindow = config.getBooleanSafe(ScormEditController.CONFIG_FULLWINDOW, true); if (isPreview) { courseId = new Long(CodeHelper.getRAMUniqueID()).toString(); diff --git a/src/main/java/org/olat/course/nodes/ta/DropboxScoringViewController.java b/src/main/java/org/olat/course/nodes/ta/DropboxScoringViewController.java index 258c73bd4bcb2228bbabe40a9972fcdbbbe1dfaf..c45d4b57e1f977df39919a9482b513a4e8deac49 100644 --- a/src/main/java/org/olat/course/nodes/ta/DropboxScoringViewController.java +++ b/src/main/java/org/olat/course/nodes/ta/DropboxScoringViewController.java @@ -27,7 +27,6 @@ package org.olat.course.nodes.ta; import java.io.File; import java.util.List; -import java.util.Locale; import org.apache.velocity.VelocityContext; import org.olat.admin.quota.QuotaConstants; @@ -53,10 +52,13 @@ import org.olat.core.gui.control.generic.modal.DialogBoxController; import org.olat.core.gui.control.generic.modal.DialogBoxUIFactory; import org.olat.core.gui.media.FileMediaResource; import org.olat.core.id.Identity; +import org.olat.core.id.OLATResourceable; import org.olat.core.id.UserConstants; +import org.olat.core.id.context.BusinessControl; +import org.olat.core.id.context.BusinessControlFactory; +import org.olat.core.id.context.ContextEntry; import org.olat.core.logging.OLog; import org.olat.core.logging.Tracing; -import org.olat.core.util.i18n.I18nManager; import org.olat.core.util.mail.MailContext; import org.olat.core.util.mail.MailContextImpl; import org.olat.core.util.mail.MailTemplate; @@ -277,9 +279,12 @@ public class DropboxScoringViewController extends BasicController { Identity student = userCourseEnv.getIdentityEnvironment().getIdentity(); am.appendToUserNodeLog(node, coach, student, "FILE UPLOADED: " + folderEvent.getFilename()); String toMail = student.getUser().getProperty(UserConstants.EMAIL, ureq.getLocale()); - Locale locale = I18nManager.getInstance().getLocaleOrDefault(student.getUser().getPreferences().getLanguage()); - String nodeUrl = new URLEncoder().encode("[" + OresHelper.calculateTypeName(CourseNode.class) + ":" + node.getIdent() + "]"); - String link = JumpInManager.getJumpInUri(this.getWindowControl().getBusinessControl()) + nodeUrl; + + OLATResourceable ores = OresHelper.createOLATResourceableInstance(CourseNode.class, Long.valueOf(node.getIdent())); + ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(ores); + BusinessControl bc = BusinessControlFactory.getInstance().createBusinessControl(ce, getWindowControl().getBusinessControl()); + String link = BusinessControlFactory.getInstance().getAsURIString(bc, true); + log.debug("DEBUG : Returnbox notification email with link=" + link); MailTemplate mailTempl = new MailTemplate(translate("returnbox.email.subject"), translate( "returnbox.email.body", new String[] { userCourseEnv.getCourseEnvironment().getCourseTitle(), node.getShortTitle(), diff --git a/src/main/java/org/olat/course/properties/CoursePropertyManager.java b/src/main/java/org/olat/course/properties/CoursePropertyManager.java index a4f3eaa28fabb69e3dec07619c7728a9d9eae1a7..8b1d9fd19e303a66cb4bc946301a0d88ab504b42 100644 --- a/src/main/java/org/olat/course/properties/CoursePropertyManager.java +++ b/src/main/java/org/olat/course/properties/CoursePropertyManager.java @@ -25,6 +25,7 @@ package org.olat.course.properties; +import java.util.Collection; import java.util.List; import org.olat.core.id.Identity; @@ -130,7 +131,8 @@ public interface CoursePropertyManager extends IdentityAnonymizerCallback { /** * @return a list of all identities that have generated any assessment properties within this courses + * @param excludeIdentities Exclude a list of identities */ - public List getAllIdentitiesWithCourseAssessmentData(); + public List<Identity> getAllIdentitiesWithCourseAssessmentData(Collection<Identity> excludeIdentities); } diff --git a/src/main/java/org/olat/course/properties/PersistingCoursePropertyManager.java b/src/main/java/org/olat/course/properties/PersistingCoursePropertyManager.java index d2cda015cc9cf688af9801fe6dfa4448a838d825..0291d74a037368f1e6d269f7aa7b7fa5e914e954 100644 --- a/src/main/java/org/olat/course/properties/PersistingCoursePropertyManager.java +++ b/src/main/java/org/olat/course/properties/PersistingCoursePropertyManager.java @@ -25,11 +25,14 @@ package org.olat.course.properties; +import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Random; +import org.olat.basesecurity.IdentityImpl; import org.olat.core.commons.persistence.DB; import org.olat.core.commons.persistence.DBFactory; import org.olat.core.commons.persistence.DBQuery; @@ -198,25 +201,34 @@ public class PersistingCoursePropertyManager extends BasicManager implements Cou /** * @see org.olat.course.properties.CoursePropertyManager#getAllIdentitiesWithCourseAssessmentData() */ - public List getAllIdentitiesWithCourseAssessmentData() { - StringBuffer query = new StringBuffer(); - query.append("select distinct i from "); - query.append(" org.olat.basesecurity.IdentityImpl as i,"); - query.append(" org.olat.properties.Property as p"); - query.append(" where i = p.identity and p.resourceTypeName = :resname"); - query.append(" and p.resourceTypeId = :resid"); - query.append(" and p.identity is not null"); - query.append(" and ( p.name = '").append(AssessmentManager.SCORE); - query.append("' or p.name = '").append(AssessmentManager.PASSED); - query.append("' )"); + public List<Identity> getAllIdentitiesWithCourseAssessmentData(Collection<Identity> excludeIdentities) { + StringBuilder query = new StringBuilder(); + query.append("select distinct i from ") + .append(IdentityImpl.class.getName()).append(" as i,") + .append(Property.class.getName()).append(" as p") + .append(" where i = p.identity and p.resourceTypeName = :resname") + .append(" and p.resourceTypeId = :resid") + .append(" and p.identity is not null") + .append(" and p.name in ('").append(AssessmentManager.SCORE).append("','").append(AssessmentManager.PASSED).append("')"); + + if(excludeIdentities != null && !excludeIdentities.isEmpty()) { + query.append(" and p.identity.key not in (:excludeIdentities) "); + } DB db = DBFactory.getInstance(); DBQuery dbq = db.createQuery(query.toString()); ICourse course = CourseFactory.loadCourse(ores); dbq.setLong("resid", course.getResourceableId().longValue()); dbq.setString("resname", course.getResourceableTypeName()); + if(excludeIdentities != null && !excludeIdentities.isEmpty()) { + List<Long> excludeKeys = new ArrayList<Long>(); + for(Identity identity:excludeIdentities) { + excludeKeys.add(identity.getKey()); + } + dbq.setParameterList("excludeIdentities", excludeKeys); + } - List res = dbq.list(); + List<Identity> res = dbq.list(); return res; } diff --git a/src/main/java/org/olat/course/run/calendar/CourseLinkProviderController.java b/src/main/java/org/olat/course/run/calendar/CourseLinkProviderController.java index e44698565dc438e6ef3b5efaa3bec033dbdf69ce..ce6ad4cf368e91cc6d883b3d8706f253c6d2db3d 100644 --- a/src/main/java/org/olat/course/run/calendar/CourseLinkProviderController.java +++ b/src/main/java/org/olat/course/run/calendar/CourseLinkProviderController.java @@ -25,6 +25,7 @@ package org.olat.course.run.calendar; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -46,10 +47,11 @@ import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.controller.BasicController; import org.olat.core.gui.translator.PackageTranslator; -import org.olat.core.helpers.Settings; import org.olat.core.id.OLATResourceable; +import org.olat.core.id.context.BusinessControlFactory; +import org.olat.core.id.context.ContextEntry; import org.olat.core.util.Util; -import org.olat.course.CourseFactory; +import org.olat.core.util.resource.OresHelper; import org.olat.course.ICourse; import org.olat.course.nodes.CourseNode; import org.olat.repository.RepositoryEntry; @@ -115,12 +117,13 @@ public class CourseLinkProviderController extends BasicController implements Lin private void rebuildKalendarEventLinks(TreeNode node, List selectedNodeIDs, List kalendarEventLinks) { if (selectedNodeIDs.contains(node.getIdent())) { // assemble link - StringBuilder extLink = new StringBuilder(); - extLink.append(Settings.getServerContextPathURI()).append("/auth/repo/go?rid="); - ICourse course = CourseFactory.loadCourse(ores); - RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(course, true); - extLink.append(re.getKey()).append("&par=").append(node.getIdent()); - KalendarEventLink link = new KalendarEventLink(COURSE_LINK_PROVIDER, node.getIdent(), node.getTitle(), extLink.toString(), node.getIconCssClass()); + RepositoryEntry re = RepositoryManager.getInstance().lookupRepositoryEntry(ores, true); + OLATResourceable oresNode = OresHelper.createOLATResourceableInstance("CourseNode", Long.valueOf(node.getIdent())); + List<ContextEntry> ces = new ArrayList<ContextEntry>(); + ces.add(BusinessControlFactory.getInstance().createContextEntry(re)); + ces.add(BusinessControlFactory.getInstance().createContextEntry(oresNode)); + String extLink = BusinessControlFactory.getInstance().getAsURIString(ces, false); + KalendarEventLink link = new KalendarEventLink(COURSE_LINK_PROVIDER, node.getIdent(), node.getTitle(), extLink, node.getIconCssClass()); kalendarEventLinks.add(link); node.setSelected(true); } diff --git a/src/main/java/org/olat/course/run/preview/PreviewCoursePropertyManager.java b/src/main/java/org/olat/course/run/preview/PreviewCoursePropertyManager.java index 1f5a7ef4ec0f4454a71950e60a2fbbf5bb46ef17..f00f5e7cd97cbe0218f8bcfb1fba0d1c80d695a6 100644 --- a/src/main/java/org/olat/course/run/preview/PreviewCoursePropertyManager.java +++ b/src/main/java/org/olat/course/run/preview/PreviewCoursePropertyManager.java @@ -26,6 +26,7 @@ package org.olat.course.run.preview; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -204,7 +205,7 @@ final class PreviewCoursePropertyManager extends BasicManager implements CourseP /** * @see org.olat.course.properties.CoursePropertyManager#getAllIdentitiesWithCourseAssessmentData() */ - public List getAllIdentitiesWithCourseAssessmentData() { + public List<Identity> getAllIdentitiesWithCourseAssessmentData(Collection<Identity> excludeIdentities) { throw new AssertException("Not implemented for preview."); } } diff --git a/src/main/java/org/olat/course/run/userview/NodeEvaluation.java b/src/main/java/org/olat/course/run/userview/NodeEvaluation.java index 0699ebdc6171fb096c4830af734ee8688a881e7c..76835b753942e5ae9788503e41a2405b01b5c574 100644 --- a/src/main/java/org/olat/course/run/userview/NodeEvaluation.java +++ b/src/main/java/org/olat/course/run/userview/NodeEvaluation.java @@ -117,8 +117,10 @@ public class NodeEvaluation extends GenericNode { gtn.setAltText(courseNode.getLongTitle()); String type = courseNode.getType(); CourseNodeConfiguration cnConfig = CourseNodeFactory.getInstance().getCourseNodeConfigurationEvenForDisabledBB(type); - String nodeCssClass = cnConfig.getIconCSSClass(); - gtn.setIconCssClass(nodeCssClass); + if(cnConfig != null) { + String nodeCssClass = cnConfig.getIconCSSClass(); + gtn.setIconCssClass(nodeCssClass); + } gtn.setUserObject(this); // the current NodeEval is set into the treenode // as the userobject // all treenodes added here are set to be visible/accessible, since the diff --git a/src/main/java/org/olat/dispatcher/CatalogExportModuleDispatcher.java b/src/main/java/org/olat/dispatcher/CatalogExportModuleDispatcher.java index 3046c15af9f075b472149208d9191417a1de80da..e5eec43e202e502de8b7cd5408a55f2c7ecc1cf7 100644 --- a/src/main/java/org/olat/dispatcher/CatalogExportModuleDispatcher.java +++ b/src/main/java/org/olat/dispatcher/CatalogExportModuleDispatcher.java @@ -33,6 +33,7 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; +import java.util.Collections; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.List; @@ -65,12 +66,13 @@ import org.olat.core.gui.render.StringOutput; import org.olat.core.gui.translator.PackageTranslator; import org.olat.core.gui.translator.Translator; import org.olat.core.id.Identity; +import org.olat.core.id.context.BusinessControlFactory; +import org.olat.core.id.context.ContextEntry; import org.olat.core.logging.Tracing; import org.olat.core.util.FileUtils; import org.olat.core.util.Util; import org.olat.core.util.WebappHelper; import org.olat.core.util.i18n.I18nModule; -import org.olat.repository.RepoJumpInHandlerFactory; import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryEntryIconRenderer; import org.olat.repository.controllers.RepositoryDetailsController; @@ -271,13 +273,17 @@ public class CatalogExportModuleDispatcher implements Dispatcher { Element links = doc.createElement(XML_LINKS); // links container String tmp = ""; + + + ContextEntry contextEntry = BusinessControlFactory.getInstance().createContextEntry(re); + String url = BusinessControlFactory.getInstance().getAsURIString(Collections.singletonList(contextEntry), false); switch (re.getAccess()) { // Attention! This uses the switch-case-fall-through mechanism! case RepositoryEntry.ACC_USERS_GUESTS: tmp = catalogExportTranslator.translate(NLS_TABLE_HEADER_ACCESS_GUEST) + tmp; - appendLinkElement(doc, links, XML_LINKTYPE_GUEST, RepoJumpInHandlerFactory.buildRepositoryDispatchURI(re) + "&guest=true&lang=" + I18nModule.getDefaultLocale().toString().toLowerCase()); + appendLinkElement(doc, links, XML_LINKTYPE_GUEST, url + "&guest=true&lang=" + I18nModule.getDefaultLocale().toString().toLowerCase()); case RepositoryEntry.ACC_USERS: tmp = catalogExportTranslator.translate(NLS_TABLE_HEADER_ACCESS_USER) + tmp; case RepositoryEntry.ACC_OWNERS_AUTHORS: tmp = catalogExportTranslator.translate(NLS_TABLE_HEADER_ACCESS_AUTHOR) + tmp; case RepositoryEntry.ACC_OWNERS: tmp = catalogExportTranslator.translate(NLS_TABLE_HEADER_ACCESS_OWNER) + tmp; - appendLinkElement(doc, links, XML_LINKTYPE_LOGIN, RepoJumpInHandlerFactory.buildRepositoryDispatchURI(re)); + appendLinkElement(doc, links, XML_LINKTYPE_LOGIN, url); break; default: tmp = catalogExportTranslator.translate(NLS_TABLE_HEADER_ACCESS_USER); break; diff --git a/src/main/java/org/olat/group/BusinessGroupManagerImpl.java b/src/main/java/org/olat/group/BusinessGroupManagerImpl.java index 6e5883466c189fce2178535c69550e68bb161ffe..dc45582bc75a236045ea2691e9221d3d9252c93a 100644 --- a/src/main/java/org/olat/group/BusinessGroupManagerImpl.java +++ b/src/main/java/org/olat/group/BusinessGroupManagerImpl.java @@ -100,7 +100,6 @@ import org.olat.instantMessaging.InstantMessagingModule; import org.olat.instantMessaging.syncservice.SyncSingleUserTask; import org.olat.notifications.NotificationsManagerImpl; import org.olat.properties.Property; -import org.olat.repository.RepoJumpInHandlerFactory; import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryManager; import org.olat.resource.OLATResource; @@ -1548,32 +1547,6 @@ public class BusinessGroupManagerImpl extends BasicManager implements BusinessGr ////////////////// // Private Methods ////////////////// - /** - * Get all learning resources associated with the context from the given group - * and buid a direct jump url to this resources - * @param group - * @return String with direct-jumpin-urls - */ - private String getAllLearningResourcesFor(BusinessGroup group) { - // g - StringBuilder learningResources = new StringBuilder(); - if (group.getGroupContext() != null) { - BGContextManager contextManager = BGContextManagerImpl.getInstance(); - List repoEntries = contextManager.findRepositoryEntriesForBGContext(group.getGroupContext()); - Iterator iter = repoEntries.iterator(); - while (iter.hasNext()) { - RepositoryEntry entry = (RepositoryEntry) iter.next(); - String title = entry.getDisplayname(); - String url = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(entry); - learningResources.append(title); - learningResources.append("\n"); - learningResources.append(url); - learningResources.append("\n\n"); - } - } - return learningResources.toString(); - } - private void addToRoster(Identity ureqIdentity, Identity identity, BusinessGroup group, BGConfigFlags flags) { if (flags.isEnabled(BGConfigFlags.BUDDYLIST)) { if (InstantMessagingModule.isEnabled()) { diff --git a/src/main/java/org/olat/group/ui/BGMailHelper.java b/src/main/java/org/olat/group/ui/BGMailHelper.java index 2b07f7dc812bb65532f1963db9995de3308419ff..5cff4734b895d858e1cdade874bae9d9599d7227 100644 --- a/src/main/java/org/olat/group/ui/BGMailHelper.java +++ b/src/main/java/org/olat/group/ui/BGMailHelper.java @@ -43,6 +43,7 @@ import org.olat.core.gui.translator.Translator; import org.olat.core.id.Identity; import org.olat.core.id.User; import org.olat.core.id.UserConstants; +import org.olat.core.id.context.BusinessControlFactory; import org.olat.core.util.Util; import org.olat.core.util.filter.FilterFactory; import org.olat.core.util.i18n.I18nManager; @@ -191,12 +192,10 @@ public class BGMailHelper { StringBuilder learningResources = new StringBuilder(); if (group.getGroupContext() != null) { BGContextManager contextManager = BGContextManagerImpl.getInstance(); - List repoEntries = contextManager.findRepositoryEntriesForBGContext(group.getGroupContext()); - Iterator iter = repoEntries.iterator(); - while (iter.hasNext()) { - RepositoryEntry entry = (RepositoryEntry) iter.next(); + List<RepositoryEntry> repoEntries = contextManager.findRepositoryEntriesForBGContext(group.getGroupContext()); + for (RepositoryEntry entry: repoEntries) { String title = entry.getDisplayname(); - String url = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(entry); + String url = BusinessControlFactory.getInstance().getURLFromBusinessPathString("[RepositoryEntry:" + entry.getKey() + "]"); learningResources.append(title); learningResources.append(" ("); learningResources.append(url); diff --git a/src/main/java/org/olat/group/ui/management/BGManagementController.java b/src/main/java/org/olat/group/ui/management/BGManagementController.java index 2d2254bb74a1dfdf71db2e982691533c1089a070..0ab121f8eecbf5e942df63e78168884806722585 100644 --- a/src/main/java/org/olat/group/ui/management/BGManagementController.java +++ b/src/main/java/org/olat/group/ui/management/BGManagementController.java @@ -40,7 +40,6 @@ import org.olat.basesecurity.SecurityGroup; import org.olat.collaboration.CollaborationTools; import org.olat.collaboration.CollaborationToolsFactory; import org.olat.core.commons.fullWebApp.LayoutMain3ColsController; -import org.olat.core.dispatcher.jumpin.JumpInManager; import org.olat.core.gui.ShortName; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.Component; @@ -72,6 +71,7 @@ import org.olat.core.gui.translator.Translator; import org.olat.core.id.Identity; import org.olat.core.id.User; import org.olat.core.id.UserConstants; +import org.olat.core.id.context.BusinessControlFactory; import org.olat.core.logging.AssertException; import org.olat.core.logging.activity.ThreadLocalUserActivityLogger; import org.olat.core.util.Util; @@ -1267,7 +1267,7 @@ public class BGManagementController extends MainLayoutBasicController implements } } } - String resourceUrl = JumpInManager.getJumpInUri(this.getWindowControl().getBusinessControl()); + String resourceUrl = BusinessControlFactory.getInstance().getAsURIString(getWindowControl().getBusinessControl(), true); cmsg.setSubject( businessGroupTranslator.translate("businessgroup.contact.subject", new String[]{ this.currentGroup.getName()} ) ); cmsg.setBodyText( businessGroupTranslator.translate("businessgroup.contact.bodytext", new String[]{ this.currentGroup.getName(), resourceUrl} ) ); CollaborationTools collabTools = CollaborationToolsFactory.getInstance().getOrCreateCollaborationTools(this.currentGroup); diff --git a/src/main/java/org/olat/ldap/ui/LDAPAuthenticationController.java b/src/main/java/org/olat/ldap/ui/LDAPAuthenticationController.java index 020ab7e535bae96f80d3415ea3ed7646e40ae206..34cdb95948613bcf3736504581279875d91eef0b 100644 --- a/src/main/java/org/olat/ldap/ui/LDAPAuthenticationController.java +++ b/src/main/java/org/olat/ldap/ui/LDAPAuthenticationController.java @@ -87,11 +87,11 @@ public class LDAPAuthenticationController extends AuthenticationController imple if(UserModule.isPwdchangeallowed(null) && LDAPLoginModule.isPropagatePasswordChangedOnLdapServer()) { pwLink = LinkFactory.createLink("_olat_login_change_pwd", "menu.pw", loginComp, this); - pwLink.setCustomEnabledLinkCSS("o_login_pwd"); + pwLink.setCustomEnabledLinkCSS("o_login_pwd b_with_small_icon_left"); } if (LoginModule.isGuestLoginLinksEnabled()) { anoLink = LinkFactory.createLink("_olat_login_guest", "menu.guest", loginComp, this); - anoLink.setCustomEnabledLinkCSS("o_login_guests"); + anoLink.setCustomEnabledLinkCSS("o_login_guests b_with_small_icon_left"); } // Use the standard OLAT login form but with our LDAP translator diff --git a/src/main/java/org/olat/modules/webFeed/FeedViewHelper.java b/src/main/java/org/olat/modules/webFeed/FeedViewHelper.java index 04c4bd11b542d7c9a71714e203e88149af029ea0..84f495855f03d74b49fda5c6400d78ea6bf4fd15 100644 --- a/src/main/java/org/olat/modules/webFeed/FeedViewHelper.java +++ b/src/main/java/org/olat/modules/webFeed/FeedViewHelper.java @@ -38,6 +38,7 @@ import org.olat.core.logging.Tracing; import org.olat.core.util.StringHelper; import org.olat.core.util.filter.Filter; import org.olat.core.util.filter.FilterFactory; +import org.olat.core.util.resource.OresHelper; import org.olat.course.CourseModule; import org.olat.modules.webFeed.dispatching.Path; import org.olat.modules.webFeed.managers.FeedManager; @@ -46,7 +47,6 @@ import org.olat.modules.webFeed.models.Feed; import org.olat.modules.webFeed.models.Item; import org.olat.modules.webFeed.models.ItemPublishDateComparator; import org.olat.modules.webFeed.portfolio.LiveBlogArtefactHandler; -import org.olat.repository.RepoJumpInHandlerFactory; import org.olat.repository.RepositoryEntry; import org.olat.repository.RepositoryManager; import org.olat.resource.OLATResourceManager; @@ -341,12 +341,17 @@ public class FeedViewHelper { RepositoryManager resMgr = RepositoryManager.getInstance(); if (courseId != null && nodeId != null) { OLATResourceable oresCourse = OLATResourceManager.getInstance().findResourceable(courseId, CourseModule.getCourseTypeName()); + OLATResourceable oresNode = OresHelper.createOLATResourceableInstance("CourseNode", Long.valueOf(nodeId)); RepositoryEntry repositoryEntry = resMgr.lookupRepositoryEntry(oresCourse, false); - jumpInLink = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(repositoryEntry, nodeId); + List<ContextEntry> ces = new ArrayList<ContextEntry>(); + ces.add(BusinessControlFactory.getInstance().createContextEntry(repositoryEntry)); + ces.add(BusinessControlFactory.getInstance().createContextEntry(oresNode)); + jumpInLink = BusinessControlFactory.getInstance().getAsURIString(ces, false); } else { RepositoryEntry repositoryEntry = resMgr.lookupRepositoryEntry(feed, false); if (repositoryEntry != null){ - jumpInLink = RepoJumpInHandlerFactory.buildRepositoryDispatchURI(repositoryEntry); + ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(repositoryEntry); + jumpInLink = BusinessControlFactory.getInstance().getAsURIString(Collections.singletonList(ce), false); } else { // its a liveblog-feed final BusinessControlFactory bCF = BusinessControlFactory.getInstance(); diff --git a/src/main/java/org/olat/notifications/SubscriptionJumpInHandlerFactory.java b/src/main/java/org/olat/notifications/SubscriptionJumpInHandlerFactory.java index eff285704c4cdd27a5a7dce52168e6a8dfc4f9f8..e0469537bf93d9cb6b20df2fd7bba13127b27709 100644 --- a/src/main/java/org/olat/notifications/SubscriptionJumpInHandlerFactory.java +++ b/src/main/java/org/olat/notifications/SubscriptionJumpInHandlerFactory.java @@ -46,6 +46,7 @@ import org.olat.group.BusinessGroupManagerImpl; * Description: <br> * Initial Date: 23.02.2005 <br> * @author Felix Jost + * @deprecated Use business path instead */ @Deprecated // not to be used after 6.3, all done with businessPaths. //FIXME:FG:6.4 Delete Class and remove from olatextconfig.xml diff --git a/src/main/java/org/olat/registration/RegistrationController.java b/src/main/java/org/olat/registration/RegistrationController.java index 955a46b2897ca38c1223f044b82741ab9e169597..6c93e7a6e4b0fbcd0c6ec79ce3982eed1f2c5a0b 100644 --- a/src/main/java/org/olat/registration/RegistrationController.java +++ b/src/main/java/org/olat/registration/RegistrationController.java @@ -38,6 +38,8 @@ import org.olat.core.commons.fullWebApp.LayoutMain3ColsController; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.form.flexible.FormItem; +import org.olat.core.gui.components.link.Link; +import org.olat.core.gui.components.link.LinkFactory; import org.olat.core.gui.components.panel.Panel; import org.olat.core.gui.components.velocity.VelocityContainer; import org.olat.core.gui.control.Controller; @@ -322,63 +324,31 @@ public class RegistrationController extends BasicController { } } else if (source == dclController) { if (event == Event.DONE_EVENT) { - + // OO-92 + // disclaimer done -> now display all entered information (as table, see http://jira.openolat.org/browse/OO-92) + // this is step 5 wic.setCurStep(5); - myContent.contextRemove("text"); + + // hide the text we don't need anymore myContent.contextPut("pwdhelp", ""); myContent.contextPut("loginhelp", ""); - myContent.contextPut("disclaimer", ""); - //myContent.contextPut("yourdata", translate("step5.reg.yourdata")); + myContent.contextPut("text", ""); - rf2.freeze(); - regarea.setContent(rf2.getInitialComponent()); + // finalize the registration by creating the user + User persitedUser = createNewUserAfterRegistration(); - // create user with mandatory fields from registrationform - //FIXME - UserManager um = UserManager.getInstance(); - User volatileUser = um.createUser( - rf2.getFirstName(), - rf2.getLastName(), - tempKey.getEmailAddress() - ); - // set user configured language - Preferences preferences = volatileUser.getPreferences(); + // show last screen + VelocityContainer finishVC = createVelocityContainer("finish"); - preferences.setLanguage(rf2.getLangKey()); - volatileUser.setPreferences(preferences); - // create an identity with the given username / pwd and the user object - String login = rf2.getLogin(); - String pwd = rf2.getPassword(); - Identity persistedIdentity = rm.createNewUserAndIdentityFromTemporaryKey(login, pwd, volatileUser, tempKey); - if (persistedIdentity == null) { - showError("user.notregistered"); - } else { - // update other user properties from form - List<UserPropertyHandler> userPropertyHandlers = um.getUserPropertyHandlersFor(RegistrationForm2.USERPROPERTIES_FORM_IDENTIFIER, false); - User persistedUser = persistedIdentity.getUser(); - for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) { - FormItem fi = rf2.getPropFormItem(userPropertyHandler.getName()); - userPropertyHandler.updateUserFromFormItem(persistedUser, fi); - } - // persist changes in db - um.updateUserFromIdentity(persistedIdentity); - // send notification mail to sys admin - String notiEmail = RegistrationModule.getRegistrationNotificationEmail(); - if (notiEmail != null) { - rm.sendNewUserNotificationMessage(notiEmail, persistedIdentity); - } - - // tell system that this user did accept the disclaimer - RegistrationManager.getInstance().setHasConfirmedDislaimer(persistedIdentity); - - // show last screen - myContent.contextPut("text", getTranslator().translate( - "step5.reg.text", - new String[] { WebappHelper.getServletContextPath(), login } - )); - } - - + List<UserPropertyHandler> userPropertyHandlers = UserManager.getInstance().getUserPropertyHandlersFor(RegistrationForm2.USERPROPERTIES_FORM_IDENTIFIER, false); + finishVC.contextPut("userPropertyHandlers", userPropertyHandlers); + finishVC.contextPut("user", persitedUser); + finishVC.contextPut("locale", getLocale()); + finishVC.contextPut("username", rf2.getLogin()); + finishVC.contextPut("text", getTranslator().translate("step5.reg.text", new String[] {"notused",rf2.getLogin() })); + finishVC.contextPut("loginhref", WebappHelper.getServletContextPath()); + + regarea.setContent(finishVC); } else if (event == Event.CANCELLED_EVENT) { ureq.getDispatchResult().setResultingMediaResource(new RedirectMediaResource(Settings.getServerContextPathURI())); } @@ -386,6 +356,50 @@ public class RegistrationController extends BasicController { } + /** + * OO-92 + * this will finally create the user, set all it's userproperties + * + * @return User the newly created, persisted User Object + */ + private User createNewUserAfterRegistration() { + // create user with mandatory fields from registration-form + UserManager um = UserManager.getInstance(); + User volatileUser = um.createUser(rf2.getFirstName(), rf2.getLastName(), tempKey.getEmailAddress()); + // set user configured language + Preferences preferences = volatileUser.getPreferences(); + + preferences.setLanguage(rf2.getLangKey()); + volatileUser.setPreferences(preferences); + // create an identity with the given username / pwd and the user object + String login = rf2.getLogin(); + String pwd = rf2.getPassword(); + Identity persistedIdentity = rm.createNewUserAndIdentityFromTemporaryKey(login, pwd, volatileUser, tempKey); + if (persistedIdentity == null) { + showError("user.notregistered"); + return null; + } else { + // update other user properties from form + List<UserPropertyHandler> userPropertyHandlers = um.getUserPropertyHandlersFor(RegistrationForm2.USERPROPERTIES_FORM_IDENTIFIER, false); + User persistedUser = persistedIdentity.getUser(); + for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) { + FormItem fi = rf2.getPropFormItem(userPropertyHandler.getName()); + userPropertyHandler.updateUserFromFormItem(persistedUser, fi); + } + // persist changes in db + um.updateUserFromIdentity(persistedIdentity); + // send notification mail to sys admin + String notiEmail = RegistrationModule.getRegistrationNotificationEmail(); + if (notiEmail != null) { + rm.sendNewUserNotificationMessage(notiEmail, persistedIdentity); + } + + // tell system that this user did accept the disclaimer + RegistrationManager.getInstance().setHasConfirmedDislaimer(persistedIdentity); + return persistedUser; + } + } + protected void doDispose() { // } diff --git a/src/main/java/org/olat/registration/RegistrationForm2.java b/src/main/java/org/olat/registration/RegistrationForm2.java index 2626bdb88d96c163e2b0fbd7bd02ccb3c88f07f1..e2da4c143b87fe45431a951121cad3a87e56ac42 100644 --- a/src/main/java/org/olat/registration/RegistrationForm2.java +++ b/src/main/java/org/olat/registration/RegistrationForm2.java @@ -242,6 +242,8 @@ public class RegistrationForm2 extends FormBasicController { } if (!newpass1.getValue().equals(newpass2.getValue())) { newpass2.setErrorKey("form.check5", null); + // OO-92 : must return false, if passwords don't match! + return false; } return true; } diff --git a/src/main/java/org/olat/registration/_content/finish.html b/src/main/java/org/olat/registration/_content/finish.html new file mode 100644 index 0000000000000000000000000000000000000000..915eb6fda6612df141616e799c448baa195e1c5c --- /dev/null +++ b/src/main/java/org/olat/registration/_content/finish.html @@ -0,0 +1,27 @@ + + +#* + velocity template for the last step (5) in the registration process + it displays all entered values (except pw and language) in a table and + provides a button that links to the login-screen of OpenOLAT +*# + +$r.translate("step5.reg.yourdata") +<div class="b_border_box" style="width:20%;"> + <table> + <tr> + <td><label>$r.translate("user.login"):</label></td> + <td>$username</td> + </tr> + #foreach( $propertyHandler in $userPropertyHandlers ) + <tr> + <td><label>$r.translate($propertyHandler.i18nFormElementLabelKey()):</label></td> + <td>$!propertyHandler.getUserPropertyAsHTML($user, $locale)</td> + </tr> + #end + </table> +</div> +<p style="margin-top:12px;"> +$text<br /> +<a href="$loginhref" class="b_button b_button_preferred"><span>Login</span></a> +</p> \ No newline at end of file diff --git a/src/main/java/org/olat/registration/_i18n/LocalStrings_de.properties b/src/main/java/org/olat/registration/_i18n/LocalStrings_de.properties index a9c623efb474a10f651d3e9492c06f36f4fc9993..4e2d1268f3d33beabafcf05b269aa619a3ad27b4 100644 --- a/src/main/java/org/olat/registration/_i18n/LocalStrings_de.properties +++ b/src/main/java/org/olat/registration/_i18n/LocalStrings_de.properties @@ -74,7 +74,7 @@ step3.pw.text=Bitte beachten Sie bei der Eingabe des neuen OpenOLAT-Passwortes f step3.reg.text=Um die Registrierung abzuschliessen, f\u00FCllen Sie bitte das Formular mit Ihren Angaben aus. step4.pw.text=Sie haben Ihr OpenOLAT-Passwort neu gesetzt. step4.reg.text=<b>Bitte akzeptieren Sie die Nutzungsbedingungen, bevor Sie fortfahren.</b> -step5.reg.text=<p><b>Willkommen bei OpenOLAT\!</b><p>Sie k\u00F6nnen sich nun <a href\="{0}/">mit Ihrem Benutzernamen <b>{1}</b> und Passwort anmelden.</a> +step5.reg.text=Sie k\u00F6nnen sich nun mit Ihrem Benutzernamen <b>{1}</b> und Passwort anmelden: step5.reg.yourdata=Zusammenfassung Ihrer Angaben\: pwchange.homelink=Klicken Sie hier um sich anzumelden submit.accept=Akzeptieren diff --git a/src/main/java/org/olat/registration/_i18n/LocalStrings_en.properties b/src/main/java/org/olat/registration/_i18n/LocalStrings_en.properties index 16aa62f0733fa0abcdf55f5c8f44ddb5c78062d1..88434f65694a23b1e53bae22edcc24838dbdea82 100644 --- a/src/main/java/org/olat/registration/_i18n/LocalStrings_en.properties +++ b/src/main/java/org/olat/registration/_i18n/LocalStrings_en.properties @@ -75,7 +75,7 @@ step3.pw.text=Please consider the following instructions for setting an OpenOLAT step3.reg.text=In order to finish your registration, please fill in the form. step4.pw.text=You have changed your OpenOLAT password successfully. step4.reg.text=<b>Please read the terms of use before proceeding.</b> -step5.reg.text=<p><b>Welcome to OpenOLAT\!</b></p>You can now log in <a href\="{0}/">with your OpenOLAT user name <b>{1}</b> and password.</a> +step5.reg.text=You can now log in with your OpenOLAT user name <b>{1}</b> and password: step5.reg.yourdata=Summary of your data\: submit.accept=Accept submit.cancel=Cancel diff --git a/src/main/java/org/olat/registration/_i18n/LocalStrings_es.properties b/src/main/java/org/olat/registration/_i18n/LocalStrings_es.properties index d7d5e6fa2cab2423eddc0f4514387cc046dd8d7b..13325a45b1e1c545dc7ccfb83620e3d98941faf3 100644 --- a/src/main/java/org/olat/registration/_i18n/LocalStrings_es.properties +++ b/src/main/java/org/olat/registration/_i18n/LocalStrings_es.properties @@ -59,7 +59,7 @@ step3.pw.text=Por favor utiliza las siguientes instrucciones para establecer tu step3.reg.text=Para terminar tu registro, por favor completa el formulario. step4.pw.text=Has cambiado tu contrase\u00F1a OpenOLAT con \u00E9xito. step4.reg.text=<b>Por favor lee las condiciones de uso antes de proceder.</b> -step5.reg.text=<p><b>Bienvenido a OpenOLAT\!</b></p>Ahora puedes identificarte <a href\="{0}/">con tu nombre de usuario <b>{1}</b> y contrase\u00F1a.</a> +step5.reg.text=Ahora puedes identificarte con tu nombre de usuario <b>{1}</b> y contrase\u00F1a: step5.reg.yourdata=Resumen de tus datos\: submit.accept=Aceptar submit.cancel=Cancelar diff --git a/src/main/java/org/olat/registration/_i18n/LocalStrings_fr.properties b/src/main/java/org/olat/registration/_i18n/LocalStrings_fr.properties index e93cf465b9b62c7333ee45a7318c6c766776c182..d0facd46507ef686584b94af1cc3ddfc668c9353 100644 --- a/src/main/java/org/olat/registration/_i18n/LocalStrings_fr.properties +++ b/src/main/java/org/olat/registration/_i18n/LocalStrings_fr.properties @@ -74,7 +74,7 @@ step3.pw.text=Lors de l'introduction du nouveau mot de passe, veuillez SVP tenir step3.reg.text=Pour terminer l'enregistrement, veuillez remplir le formulaire avec vos donn\u00E9es step4.pw.text=Un nouveau mot de passe OpenOLAT vous a \u00E9t\u00E9 affect\u00E9. step4.reg.text=<b>Veuillez SVP accepter les conditions d'utilisation avant de continuer.</b> -step5.reg.text=<p><b>Bienvenue dans OpenOLAT\!</b><p>Vous pouvez maintenant vous annoncer <a href\="{0}/">avec votre nom d'utilisateur <b>{1}</b> et votre mot de passe.</a> +step5.reg.text=Vous pouvez maintenant vous annoncer avec votre nom d'utilisateur <b>{1}</b> et votre mot de passe: step5.reg.yourdata=R\u00E9sum\u00E9 de vos donn\u00E9es submit.accept=Accepter submit.cancel=Annuler diff --git a/src/main/java/org/olat/registration/_i18n/LocalStrings_it.properties b/src/main/java/org/olat/registration/_i18n/LocalStrings_it.properties index 42356fbdfabf112e57b6e6a31777dc6e2d1e6ab4..bbc8c292134558e84ae515f4f438bb09a4aed5b1 100644 --- a/src/main/java/org/olat/registration/_i18n/LocalStrings_it.properties +++ b/src/main/java/org/olat/registration/_i18n/LocalStrings_it.properties @@ -74,7 +74,7 @@ step3.pw.text=Quando imposta la Sua password consideri i punti seguenti, p.f.\: step3.reg.text=Per concludere la registrazione completi il modulo con i Suoi dati, p.f. step4.pw.text=Ha impostato la Sua nuova password. step4.reg.text=<b>Legga le condizioni prima di procedere, p.f.</b> -step5.reg.text=<p><b>Benvenuta/o a OpenOLAT</b><p>Ora si pu\u00F2 connettere <a href\="{0}/">con il Suo nome d'utente <b>{1}</b> e la password.</a> +step5.reg.text=Ora si pu\u00F2 connettere con il Suo nome d'utente <b>{1}</b> e la password: step5.reg.yourdata=Riassunto dei Suoi dati\: submit.accept=Accetta submit.cancel=Interrompere diff --git a/src/main/java/org/olat/repository/RepoBookmarkHandler.java b/src/main/java/org/olat/repository/RepoBookmarkHandler.java index 9a7c3ed8ae9bf9502cf12ab5e66673554810bd35..47295e9a147722249b85b1bf1b75f97c36d17a88 100644 --- a/src/main/java/org/olat/repository/RepoBookmarkHandler.java +++ b/src/main/java/org/olat/repository/RepoBookmarkHandler.java @@ -19,6 +19,8 @@ */ package org.olat.repository; +import java.util.Collections; + import org.olat.ControllerFactory; import org.olat.bookmark.Bookmark; import org.olat.bookmark.BookmarkHandler; @@ -31,6 +33,8 @@ import org.olat.core.gui.control.generic.dtabs.DTab; import org.olat.core.gui.control.generic.dtabs.DTabs; import org.olat.core.gui.translator.Translator; import org.olat.core.id.OLATResourceable; +import org.olat.core.id.context.BusinessControlFactory; +import org.olat.core.id.context.ContextEntry; import org.olat.core.logging.OLog; import org.olat.core.logging.Tracing; import org.olat.core.util.Util; @@ -100,7 +104,9 @@ public class RepoBookmarkHandler implements BookmarkHandler { RepositoryEntry re = rm.lookupRepositoryEntry(reores.getResourceableId()); // only create jump in urls for bookmarks of type repo entry if (re != null) { - return RepoJumpInHandlerFactory.buildRepositoryDispatchURI(re); + ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(reores); + String url = BusinessControlFactory.getInstance().getAsURIString(Collections.singletonList(ce), false); + return url; } return null; } diff --git a/src/main/java/org/olat/repository/RepoJumpInHandlerFactory.java b/src/main/java/org/olat/repository/RepoJumpInHandlerFactory.java index aea673d3208e25679a7f7a39e496b72449f9cf67..aad09716eaa1fd30600ef2c71aebe06f857a1ef4 100644 --- a/src/main/java/org/olat/repository/RepoJumpInHandlerFactory.java +++ b/src/main/java/org/olat/repository/RepoJumpInHandlerFactory.java @@ -25,14 +25,12 @@ package org.olat.repository; -import org.olat.core.dispatcher.DispatcherAction; import org.olat.core.dispatcher.jumpin.JumpInHandlerFactory; import org.olat.core.dispatcher.jumpin.JumpInReceptionist; import org.olat.core.dispatcher.jumpin.JumpInResult; import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.WindowControl; -import org.olat.core.helpers.Settings; import org.olat.core.id.OLATResourceable; /** @@ -40,11 +38,11 @@ import org.olat.core.id.OLATResourceable; * * Initial Date: 23.02.2005 <br> * @author Felix Jost + * @deprecated Use business path instead */ public class RepoJumpInHandlerFactory implements JumpInHandlerFactory { private static final String CONST_RID = "rid"; static final String CONST_PAR = "par"; - private static final String CONST_EXTLINK = "repo/go"; /** * @@ -77,27 +75,7 @@ public class RepoJumpInHandlerFactory implements JumpInHandlerFactory { } - /** - * Build a dispatch URI which a user can use to call re directly by entering - * the dispatch URI into his/her browser location bar. - * - * @param re - * @return Complete dispatch URI. - */ - public static String buildRepositoryDispatchURI(RepositoryEntry re) { - return buildRepositoryDispatchURI(re, null); - } - //TODO DOCU + use this in NodeEditController - public static String buildRepositoryDispatchURI(RepositoryEntry re, String initialViewIdentifyer) { - StringBuilder sb = new StringBuilder(); - sb.append(Settings.getServerContextPathURI()).append(DispatcherAction.PATH_AUTHENTICATED).append(CONST_EXTLINK).append("?").append(CONST_RID) - .append("=").append(re.getKey()); - if (initialViewIdentifyer != null) { - sb.append("&").append(CONST_PAR).append("=").append(initialViewIdentifyer); - } - return sb.toString(); - } } diff --git a/src/main/java/org/olat/repository/controllers/RepositoryEditPropertiesController.java b/src/main/java/org/olat/repository/controllers/RepositoryEditPropertiesController.java index bb22fb9ed3075497c93392fc41eae1b5decbd42b..77212649915503337b001da81a329b5fa50ae143 100644 --- a/src/main/java/org/olat/repository/controllers/RepositoryEditPropertiesController.java +++ b/src/main/java/org/olat/repository/controllers/RepositoryEditPropertiesController.java @@ -43,6 +43,7 @@ import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.controller.BasicController; import org.olat.core.gui.control.generic.modal.DialogBoxController; import org.olat.core.gui.control.generic.modal.DialogBoxUIFactory; +import org.olat.core.id.Identity; import org.olat.core.id.OLATResourceable; import org.olat.core.logging.OLog; import org.olat.core.logging.Tracing; @@ -345,7 +346,7 @@ public class RepositoryEditPropertiesController extends BasicController { if((changedCourseConfig.isEfficencyStatementEnabled() != initialCourseConfig.isEfficencyStatementEnabled() && ceffC.getLoggingAction()!=null)) { if(changedCourseConfig.isEfficencyStatementEnabled()) { // first create the efficiencies, send event to agency (all courses add link) - List identitiesWithData = course.getCourseEnvironment().getCoursePropertyManager().getAllIdentitiesWithCourseAssessmentData(); + List<Identity> identitiesWithData = course.getCourseEnvironment().getCoursePropertyManager().getAllIdentitiesWithCourseAssessmentData(null); EfficiencyStatementManager.getInstance().updateEfficiencyStatements(course, identitiesWithData, false); } else { // delete really the efficiencies of the users. diff --git a/src/main/java/org/olat/user/notification/UserJumpInHandlerFactory.java b/src/main/java/org/olat/user/notification/UserJumpInHandlerFactory.java index 01472c0b7da40c7558098ee2b2454bfcc1ce9dbd..6ae52a8a0e9d1c8ec8b1d667d18dfdd0f648f60e 100644 --- a/src/main/java/org/olat/user/notification/UserJumpInHandlerFactory.java +++ b/src/main/java/org/olat/user/notification/UserJumpInHandlerFactory.java @@ -36,10 +36,11 @@ import org.olat.core.id.Identity; * Initial Date: 19 august 2009 <br> * * @author srosse + * @deprecated Use business path instead */ public class UserJumpInHandlerFactory implements JumpInHandlerFactory { - public static final String CONST_EXTLINK = "user/go"; + private static final String CONST_EXTLINK = "user/go"; public static final String CONST_IDENTITY_ID = "idenid"; public JumpInReceptionist createJumpInHandler(UserRequest ureq) {