Skip to content
Snippets Groups Projects
Commit cd98e232 authored by wirecvs's avatar wirecvs
Browse files

autocommit: prepare branch i18n_OO

--HG--
branch : i18n_OO
parents 78dd648a d785e047
No related branches found
No related tags found
No related merge requests found
Showing
with 98 additions and 147 deletions
......@@ -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);
}
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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();
}
}
/**
......
......@@ -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
......
......@@ -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);
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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")) {
......
......@@ -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());
......
......@@ -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;
}
/**
......
......@@ -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);
......
......@@ -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) {
......
......@@ -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);
......
......@@ -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();
......
......@@ -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));
......
......@@ -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();
......
......@@ -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(),
......
......@@ -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);
}
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment