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

autocommit: prepare branch i18n_OO

--HG--
branch : i18n_OO
parents 6567a128 3394a675
No related branches found
No related tags found
No related merge requests found
Showing
with 146 additions and 61 deletions
......@@ -179,12 +179,6 @@ YAML layout framework (Creative Commons Attribution 2.0 Lizenz,
see http://creativecommons.org/licenses/by/2.0/de) [http://www.yaml.de]
Please read the licensing terms of YAML if you plan to use OLAT in a commercial setup.
-----------------------------------------------------------------------
The OpenOLAT comic portlet uses comic strips produces by Alex Macartney
Please not that these comics are not public domain and must not be used for any
other purpose than beeing displayed in the OpenOLAT home portal
[http://www.macartney.ch]
-----------------------------------------------------------------------
EXTJS javascript framework [http://www.sencha.com]
......
......@@ -34,6 +34,7 @@ import org.springframework.scheduling.quartz.QuartzJobBean;
import de.bps.course.nodes.VCCourseNode;
import de.bps.course.nodes.vc.MeetingDate;
import de.bps.course.nodes.vc.provider.VCProvider;
import de.bps.course.nodes.vc.provider.VCProviderFactory;
/**
......@@ -57,19 +58,20 @@ public class AdobeConnectCleanupJob extends QuartzJobBean {
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
AdobeConnectProvider adobe = null;
boolean success = VCProviderFactory.existsProvider(providerId);
if(!success) return;//same as dummy job
try {
adobe = (AdobeConnectProvider) VCProviderFactory.createProvider(providerId);
} catch(ClassCastException e) {
throw new JobExecutionException("Invalid configuration: defined a virtual classroom cleanup job and provider implementation doesn't fit");
if(!VCProviderFactory.existsProvider(providerId)) {
return;//same as dummy job
}
success = adobe.isProviderAvailable() && adobe.isEnabled();
if(!success) {
VCProvider provider = VCProviderFactory.createProvider(providerId);
if(!provider.isEnabled()) {
return;
}
if(!(provider instanceof AdobeConnectProvider)) {
logger.error("Invalid configuration: defined a virtual classroom cleanup job and provider implementation doesn't fit");
return;
}
AdobeConnectProvider adobe = (AdobeConnectProvider)provider;
if(!adobe.isProviderAvailable()) {
logger.debug("Tried to cleanup Adobe Connect meetings but it's actually not available");
return;
}
......
......@@ -71,10 +71,11 @@ import org.olat.core.id.context.StateEntry;
import org.olat.core.logging.AssertException;
import org.olat.core.logging.OLog;
import org.olat.core.logging.Tracing;
import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
import org.olat.core.util.coordinate.CoordinatorManager;
import org.olat.core.util.coordinate.LockResult;
import org.olat.core.util.nodes.INode;
import org.olat.core.util.resource.OresHelper;
import org.olat.util.logging.activity.LoggingResourceable;
/**
* <pre>
......@@ -123,6 +124,7 @@ public class UserAdminMainController extends MainLayoutBasicController implement
// we always start with a search controller
//fxdiff BAKS-7 Resume function
OLATResourceable ores = OresHelper.createOLATResourceableInstance(firstNode.getUserObject().toString(), 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = addToHistory(ureq, ores, null);
contentCtr = new UsermanagerUserSearchController(ureq, bwControl);
listenTo(contentCtr); // auto dispose later
......@@ -168,6 +170,8 @@ public class UserAdminMainController extends MainLayoutBasicController implement
//fxdiff BAKS-7 Resume function
OLATResourceable ores = OresHelper.createOLATResourceableInstance(Identity.class, identity.getKey());
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl;
if(contentCtr instanceof UsermanagerUserSearchController) {
UsermanagerUserSearchController ctrl = (UsermanagerUserSearchController)contentCtr;
......
......@@ -41,8 +41,10 @@ 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.StateSite;
import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
import org.olat.core.util.Util;
import org.olat.core.util.resource.OresHelper;
import org.olat.util.logging.activity.LoggingResourceable;
/**
* Initial Date: Jan 16, 2006
* @author Florian Gnaegi
......@@ -78,6 +80,7 @@ public class UserAdminSite implements SiteInstance {
public MainLayoutController createController(UserRequest ureq, WindowControl wControl) {
//fxdiff BAKS-7 Resume function
OLATResourceable ores = OresHelper.createOLATResourceableInstance(UserAdminSite.class, 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ureq, ores, new StateSite(this), wControl, true);
MainLayoutController c = ControllerFactory.createLaunchController(ORES_OLATUSERADMINS, null, ureq, bwControl, true);
return c;
......
......@@ -21,15 +21,20 @@
* OpenOLAT - Online Learning and Training</a><br>
* This file has been modified by the OpenOLAT community. Changes are licensed
* under the Apache 2.0 license as the original file.
* <p>
* Initial code contributed and copyrighted by<br>
* 2012 by frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.admin.sysinfo;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.form.flexible.FormItemContainer;
import org.olat.core.gui.components.form.flexible.elements.TextElement;
import org.olat.core.gui.components.form.flexible.elements.RichTextElement;
import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer;
import org.olat.core.gui.components.form.flexible.impl.elements.richText.RichTextConfiguration;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
......@@ -38,10 +43,12 @@ import org.olat.core.gui.control.WindowControl;
* Initial Date: Apr 30, 2004
*
* @author Mike Stock
* @author Sergio Trentini
* @author Florian Gnägi
*/
public class InfoMsgForm extends FormBasicController {
private TextElement msg;
private RichTextElement msg;
private String infomsg;
/**
......@@ -49,7 +56,7 @@ public class InfoMsgForm extends FormBasicController {
* @param infomsg
*/
public InfoMsgForm(UserRequest ureq, WindowControl wControl, String infomsg) {
super(ureq, wControl);
super(ureq, wControl, LAYOUT_VERTICAL);
this.infomsg = infomsg;
initForm(ureq);
}
......@@ -58,7 +65,8 @@ public class InfoMsgForm extends FormBasicController {
* @return the info message
*/
public String getInfoMsg() {
return msg.getValue();
// use raw value to circumvent XSS filtering of script tags
return msg.getRawValue();
}
public void reset() {
......@@ -78,9 +86,17 @@ public class InfoMsgForm extends FormBasicController {
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
msg = uifactory.addRichTextElementForStringDataMinimalistic("msg", "infomsg", infomsg, 20, 60, false, formLayout, ureq.getUserSession(), getWindowControl());
msg = uifactory.addRichTextElementForStringData("msg", "infomsg", infomsg, 20, 70, false, true, null, null, formLayout, ureq.getUserSession(), getWindowControl());
msg.setMaxLength(1024);
RichTextConfiguration richTextConfig = msg.getEditorConfiguration();
// manually enable the source edit button
richTextConfig.setQuotedConfigValue(RichTextConfiguration.THEME_ADVANCED_BUTTONS3_ADD, RichTextConfiguration.SEPARATOR_BUTTON + "," + RichTextConfiguration.CODE_BUTTON);
//allow script tags...
richTextConfig.setQuotedConfigValue(RichTextConfiguration.INVALID_ELEMENTS, RichTextConfiguration.INVALID_ELEMENTS_FORM_FULL_VALUE_UNSAVE_WITH_SCRIPT);
richTextConfig.setQuotedConfigValue(RichTextConfiguration.EXTENDED_VALID_ELEMENTS, "script[src,type,defer]");
FormLayoutContainer buttonGroupLayout = FormLayoutContainer.createButtonLayout("buttonGroupLayout", getTranslator());
formLayout.add(buttonGroupLayout);
uifactory.addFormSubmitButton("submit", "submit", buttonGroupLayout);
......
<i>Message Admin-Token: $!admintoken</i><br/>
<p>
<i>Message Admin-Token: $!admintoken</i>
</p>
<fieldset>
<legend>$r.translate("infomsg.title")</legend>
#if ($infomsg)
......@@ -28,7 +31,6 @@ $r.render("infomsgEdit") $r.render("infomsgClear")
</fieldset>
#end
<hr class="o_separator">
<fieldset>
<legend>$r.translate("maintenancemsg.title")</legend>
......
......@@ -82,6 +82,7 @@ import org.olat.core.id.context.ContextEntry;
import org.olat.core.id.context.StateEntry;
import org.olat.core.id.context.StateMapped;
import org.olat.core.logging.AssertException;
import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
import org.olat.core.servlets.WebDAVManager;
import org.olat.core.util.StringHelper;
import org.olat.core.util.Util;
......@@ -95,6 +96,7 @@ import org.olat.modules.co.ContactFormController;
import org.olat.user.UserInfoMainController;
import org.olat.user.UserManager;
import org.olat.user.propertyhandlers.UserPropertyHandler;
import org.olat.util.logging.activity.LoggingResourceable;
/**
* Initial Date: Jan 31, 2006
......@@ -310,6 +312,7 @@ public class UsermanagerUserSearchController extends BasicController implements
removeAsListenerAndDispose(tableCtr);
//fxdiff BAKS-7 Resume function
OLATResourceable ores = OresHelper.createOLATResourceableInstance("table", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = addToHistory(ureq, ores, null);
tableCtr = ExtendedIdentitiesTableControllerFactory.createController(tdm, ureq, bwControl, actionEnabled);
listenTo(tableCtr);
......
......@@ -25,6 +25,7 @@
package org.olat.admin.user.delete;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
......@@ -71,7 +72,7 @@ public class ReadyToDeleteController extends BasicController {
private Panel readyToDeletePanel;
private TableController tableCtr;
private UserDeleteTableModel tdm;
private List readyToDeleteIdentities;
private List<Identity> readyToDeleteIdentities;
private DialogBoxController deleteConfirmController;
private boolean isAdministrativeUser;
private Translator propertyHandlerTranslator;
......@@ -126,8 +127,18 @@ public class ReadyToDeleteController extends BasicController {
}
} else if (source == deleteConfirmController) {
if (DialogBoxUIFactory.isOkEvent(event)) {
deleteIdentities(readyToDeleteIdentities);
showInfo("deleted.feedback.msg");
List<String> errors = new ArrayList<String>();
deleteIdentities(readyToDeleteIdentities, errors);
if(errors.isEmpty()) {
showInfo("deleted.feedback.msg");
} else {
StringBuilder sb = new StringBuilder();
for(String error:errors) {
if(sb.length() > 0) sb.append(", ");
sb.append(error);
}
showWarning("error.delete", sb.toString());
}
initializeContent();
}
}
......@@ -152,10 +163,10 @@ public class ReadyToDeleteController extends BasicController {
* @param readyToDeleteIdentities2
* @return String with login-name, comma separated
*/
private String getUserlistAsString(List readyToDeleteIdentities2) {
private String getUserlistAsString(List<Identity> readyToDeleteIdentities2) {
StringBuilder strb = new StringBuilder();
for (Iterator iter = readyToDeleteIdentities2.iterator(); iter.hasNext();) {
strb.append(((Identity)iter.next()).getName());
for (Iterator<Identity> iter = readyToDeleteIdentities2.iterator(); iter.hasNext();) {
strb.append((iter.next()).getName());
if (iter.hasNext()) {
strb.append(",");
}
......@@ -196,10 +207,20 @@ public class ReadyToDeleteController extends BasicController {
tableCtr.setTableDataModel(tdm);
}
private void deleteIdentities(List objects) {
for (Iterator iter = objects.iterator(); iter.hasNext();) {
UserDeletionManager.getInstance().deleteIdentity( (Identity) iter.next() );
DBFactory.getInstance().intermediateCommit();
private void deleteIdentities(List<Identity> identities, List<String> errors) {
for (Identity id:identities) {
try {
UserDeletionManager.getInstance().deleteIdentity( id );
} catch (Exception e) {
errors.add(id.getName());
logError("", e);
} finally {
try {
DBFactory.getInstance().intermediateCommit();
} catch (Exception e) {
logError("", e);
}
}
}
}
......
......@@ -46,4 +46,5 @@ table.users.found=Gefundene Benutzer
table.users.notfound=Folgende Benutzer wurden nicht gefunden
user.selection.delete.header=Untenstehende Benutzer haben sich seit {0} Monaten nicht in OLAT eingeloggt. Via E-Mail informieren Sie sie \u00FCber das bevorstehende L\u00F6schen ihres Benutzerkontos. Mit <i>Aktivieren</i> verhindern Sie das L\u00F6schen des Benutzerkontos.
info.is.not.ready.to.delete=Es ist bereits ein L\u00F6schvorgang im Hintergrund am Laufen. Dieser muss komplett durchlaufen bevor ein neuer L\u00F6schvorgang gestartet werden kann.
error.no.user.found=Keine zutreffenden Benutzer gefunden
\ No newline at end of file
error.no.user.found=Keine zutreffenden Benutzer gefunden
error.delete=Die folgende Benutzer konnte nicht richtig gel\u00F6scht werden: {0}
\ No newline at end of file
......@@ -31,7 +31,6 @@ import java.text.SimpleDateFormat;
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;
......@@ -71,8 +70,6 @@ import org.olat.user.UserDataDeletable;
import org.olat.user.UserManager;
import org.olat.user.propertyhandlers.UserPropertyHandler;
import com.thoughtworks.xstream.XStream;
/**
* Manager for user-deletion.
......@@ -132,8 +129,8 @@ public class UserDeletionManager extends BasicManager {
if (template != null) {
MailerWithTemplate mailer = MailerWithTemplate.getInstance();
template.addToContext("responseTo", deletionModule.getEmailResponseTo());
for (Iterator iter = selectedIdentities.iterator(); iter.hasNext();) {
Identity identity = (Identity)iter.next();
for (Iterator<Identity> iter = selectedIdentities.iterator(); iter.hasNext();) {
Identity identity = iter.next();
if (!isTemplateChanged) {
// Email template has NOT changed => take translated version of subject and body text
Translator identityTranslator = Util.createPackageTranslator(SelectionController.class, I18nManager.getInstance().getLocaleOrDefault(identity.getUser().getPreferences().getLanguage()));
......@@ -157,8 +154,8 @@ public class UserDeletionManager extends BasicManager {
}
} else {
// no template => User decides to sending no delete-email, mark only in lifecycle table 'sendEmail'
for (Iterator iter = selectedIdentities.iterator(); iter.hasNext();) {
Identity identity = (Identity)iter.next();
for (Iterator<Identity> iter = selectedIdentities.iterator(); iter.hasNext();) {
Identity identity = iter.next();
logAudit("User-Deletion: Move in 'Email sent' section without sending email, identity=" + identity.getName());
markSendEmailEvent(identity);
}
......@@ -260,6 +257,7 @@ public class UserDeletionManager extends BasicManager {
logInfo("Start deleteIdentity for identity=" + identity);
String newName = getBackupStringWithDate(identity.getName());
// TODO: chg: Workaround: instances each manager which implements UaserDataDeletable interface
// Each manager register themself as deletable
......@@ -297,9 +295,9 @@ public class UserDeletionManager extends BasicManager {
logInfo("deleteUserProperties user=" + identity.getUser());
UserManager.getInstance().deleteUserProperties(identity.getUser());
// Delete all authentications for certain identity
List authentications = BaseSecurityManager.getInstance().getAuthentications(identity);
for (Iterator iter = authentications.iterator(); iter.hasNext();) {
Authentication auth = (Authentication) iter.next();
List<Authentication> authentications = BaseSecurityManager.getInstance().getAuthentications(identity);
for (Iterator<Authentication> iter = authentications.iterator(); iter.hasNext();) {
Authentication auth = iter.next();
logInfo("deleteAuthentication auth=" + auth);
BaseSecurityManager.getInstance().deleteAuthentication(auth);
logDebug("Delete auth=" + auth + " of identity=" + identity);
......@@ -422,7 +420,7 @@ public class UserDeletionManager extends BasicManager {
}
private int getPropertyByName(String name, int defaultValue) {
List properties = PropertyManager.getInstance().findProperties(null, null, null, PROPERTY_CATEGORY, name);
List<Property> properties = PropertyManager.getInstance().findProperties(null, null, null, PROPERTY_CATEGORY, name);
if (properties.size() == 0) {
return defaultValue;
} else {
......@@ -439,7 +437,7 @@ public class UserDeletionManager extends BasicManager {
}
private void setProperty(String propertyName, int value) {
List properties = PropertyManager.getInstance().findProperties(null, null, null, PROPERTY_CATEGORY, propertyName);
List<Property> properties = PropertyManager.getInstance().findProperties(null, null, null, PROPERTY_CATEGORY, propertyName);
Property property = null;
if (properties.size() == 0) {
property = PropertyManager.getInstance().createPropertyInstance(null, null, null, PROPERTY_CATEGORY, propertyName, null, new Long(value), null, null);
......
......@@ -49,9 +49,11 @@ import org.olat.core.id.OLATResourceable;
import org.olat.core.id.context.ContextEntry;
import org.olat.core.id.context.StateEntry;
import org.olat.core.logging.AssertException;
import org.olat.core.logging.activity.ThreadLocalUserActivityLogger;
import org.olat.core.util.CodeHelper;
import org.olat.core.util.StringHelper;
import org.olat.core.util.resource.OresHelper;
import org.olat.util.logging.activity.LoggingResourceable;
/**
* Description:<br>
......@@ -351,6 +353,7 @@ public abstract class GenericMainController extends MainLayoutBasicController {
} else {
ores = OresHelper.createOLATResourceableInstance(GMCMT, CodeHelper.getUniqueIDFromString(nE.getUniqueExtensionID()));
}
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
bwControl = addToHistory(ureq, ores, null);
}
}
......
......@@ -142,7 +142,7 @@ public class DevelopmentController extends BasicController {
Component protectedMainPanel = DebugHelper.createDebugProtectedWrapper(mainpanel);
devToolLink = LinkFactory.createCustomLink("devTool", "devTool", "", Link.NONTRANSLATED, myContent, this);
devToolLink.setCustomEnabledLinkCSS("b_dev");
devToolLink.setCustomEnabledLinkCSS("b_dev o_noprint");
devToolLink.setTitle(translate("devTool"));
spacesaverController = new ExpColController(ureq, getWindowControl(), false, protectedMainPanel, devToolLink);
......
......@@ -26,7 +26,6 @@
package org.olat.core.logging.activity;
import org.olat.core.commons.persistence.PersistentObject;
import org.olat.core.id.Identity;
import org.olat.core.id.OLATResourceable;
import org.olat.core.id.context.ContextEntry;
......@@ -97,6 +96,8 @@ public class CoreLoggingResourceable implements ILoggingResourceable {
/** the OlatResourceable if we have one - null otherwise. Used for equals() and the businessPath check mainly **/
private final OLATResourceable resourceable_;
private final boolean ignorable_;
/**
* Internal constructor to create a LoggingResourceable object with the given mandatory
* parameters initialized.
......@@ -110,7 +111,7 @@ public class CoreLoggingResourceable implements ILoggingResourceable {
* @param id the id to be stored to the database
* @param name the name to be stored to the database
*/
private CoreLoggingResourceable(OLATResourceable resourceable, ILoggingResourceableType resourceableType, String type, String id, String name) {
private CoreLoggingResourceable(OLATResourceable resourceable, ILoggingResourceableType resourceableType, String type, String id, String name, boolean ignorable) {
if (type!=null && type.length()>32) {
log_.error("<init> type too long. Allowed 32, actual: "+type.length()+", type="+type);
type = type.substring(0, 32);
......@@ -128,6 +129,7 @@ public class CoreLoggingResourceable implements ILoggingResourceable {
type_ = type;
id_ = id;
name_ = name;
ignorable_ = ignorable;
}
//
......@@ -153,7 +155,7 @@ public class CoreLoggingResourceable implements ILoggingResourceable {
*/
public static CoreLoggingResourceable wrapNonOlatResource(StringResourceableType type, String idForDB, String nameForDB) {
return new CoreLoggingResourceable(null, type,
type.name(), idForDB, nameForDB);
type.name(), idForDB, nameForDB, false);
}
/**
......@@ -220,7 +222,7 @@ public class CoreLoggingResourceable implements ILoggingResourceable {
*/
public static CoreLoggingResourceable wrap(OLATResourceable olatResourceable, ILoggingResourceableType type) {
return new CoreLoggingResourceable(olatResourceable, type, olatResourceable.getResourceableTypeName(),
String.valueOf(olatResourceable.getResourceableId()), "");
String.valueOf(olatResourceable.getResourceableId()), "", false);
}
/**
......@@ -275,6 +277,11 @@ public class CoreLoggingResourceable implements ILoggingResourceable {
return resourceableType_;
}
@Override
public boolean isIgnorable() {
return ignorable_;
}
@Override
public int hashCode() {
return type_.hashCode()+id_.hashCode()+(resourceable_!=null ? resourceable_.getResourceableTypeName().hashCode()+(int)resourceable_.getResourceableId().longValue() : 0) + (resourceableType_!=null ? resourceableType_.hashCode() : 0);
......
......@@ -93,6 +93,7 @@ public class CourseLoggingAction extends BaseLoggingAction {
public static final ILoggingAction COURSE_LEAVING =
new CourseLoggingAction(ActionType.statistic, CrudAction.exit, ActionVerb.exit, ActionObject.course).setTypeList(
new ResourceableTypeList().addMandatory(OlatResourceableType.course).
or().addMandatory(OlatResourceableType.course).addOptional(OlatResourceableType.node).
or().addMandatory(OlatResourceableType.course, OlatResourceableType.genRepoEntry).addOptional(OlatResourceableType.businessGroup).
or().addMandatory(OlatResourceableType.genRepoEntry, StringResourceableType.targetIdentity).addOptional(OlatResourceableType.businessGroup).addOptional(OlatResourceableType.sharedFolder).addOptional(OlatResourceableType.course).
or().addMandatory(OlatResourceableType.course, StringResourceableType.targetIdentity));
......
......@@ -66,4 +66,11 @@ public interface ILoggingResourceable {
* @return the ILoggingResourceableType of this LoggingResourceable
*/
public ILoggingResourceableType getResourceableType();
/**
* Some components of a list of context entries are used to recreate the
* controllers hierarchy by back button and haven't any meaning for logging.
* @return
*/
public boolean isIgnorable();
}
......@@ -59,6 +59,8 @@ public class LearningResourceLoggingAction extends BaseLoggingAction {
or().addMandatory(OlatResourceableType.course, OlatResourceableType.node, OlatResourceableType.wiki).
// this is the case when you open a scorm resource as a course node
or().addMandatory(OlatResourceableType.course, OlatResourceableType.node, StringResourceableType.scormResource).
// this is the case when you open a QTI resource as a course node
or().addMandatory(OlatResourceableType.course, OlatResourceableType.node, OlatResourceableType.iq).
// this is another case of closing a resource
or().addMandatory(OlatResourceableType.course, OlatResourceableType.node);
public static final ILoggingAction LEARNING_RESOURCE_OPEN =
......
......@@ -78,5 +78,8 @@ public enum OlatResourceableType implements ILoggingResourceableType {
calendar,
/** reprensents a portfolio map **/
portfolio;
portfolio,
/** business path component **/
businessPath
}
\ No newline at end of file
......@@ -267,6 +267,14 @@ public class ResourceableTypeList {
}
List<ILoggingResourceable> resourceInfosCopy = new LinkedList<ILoggingResourceable>(resourceInfos);
for (Iterator<ILoggingResourceable> it = resourceInfosCopy.iterator(); it.hasNext();) {
if(it.next().isIgnorable()) {
it.remove();
}
}
List<ILoggingResourceableType> mandatory = getMandatory();
for (Iterator<ILoggingResourceableType> it = mandatory.iterator(); it.hasNext();) {
ILoggingResourceableType type = it.next();
......
......@@ -92,7 +92,9 @@ public class ThreadLocalUserActivityLogger {
static IUserActivityLogger getUserActivityLogger() {
IUserActivityLogger logger = userActivityLogger_.get();
if (logger==null) {
log_.warn("No UserActivityLogger set! Reinitializing now.", new Exception("stacktrace"));
if(log_.isDebug()) {//only generate this exception in debug
log_.warn("No UserActivityLogger set! Reinitializing now.", new Exception("stacktrace"));
}
return new UserActivityLoggerImpl();
}
return logger;
......
......@@ -32,7 +32,6 @@ import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
......@@ -41,10 +40,8 @@ import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import org.hibernate.FlushMode;
import org.olat.core.commons.persistence.DB;
import org.olat.core.commons.persistence.DBFactory;
import org.olat.core.commons.persistence.DBQuery;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.id.Identity;
......@@ -509,7 +506,8 @@ public class UserActivityLoggerImpl implements IUserActivityLogger {
}
if (!foundIt) {
String oresourceableOres = "n/a (null)";
if (ce !=null && ce.getOLATResourceable() !=null) {
// SR: why generate exception for unuseable information???
if (log_.isDebug() && ce !=null && ce.getOLATResourceable() !=null) {
try {
java.lang.reflect.Method getOlatResource = ce.getOLATResourceable().getClass().getDeclaredMethod("getOlatResource");
if (getOlatResource!=null) {
......@@ -532,8 +530,12 @@ public class UserActivityLoggerImpl implements IUserActivityLogger {
ILoggingResourceable resourceInfo = it2.next();
log_.info("id: "+resourceInfo.getId()+", name="+resourceInfo.getName()+", type="+resourceInfo.getType()+", toString: "+resourceInfo.toString());
}
log_.warn("Could not find any LoggingResourceable corresponding to this ContextEntry: "+ce.toString(),
new Exception("UserActivityLoggerImpl.getCombinedOrderedLoggingResourceables()"));
if(log_.isDebug()) {//only generate the stacktrace in debug mode
log_.warn("Could not find any LoggingResourceable corresponding to this ContextEntry: "+ce.toString(),
new Exception("UserActivityLoggerImpl.getCombinedOrderedLoggingResourceables()"));
} else {
log_.warn("Could not find any LoggingResourceable corresponding to this ContextEntry: "+ce.toString(), null);
}
}
}
}
......@@ -727,6 +729,12 @@ public class UserActivityLoggerImpl implements IUserActivityLogger {
// alongside the log message
// check if we have more than 4 - if we do, issue a log and remove the middle ones
for(Iterator<ILoggingResourceable> riIterator=resourceInfos.iterator(); riIterator.hasNext(); ) {
if(riIterator.next().isIgnorable()) {
riIterator.remove();
}
}
if (resourceInfos.size()>4) {
log_.warn("More than 4 resource infos set on a user activity log. Can only have 4. Having: "+resourceInfos.size());
int diff = resourceInfos.size()-4;
......
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