Saves the given user preference values.<p>

@param settings the user preference values to save

@throws Exception if something goes wrong
178011
public void saveSettings(Map<String, String> settings) throws Exception {

        for (Map.Entry<String, String> entry : settings.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            saveSetting(key, value);
        }
        m_currentPreferences.save(m_cms);
        CmsWorkplace.updateUserPreferences(m_cms, m_request);
    }
699752
public void save() throws Exception {

        if (fileName == null || fileName.length() == 0) {
            throw new java.io.FileNotFoundException(
                Error.getMessage(ErrorCode.M_HsqlProperties_load));
        }

        String filestring = fileName + ".properties";

        save(filestring);
    }
808251
@Override
    public void initialize(Settings settings) {
        this.settings = settings;
        final String key = getAnalyzerEnabledSettingKey();
        try {
            this.setEnabled(settings.getBoolean(key, true));
        } catch (InvalidSettingException ex) {
            final String msg = String.format("Invalid setting for property '%s'", key);
            LOGGER.warn(msg);
            LOGGER.debug(msg, ex);
        }
    }
766169
public void saveFavorites() {

        m_isEditingFavorites = false;
        getHandler().enableFavoriteEditing(false, m_dndController);
        List<String> clientIds = new ArrayList<String>();
        Iterator<Widget> it = m_favorites.iterator();
        while (it.hasNext()) {
            try {
                CmsMenuListItem element = (CmsMenuListItem)it.next();
                element.hideRemoveButton();
                element.showEditButton();
                clientIds.add(element.getId());
            } catch (ClassCastException e) {
                CmsDebugLog.getInstance().printLine("Could not cast widget");
            }
        }
        getHandler().saveFavoriteList(clientIds);
    }
1221027
public void save() throws FileNotFoundException {
    PrintStream p = new PrintStream(file);
    p.println(COMMENT_PREFIX + "Saved ELKI settings. First line is title, remaining lines are parameters.");
    for (Pair<String, ArrayList<String>> settings : store) {
      p.println(settings.first);
      for (String str : settings.second) {
        p.println(str);
      }
      p.println();
    }
    p.close();
  }
66436
public function setPreference(string $setting_name, string $setting_value): UserInterface
    {
        if ($this->user_id !== 0 && $this->getPreference($setting_name) !== $setting_value) {
            DB::table('user_setting')->updateOrInsert([
                'user_id'      => $this->user_id,
                'setting_name' => $setting_name,
            ], [
                'setting_value' => $setting_value,
            ]);

            $this->preferences[$setting_name] = $setting_value;
        }

        app('cache.array')->forget('user_setting' . $this->user_id);

        return $this;
    }
826853
void saveOU() {

        try {
            List<String> resources = new ArrayList<String>();
            for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
                resources.add(((CmsPathSelectField)row.getComponent()).getValue());
            }
            if (m_ou == null) {
                String parentOu = m_parentOu.getValue();
                if (!parentOu.endsWith("/")) {
                    parentOu += "/";
                }
                if (resources.contains("null")) {
                    resources.remove("null");
                }
                List<String> resourceNames = CmsFileUtil.removeRedundancies(resources);
                m_ou = OpenCms.getOrgUnitManager().createOrganizationalUnit(
                    m_cms,
                    parentOu + m_name.getValue(),
                    m_description.getValue(),
                    getFlags(),
                    resourceNames.isEmpty() ? null : resourceNames.get(0));

                if (!resourceNames.isEmpty()) {
                    resourceNames.remove(0);
                    Iterator<String> itResourceNames = CmsFileUtil.removeRedundancies(resourceNames).iterator();
                    while (itResourceNames.hasNext()) {
                        OpenCms.getOrgUnitManager().addResourceToOrgUnit(m_cms, m_ou.getName(), itResourceNames.next());
                    }
                }
            } else {
                m_ou.setDescription(m_description.getValue());
                m_ou.setFlags(getFlags());
                List<String> resourceNamesNew = CmsFileUtil.removeRedundancies(resources);
                List<CmsResource> resourcesOld = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
                    m_cms,
                    m_ou.getName());
                List<String> resourceNamesOld = new ArrayList<String>();
                Iterator<CmsResource> itResourcesOld = resourcesOld.iterator();
                while (itResourcesOld.hasNext()) {
                    CmsResource resourceOld = itResourcesOld.next();
                    resourceNamesOld.add(m_cms.getSitePath(resourceOld));
                }
                Iterator<String> itResourceNamesNew = resourceNamesNew.iterator();
                // add new resources to ou
                while (itResourceNamesNew.hasNext()) {
                    String resourceNameNew = itResourceNamesNew.next();
                    if (!resourceNamesOld.contains(resourceNameNew)) {
                        OpenCms.getOrgUnitManager().addResourceToOrgUnit(m_cms, m_ou.getName(), resourceNameNew);
                    }
                }
                Iterator<String> itResourceNamesOld = resourceNamesOld.iterator();
                // delete old resources from ou
                while (itResourceNamesOld.hasNext()) {
                    String resourceNameOld = itResourceNamesOld.next();
                    if (!resourceNamesNew.contains(resourceNameOld)) {
                        OpenCms.getOrgUnitManager().removeResourceFromOrgUnit(m_cms, m_ou.getName(), resourceNameOld);
                    }
                }
                // write the edited organizational unit
                OpenCms.getOrgUnitManager().writeOrganizationalUnit(m_cms, m_ou);
            }
        } catch (CmsException e) {
            LOG.error("Unable to save OU", e);
        }
    }
723492
@Override
	protected void fillSettings(Settings settings)
	{
		super.fillSettings(settings);
		
		settings.setIntProperty("subscriberFailurePolicy", subscriberFailurePolicy);
		settings.setIntProperty("subscriberOverflowPolicy", subscriberOverflowPolicy);
		if (partitionsKeysToIndex != null)
			settings.setStringProperty("partitionsKeysToIndex", StringUtils.implode(partitionsKeysToIndex, ","));
	}
473938
@Override
    public void setSetting(String setting) throws CDKException {
        if (setting.equals("true") || setting.equals("false")) {
            this.setting = setting;
        } else if (setting.equals("yes") || setting.equals("y")) {
            this.setting = "true";
        } else if (setting.equals("no") || setting.equals("n")) {
            this.setting = "false";
        } else {
            throw new CDKException("Setting " + setting + " is not a boolean.");
        }
    }
892324
protected void submit() {

        m_synchronizeSettings.setEnabled(m_enabled.getValue().booleanValue());
        m_synchronizeSettings.setSourceListInVfs(getResourcePaths());
        try {
            // set the synchronize settings
            CmsUserSettings userSettings = new CmsUserSettings(A_CmsUI.getCmsObject());
            userSettings.setSynchronizeSettings(m_synchronizeSettings);
            userSettings.save(A_CmsUI.getCmsObject());
        } catch (CmsException e) {
            LOG.error("Unable to set synchro settings", e);
        }
        CmsUserSettings userSettings = new CmsUserSettings(A_CmsUI.getCmsObject());
        m_synchronizeSettings = userSettings.getSynchronizeSettings();
        m_app.setRefreshButton(m_synchronizeSettings.isEnabled());
    }
830248
public void setUserParam(String user) {
		try {
			getSipURI().setUserParam(user);
			super.parameters.put(USER, user);
		} catch (ParseException e) {
			logger.error("error setting parameter ", e);
		}
	}
203502
public static void setAdditionalPreference(CmsObject cms, String key, String value) {

        CmsUser user = cms.getRequestContext().getCurrentUser();
        CmsUserSettings settings = new CmsUserSettings(user);
        settings.setAdditionalPreference(key, value);
        try {
            settings.save(cms);
        } catch (CmsException e) {
            LOG.error("Could not store preference " + key + ": " + e.getLocalizedMessage(), e);
        }
    }
423916
public void savePreferences() {
		final IEclipsePreferences prefs = getPreferences();
		try {
			prefs.flush();
		} catch (BackingStoreException e) {
			getILog().log(createStatus(IStatus.ERROR, e));
		}
	}
1327368
def saveSettings(self, settings):
        
        settings.beginGroup(self.objectName())
        
        curr_prof = self.currentProfile()
        if curr_prof:
            settings.setValue('current', curr_prof.name())
        
        for profile in self.profiles():
            settings.beginGroup(profile.name())
            settings.setValue('profile', wrapVariant(profile.toString()))
            settings.endGroup()
        
        settings.endGroup()
924929
boolean saveOptions() {

        //Enable history?
        boolean enabled = ((ComboBoxVersionsBean)m_numberVersions.getValue()).getValue() != CmsFileHistoryApp.NUMBER_VERSIONS_DISABLED;

        //Maximal count of versions for current resources.
        int versions = ((ComboBoxVersionsBean)m_numberVersions.getValue()).getValue();

        //Maximal count of versions for deleted resources.
        int versionsDeleted = versions;

        if (m_mode.getValue().equals(CmsFileHistoryApp.MODE_DISABLED)) {
            versionsDeleted = 0;
        }
        if (m_mode.getValue().equals(CmsFileHistoryApp.MODE_WITHOUTVERSIONS)) {
            versionsDeleted = 1;
        }

        if (m_mode.getValue().equals(CmsFileHistoryApp.MODE_WITHVERSIONS)
            && (versions == CmsFileHistoryApp.NUMBER_VERSIONS_DISABLED)) {
            return false;
        }
        OpenCms.getSystemInfo().setVersionHistorySettings(enabled, versions, versionsDeleted);
        OpenCms.writeConfiguration(CmsSystemConfiguration.class);

        return true;
    }
395825
public function saveConfiguration($settings)
    {
        if (file_exists($this->path) && !is_writable($this->path)) {
            throw new Exception('The file "' . $this->path . '" isn\'t writable!');
        }
        
        $content = json_encode($settings);
        
        return file_put_contents($this->path, $content);
    }
533904
void iniSite(CmsUserSettings settings) {

        List<CmsSite> sitesList = OpenCms.getSiteManager().getAvailableSites(m_cms, false, false, m_ou.getValue());

        IndexedContainer container = new IndexedContainer();
        container.addContainerProperty("caption", String.class, "");
        CmsSite firstNoRootSite = null;
        for (CmsSite site : sitesList) {
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(site.getSiteRoot())) {
                if (hasRole(CmsRole.VFS_MANAGER)
                    | ((m_user == null)
                        & m_group.getValue().equals(OpenCms.getDefaultUsers().getGroupAdministrators()))) {
                    Item item = container.addItem(site.getSiteRoot());
                    item.getItemProperty("caption").setValue(site.getTitle());
                }
            } else {
                if (firstNoRootSite == null) {
                    firstNoRootSite = site;
                }
                Item item = container.addItem(site.getSiteRoot());
                item.getItemProperty("caption").setValue(site.getTitle());
            }
        }
        if (container.size() == 0) {
            if (!container.containsId(A_CmsUI.getCmsObject().getRequestContext().getSiteRoot())) {
                Item defaultItem = container.addItem(A_CmsUI.getCmsObject().getRequestContext().getSiteRoot());
                defaultItem.getItemProperty("caption").setValue(
                    A_CmsUI.getCmsObject().getRequestContext().getSiteRoot());
            }
            m_visSites = false;
        }
        m_site.setContainerDataSource(container);
        m_site.setItemCaptionPropertyId("caption");
        m_site.setNewItemsAllowed(false);
        m_site.setNullSelectionAllowed(false);
        if (settings != null) {
            if (settings.getStartSite().length() >= 1) {
                m_site.select(settings.getStartSite().substring(0, settings.getStartSite().length() - 1));
            } else {
                LOG.error("The start site is unvalid configured");
            }
        } else {

            if (firstNoRootSite != null) {
                m_site.select(firstNoRootSite.getSiteRoot());
            } else {
                m_site.select(container.getItemIds().get(0));
            }
        }
    }