use of org.olat.core.util.prefs.Preferences in project openolat by klemens.
the class RamPreferencesStorage method getPreferencesFor.
/**
* @see org.olat.core.util.prefs.PreferencesStorage#getPreferencesFor(org.olat.core.id.Identity,
* boolean)
*/
public Preferences getPreferencesFor(Identity identity, boolean useTransientPreferences) {
Preferences p;
synchronized (this) {
// o_clusterOK by:fj is not persistent, for session only
p = identToPrefs.get(identity.getName());
if (p == null) {
p = new RamPreferences();
identToPrefs.put(identity.getName(), p);
}
}
return p;
}
use of org.olat.core.util.prefs.Preferences in project openolat by klemens.
the class ExportOptionsController method doUpdateMemberListConfig.
private void doUpdateMemberListConfig(UserRequest ureq) {
// save new config in GUI prefs
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
if (guiPrefs != null) {
boolean itemcols = downloadOptionsEl.isSelected(0);
boolean poscol = downloadOptionsEl.isSelected(1);
boolean pointcol = downloadOptionsEl.isSelected(2);
boolean timecols = downloadOptionsEl.isSelected(3);
boolean commentcol = downloadOptionsEl.isSelected(4);
FormatConfigHelper.updateExportFormat(ureq, itemcols, poscol, pointcol, timecols, commentcol);
}
}
use of org.olat.core.util.prefs.Preferences in project openolat by klemens.
the class FormatConfigHelper method loadExportFormat.
public static ExportFormat loadExportFormat(UserRequest ureq) {
ExportFormat formatConfig = null;
if (ureq != null) {
try {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
String formatConfigString = (String) guiPrefs.get(ExportOptionsController.class, QTI_EXPORT_ITEM_FORMAT_CONFIG);
if (StringHelper.containsNonWhitespace(formatConfigString)) {
formatConfig = (ExportFormat) configXstream.fromXML(formatConfigString);
} else {
formatConfig = new ExportFormat(true, true, true, true, true);
}
} catch (Exception e) {
log.error("could not establish object from xml", e);
formatConfig = new ExportFormat(true, true, true, true, true);
}
}
return formatConfig;
}
use of org.olat.core.util.prefs.Preferences in project openolat by klemens.
the class PortfolioCourseNodeRunController method isPanelOpen.
private boolean isPanelOpen(UserRequest ureq, String panelId, boolean def) {
Preferences guiPrefs = ureq.getUserSession().getGuiPreferences();
Boolean showConfig = (Boolean) guiPrefs.get(PortfolioCourseNodeRunController.class, getOpenPanelId(panelId));
return showConfig == null ? def : showConfig.booleanValue();
}
use of org.olat.core.util.prefs.Preferences in project openolat by klemens.
the class CourseRuntimeController method toggleGlossary.
private void toggleGlossary(UserRequest ureq) {
// enable / disable glossary highlighting according to user prefs
Preferences prefs = ureq.getUserSession().getGuiPreferences();
String guiPrefsKey = CourseGlossaryFactory.createGuiPrefsKey(getOlatResourceable());
Boolean state = (Boolean) prefs.get(CourseGlossaryToolLinkController.class, guiPrefsKey);
Boolean newState = state == null ? Boolean.TRUE : new Boolean(!state.booleanValue());
setGlossaryLinkTitle(ureq, newState);
prefs.putAndSave(CourseGlossaryToolLinkController.class, guiPrefsKey, newState);
}
Aggregations