Search in sources :

Example 86 with Preferences

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;
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 87 with Preferences

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);
    }
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 88 with Preferences

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;
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 89 with Preferences

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();
}
Also used : Preferences(org.olat.core.util.prefs.Preferences)

Example 90 with Preferences

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);
}
Also used : CourseGlossaryToolLinkController(org.olat.course.run.glossary.CourseGlossaryToolLinkController) Preferences(org.olat.core.util.prefs.Preferences) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean)

Aggregations

Preferences (org.olat.core.util.prefs.Preferences)92 ArrayList (java.util.ArrayList)12 I18nModule (org.olat.core.util.i18n.I18nModule)8 WindowManager (org.olat.core.gui.WindowManager)6 ContextEntry (org.olat.core.id.context.ContextEntry)6 UserSession (org.olat.core.util.UserSession)6 HashSet (java.util.HashSet)4 Locale (java.util.Locale)4 Map (java.util.Map)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)4 UserTool (org.olat.admin.user.tools.UserTool)4 UserToolExtension (org.olat.admin.user.tools.UserToolExtension)4 Component (org.olat.core.gui.components.Component)4 FlexiTableSort (org.olat.core.gui.components.form.flexible.elements.FlexiTableSort)4 ProgressBar (org.olat.core.gui.components.progressbar.ProgressBar)4 HistoryPoint (org.olat.core.id.context.HistoryPoint)4 I18nItem (org.olat.core.util.i18n.I18nItem)4 LocationHistory (org.olat.modules.lecture.model.LocationHistory)4 Date (java.util.Date)2 List (java.util.List)2