public void save(CmsObject cms) throws CmsException {

        // only set those values that are different than the default values
        // if the user info should be written to the database (if the CmsObject != null)
        // all values that are equal to the default values must be deleted from the additional info
        // user settings.

        // workplace button style
        if (getWorkplaceButtonStyle() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getWorkplaceButtonStyle()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_BUTTONSTYLE,
                new Integer(getWorkplaceButtonStyle()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_BUTTONSTYLE);
        }
        // workplace report type
        if (!getWorkplaceReportType().equals(
            OpenCms.getWorkplaceManager().getDefaultUserSettings().getWorkplaceReportType())) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_REPORTTYPE,
                getWorkplaceReportType());
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_REPORTTYPE);
        }
        // workplace upload applet
        if (getUploadVariant() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getUploadVariant()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_UPLOADAPPLET,
                getUploadVariant().name());
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_UPLOADAPPLET);
        }
        // list all projects
        if (getListAllProjects() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getListAllProjects()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_LISTALLPROJECTS,
                Boolean.valueOf(getListAllProjects()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_LISTALLPROJECTS);
        }
        // publish notification
        if (getShowPublishNotification() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getShowPublishNotification()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_PUBLISHNOTIFICATION,
                Boolean.valueOf(getShowPublishNotification()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_PUBLISHNOTIFICATION);
        }
        // locale
        if (!getLocale().equals(OpenCms.getWorkplaceManager().getDefaultUserSettings().getLocale())) {
            m_user.setAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration.N_LOCALE,
                getLocale().toString());
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                    + CmsWorkplaceConfiguration.N_LOCALE);
        }
        // start project
        if (!getStartProject().equals(OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartProject())) {
            try {
                // be sure the project is valid
                if (cms != null) {
                    cms.readProject(getStartProject());
                }
                m_user.setAdditionalInfo(
                    PREFERENCES
                        + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                        + CmsWorkplaceConfiguration.N_PROJECT,
                    getStartProject());
            } catch (Exception e) {
                if (cms != null) {
                    m_user.deleteAdditionalInfo(
                        PREFERENCES
                            + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                            + CmsWorkplaceConfiguration.N_PROJECT);
                }
            }
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                    + CmsWorkplaceConfiguration.N_PROJECT);
        }
        // view
        if (!getStartView().equals(OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartView())) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                    + CmsWorkplaceConfiguration.N_WORKPLACEVIEW,
                getStartView());
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                    + CmsWorkplaceConfiguration.N_WORKPLACEVIEW);
        }
        // start site
        if (!getStartSite().equals(OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartSite())) {
            m_user.setAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS + I_CmsXmlConfiguration.N_SITE,
                getStartSite());
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS + I_CmsXmlConfiguration.N_SITE);
        }
        // start folder
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getStartFolder())
            && !getStartFolder().equals(OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartFolder())) {
            m_user.setAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration.N_FOLDER,
                getStartFolder());
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                    + CmsWorkplaceConfiguration.N_FOLDER);
        }
        // restrict explorer folder view
        if (getRestrictExplorerView() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getRestrictExplorerView()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                    + CmsWorkplaceConfiguration.N_RESTRICTEXPLORERVIEW,
                Boolean.valueOf(getRestrictExplorerView()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                    + CmsWorkplaceConfiguration.N_RESTRICTEXPLORERVIEW);
        }
        // explorer button style
        if (getExplorerButtonStyle() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerButtonStyle()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_EXPLORERGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_BUTTONSTYLE,
                new Integer(getExplorerButtonStyle()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_EXPLORERGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_BUTTONSTYLE);
        }
        // explorer file entries
        if (getExplorerFileEntries() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerFileEntries()) {
            m_user.setAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_EXPLORERGENERALOPTIONS + CmsWorkplaceConfiguration.N_ENTRIES,
                new Integer(getExplorerFileEntries()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_EXPLORERGENERALOPTIONS + CmsWorkplaceConfiguration.N_ENTRIES);
        }
        // explorer settings
        if (getExplorerSettings() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerSettings()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_EXPLORERGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_EXPLORERDISPLAYOPTIONS,
                new Integer(getExplorerSettings()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_EXPLORERGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_EXPLORERDISPLAYOPTIONS);
        }
        // dialog file copy mode
        if (getDialogCopyFileMode() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogCopyFileMode()) {
            m_user.setAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration.N_FILECOPY,
                new Integer(getDialogCopyFileMode().getMode()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_FILECOPY);
        }
        // dialog folder copy mode
        if (getDialogCopyFolderMode() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogCopyFolderMode()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_FOLDERCOPY,
                new Integer(getDialogCopyFolderMode().getMode()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_FOLDERCOPY);
        }
        // dialog file delete mode
        if (getDialogDeleteFileMode() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogDeleteFileMode()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_FILEDELETION,
                new Integer(getDialogDeleteFileMode().getMode()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_FILEDELETION);
        }
        // dialog direct publish mode
        if (getDialogPublishSiblings() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogPublishSiblings()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_DIRECTPUBLISH,
                Boolean.valueOf(getDialogPublishSiblings()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_DIRECTPUBLISH);
        }
        // dialog show lock mode
        if (getDialogShowLock() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogShowLock()) {
            m_user.setAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration.N_SHOWLOCK,
                Boolean.valueOf(getDialogShowLock()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_SHOWLOCK);
        }
        // dialog permissions inheritation mode
        if (getDialogPermissionsInheritOnFolder() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogPermissionsInheritOnFolder()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_PERMISSIONSINHERITONFOLDER,
                Boolean.valueOf(getDialogPermissionsInheritOnFolder()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_PERMISSIONSINHERITONFOLDER);
        }
        // dialog expand inherited permissions mode
        if (getDialogExpandInheritedPermissions() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogExpandInheritedPermissions()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_EXPANDPERMISSIONSINHERITED,
                Boolean.valueOf(getDialogExpandInheritedPermissions()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_EXPANDPERMISSIONSINHERITED);
        }
        // dialog expand users permissions mode
        if (getDialogExpandUserPermissions() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogExpandUserPermissions()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_EXPANDPERMISSIONSUSER,
                Boolean.valueOf(getDialogExpandUserPermissions()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                    + CmsWorkplaceConfiguration.N_EXPANDPERMISSIONSUSER);
        }
        // editor button style
        if (getEditorButtonStyle() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getEditorButtonStyle()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_EDITORGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_BUTTONSTYLE,
                new Integer(getEditorButtonStyle()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_EDITORGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_BUTTONSTYLE);
        }
        // direct edit button style
        if (getDirectEditButtonStyle() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDirectEditButtonStyle()) {
            m_user.setAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_EDITORGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_DIRECTEDITSTYLE,
                new Integer(getDirectEditButtonStyle()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(
                PREFERENCES
                    + CmsWorkplaceConfiguration.N_EDITORGENERALOPTIONS
                    + CmsWorkplaceConfiguration.N_DIRECTEDITSTYLE);
        }
        // editor settings
        if (m_editorSettings.size() > 0) {
            Iterator<Map.Entry<String, String>> itEntries = m_editorSettings.entrySet().iterator();
            while (itEntries.hasNext()) {
                Map.Entry<String, String> entry = itEntries.next();
                if (entry.getValue() != null) {
                    m_user.setAdditionalInfo(
                        PREFERENCES + CmsWorkplaceConfiguration.N_EDITORPREFERREDEDITORS + entry.getKey(),
                        entry.getValue());
                } else {
                    m_user.deleteAdditionalInfo(
                        PREFERENCES + CmsWorkplaceConfiguration.N_EDITORPREFERREDEDITORS + entry.getKey());
                }
            }
        } else if (cms != null) {
            Iterator<String> itKeys = m_user.getAdditionalInfo().keySet().iterator();
            List<String> keysToDelete = new ArrayList<String>(3);
            while (itKeys.hasNext()) {
                String key = itKeys.next();
                if (key.startsWith(PREFERENCES + CmsWorkplaceConfiguration.N_EDITORPREFERREDEDITORS)) {
                    keysToDelete.add(key);
                }
            }
            for (String key : keysToDelete) {
                m_user.deleteAdditionalInfo(key);
            }
        }
        // start settings for galleries
        if (m_startGalleriesSettings.size() > 0) {
            Iterator<Map.Entry<String, String>> itEntries = m_startGalleriesSettings.entrySet().iterator();
            while (itEntries.hasNext()) {
                Map.Entry<String, String> entry = itEntries.next();
                if ((entry.getValue() != null) && !entry.getValue().equals(CmsWorkplace.INPUT_DEFAULT)) {
                    m_user.setAdditionalInfo(
                        PREFERENCES + CmsWorkplaceConfiguration.N_STARTGALLERIES + entry.getKey(),
                        entry.getValue());
                } else {
                    // delete from user settings if value of the entry is null or "default"
                    m_user.deleteAdditionalInfo(
                        PREFERENCES + CmsWorkplaceConfiguration.N_STARTGALLERIES + entry.getKey());
                }
            }
        } else if (cms != null) {
            Iterator<String> itKeys = m_user.getAdditionalInfo().keySet().iterator();
            while (itKeys.hasNext()) {
                String key = itKeys.next();
                if (key.startsWith(PREFERENCES + CmsWorkplaceConfiguration.N_STARTGALLERIES)) {
                    m_user.deleteAdditionalInfo(key);
                }
            }

        }

        // workplace search
        if (getWorkplaceSearchViewStyle() != null) {
            m_user.setAdditionalInfo(
                PREFERENCES + CmsWorkplaceConfiguration.N_WORKPLACESEARCH + CmsWorkplaceConfiguration.N_SEARCHVIEWSTYLE,
                getWorkplaceSearchViewStyle().toString());
        }
        // synchronize settings
        if (getSynchronizeSettings() != null) {
            m_user.setAdditionalInfo(
                PREFERENCES + SYNC_SETTINGS + SYNC_ENABLED,
                Boolean.valueOf(getSynchronizeSettings().isEnabled()));
            m_user.setAdditionalInfo(
                PREFERENCES + SYNC_SETTINGS + SYNC_DESTINATION,
                getSynchronizeSettings().getDestinationPathInRfs());
            m_user.setAdditionalInfo(
                PREFERENCES + SYNC_SETTINGS + SYNC_VFS_LIST,
                CmsStringUtil.collectionAsString(getSynchronizeSettings().getSourceListInVfs(), "|"));
        } else {
            m_user.deleteAdditionalInfo(PREFERENCES + SYNC_SETTINGS + SYNC_ENABLED);
            m_user.deleteAdditionalInfo(PREFERENCES + SYNC_SETTINGS + SYNC_DESTINATION);
            m_user.deleteAdditionalInfo(PREFERENCES + SYNC_SETTINGS + SYNC_VFS_LIST);
        }
        // upload applet client folder path
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_uploadAppletClientFolder)) {
            m_user.setAdditionalInfo(ADDITIONAL_INFO_UPLOADAPPLET_CLIENTFOLDER, m_uploadAppletClientFolder);
        } else {
            m_user.deleteAdditionalInfo(ADDITIONAL_INFO_UPLOADAPPLET_CLIENTFOLDER);
        }
        // workplace user surf time (time warp)
        if (getTimeWarp() != CmsContextInfo.CURRENT_TIME) {
            m_user.setAdditionalInfo(ADDITIONAL_INFO_TIMEWARP, new Long(getTimeWarp()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(ADDITIONAL_INFO_TIMEWARP);
        }

        Set<String> additionalInfosToDelete = new HashSet<String>();
        for (String key : m_user.getAdditionalInfo().keySet()) {
            if (key.startsWith(PREFERENCES_ADDITIONAL_PREFIX)
                && !m_additionalPreferences.containsKey(key.substring(PREFERENCES_ADDITIONAL_PREFIX.length()))) {
                additionalInfosToDelete.add(key);
            }
        }
        for (String key : additionalInfosToDelete) {
            m_user.deleteAdditionalInfo(key);
        }
        for (Map.Entry<String, String> entry : m_additionalPreferences.entrySet()) {
            String key = entry.getKey();
            String value = entry.getValue();
            m_user.setAdditionalInfo(PREFERENCES_ADDITIONAL_PREFIX + key, value);
        }

        // only write the updated user to the DB if we have the cms object
        if (cms != null) {
            cms.writeUser(m_user);
        }
    }
public void save ( CmsObject cms ) throws CmsException { if ( getWorkplaceButtonStyle ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getWorkplaceButtonStyle ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_BUTTONSTYLE , new Integer ( getWorkplaceButtonStyle ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_BUTTONSTYLE ) ; } if ( ! getWorkplaceReportType ( ) . equals ( OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getWorkplaceReportType ( ) ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_REPORTTYPE , getWorkplaceReportType ( ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_REPORTTYPE ) ; } if ( getUploadVariant ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getUploadVariant ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_UPLOADAPPLET , getUploadVariant ( ) . name ( ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_UPLOADAPPLET ) ; } if ( getListAllProjects ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getListAllProjects ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_LISTALLPROJECTS , Boolean . valueOf ( getListAllProjects ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_LISTALLPROJECTS ) ; } if ( getShowPublishNotification ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getShowPublishNotification ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_PUBLISHNOTIFICATION , Boolean . valueOf ( getShowPublishNotification ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACEGENERALOPTIONS + CmsWorkplaceConfiguration . N_PUBLISHNOTIFICATION ) ; } if ( ! getLocale ( ) . equals ( OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getLocale ( ) ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_LOCALE , getLocale ( ) . toString ( ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_LOCALE ) ; } if ( ! getStartProject ( ) . equals ( OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getStartProject ( ) ) ) { try { if ( cms != null ) { cms . readProject ( getStartProject ( ) ) ; } m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_PROJECT , getStartProject ( ) ) ; } catch ( Exception e ) { if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_PROJECT ) ; } } } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_PROJECT ) ; } if ( ! getStartView ( ) . equals ( OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getStartView ( ) ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_WORKPLACEVIEW , getStartView ( ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_WORKPLACEVIEW ) ; } if ( ! getStartSite ( ) . equals ( OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getStartSite ( ) ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + I_CmsXmlConfiguration . N_SITE , getStartSite ( ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + I_CmsXmlConfiguration . N_SITE ) ; } if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( getStartFolder ( ) ) && ! getStartFolder ( ) . equals ( OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getStartFolder ( ) ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_FOLDER , getStartFolder ( ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_FOLDER ) ; } if ( getRestrictExplorerView ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getRestrictExplorerView ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_RESTRICTEXPLORERVIEW , Boolean . valueOf ( getRestrictExplorerView ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESTARTUPSETTINGS + CmsWorkplaceConfiguration . N_RESTRICTEXPLORERVIEW ) ; } if ( getExplorerButtonStyle ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getExplorerButtonStyle ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EXPLORERGENERALOPTIONS + CmsWorkplaceConfiguration . N_BUTTONSTYLE , new Integer ( getExplorerButtonStyle ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EXPLORERGENERALOPTIONS + CmsWorkplaceConfiguration . N_BUTTONSTYLE ) ; } if ( getExplorerFileEntries ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getExplorerFileEntries ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EXPLORERGENERALOPTIONS + CmsWorkplaceConfiguration . N_ENTRIES , new Integer ( getExplorerFileEntries ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EXPLORERGENERALOPTIONS + CmsWorkplaceConfiguration . N_ENTRIES ) ; } if ( getExplorerSettings ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getExplorerSettings ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EXPLORERGENERALOPTIONS + CmsWorkplaceConfiguration . N_EXPLORERDISPLAYOPTIONS , new Integer ( getExplorerSettings ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EXPLORERGENERALOPTIONS + CmsWorkplaceConfiguration . N_EXPLORERDISPLAYOPTIONS ) ; } if ( getDialogCopyFileMode ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDialogCopyFileMode ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_FILECOPY , new Integer ( getDialogCopyFileMode ( ) . getMode ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_FILECOPY ) ; } if ( getDialogCopyFolderMode ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDialogCopyFolderMode ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_FOLDERCOPY , new Integer ( getDialogCopyFolderMode ( ) . getMode ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_FOLDERCOPY ) ; } if ( getDialogDeleteFileMode ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDialogDeleteFileMode ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_FILEDELETION , new Integer ( getDialogDeleteFileMode ( ) . getMode ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_FILEDELETION ) ; } if ( getDialogPublishSiblings ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDialogPublishSiblings ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_DIRECTPUBLISH , Boolean . valueOf ( getDialogPublishSiblings ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_DIRECTPUBLISH ) ; } if ( getDialogShowLock ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDialogShowLock ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_SHOWLOCK , Boolean . valueOf ( getDialogShowLock ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_SHOWLOCK ) ; } if ( getDialogPermissionsInheritOnFolder ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDialogPermissionsInheritOnFolder ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_PERMISSIONSINHERITONFOLDER , Boolean . valueOf ( getDialogPermissionsInheritOnFolder ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_PERMISSIONSINHERITONFOLDER ) ; } if ( getDialogExpandInheritedPermissions ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDialogExpandInheritedPermissions ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_EXPANDPERMISSIONSINHERITED , Boolean . valueOf ( getDialogExpandInheritedPermissions ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_EXPANDPERMISSIONSINHERITED ) ; } if ( getDialogExpandUserPermissions ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDialogExpandUserPermissions ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_EXPANDPERMISSIONSUSER , Boolean . valueOf ( getDialogExpandUserPermissions ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_DIALOGSDEFAULTSETTINGS + CmsWorkplaceConfiguration . N_EXPANDPERMISSIONSUSER ) ; } if ( getEditorButtonStyle ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getEditorButtonStyle ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EDITORGENERALOPTIONS + CmsWorkplaceConfiguration . N_BUTTONSTYLE , new Integer ( getEditorButtonStyle ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EDITORGENERALOPTIONS + CmsWorkplaceConfiguration . N_BUTTONSTYLE ) ; } if ( getDirectEditButtonStyle ( ) != OpenCms . getWorkplaceManager ( ) . getDefaultUserSettings ( ) . getDirectEditButtonStyle ( ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EDITORGENERALOPTIONS + CmsWorkplaceConfiguration . N_DIRECTEDITSTYLE , new Integer ( getDirectEditButtonStyle ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EDITORGENERALOPTIONS + CmsWorkplaceConfiguration . N_DIRECTEDITSTYLE ) ; } if ( m_editorSettings . size ( ) > 0 ) { Iterator < Map . Entry < String , String > > itEntries = m_editorSettings . entrySet ( ) . iterator ( ) ; while ( itEntries . hasNext ( ) ) { Map . Entry < String , String > entry = itEntries . next ( ) ; if ( entry . getValue ( ) != null ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EDITORPREFERREDEDITORS + entry . getKey ( ) , entry . getValue ( ) ) ; } else { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_EDITORPREFERREDEDITORS + entry . getKey ( ) ) ; } } } else if ( cms != null ) { Iterator < String > itKeys = m_user . getAdditionalInfo ( ) . keySet ( ) . iterator ( ) ; List < String > keysToDelete = new ArrayList < String > ( 3 ) ; while ( itKeys . hasNext ( ) ) { String key = itKeys . next ( ) ; if ( key . startsWith ( PREFERENCES + CmsWorkplaceConfiguration . N_EDITORPREFERREDEDITORS ) ) { keysToDelete . add ( key ) ; } } for ( String key : keysToDelete ) { m_user . deleteAdditionalInfo ( key ) ; } } if ( m_startGalleriesSettings . size ( ) > 0 ) { Iterator < Map . Entry < String , String > > itEntries = m_startGalleriesSettings . entrySet ( ) . iterator ( ) ; while ( itEntries . hasNext ( ) ) { Map . Entry < String , String > entry = itEntries . next ( ) ; if ( ( entry . getValue ( ) != null ) && ! entry . getValue ( ) . equals ( CmsWorkplace . INPUT_DEFAULT ) ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_STARTGALLERIES + entry . getKey ( ) , entry . getValue ( ) ) ; } else { m_user . deleteAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_STARTGALLERIES + entry . getKey ( ) ) ; } } } else if ( cms != null ) { Iterator < String > itKeys = m_user . getAdditionalInfo ( ) . keySet ( ) . iterator ( ) ; while ( itKeys . hasNext ( ) ) { String key = itKeys . next ( ) ; if ( key . startsWith ( PREFERENCES + CmsWorkplaceConfiguration . N_STARTGALLERIES ) ) { m_user . deleteAdditionalInfo ( key ) ; } } } if ( getWorkplaceSearchViewStyle ( ) != null ) { m_user . setAdditionalInfo ( PREFERENCES + CmsWorkplaceConfiguration . N_WORKPLACESEARCH + CmsWorkplaceConfiguration . N_SEARCHVIEWSTYLE , getWorkplaceSearchViewStyle ( ) . toString ( ) ) ; } if ( getSynchronizeSettings ( ) != null ) { m_user . setAdditionalInfo ( PREFERENCES + SYNC_SETTINGS + SYNC_ENABLED , Boolean . valueOf ( getSynchronizeSettings ( ) . isEnabled ( ) ) ) ; m_user . setAdditionalInfo ( PREFERENCES + SYNC_SETTINGS + SYNC_DESTINATION , getSynchronizeSettings ( ) . getDestinationPathInRfs ( ) ) ; m_user . setAdditionalInfo ( PREFERENCES + SYNC_SETTINGS + SYNC_VFS_LIST , CmsStringUtil . collectionAsString ( getSynchronizeSettings ( ) . getSourceListInVfs ( ) , "|" ) ) ; } else { m_user . deleteAdditionalInfo ( PREFERENCES + SYNC_SETTINGS + SYNC_ENABLED ) ; m_user . deleteAdditionalInfo ( PREFERENCES + SYNC_SETTINGS + SYNC_DESTINATION ) ; m_user . deleteAdditionalInfo ( PREFERENCES + SYNC_SETTINGS + SYNC_VFS_LIST ) ; } if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( m_uploadAppletClientFolder ) ) { m_user . setAdditionalInfo ( ADDITIONAL_INFO_UPLOADAPPLET_CLIENTFOLDER , m_uploadAppletClientFolder ) ; } else { m_user . deleteAdditionalInfo ( ADDITIONAL_INFO_UPLOADAPPLET_CLIENTFOLDER ) ; } if ( getTimeWarp ( ) != CmsContextInfo . CURRENT_TIME ) { m_user . setAdditionalInfo ( ADDITIONAL_INFO_TIMEWARP , new Long ( getTimeWarp ( ) ) ) ; } else if ( cms != null ) { m_user . deleteAdditionalInfo ( ADDITIONAL_INFO_TIMEWARP ) ; } Set < String > additionalInfosToDelete = new HashSet < String > ( ) ; for ( String key : m_user . getAdditionalInfo ( ) . keySet ( ) ) { if ( key . startsWith ( PREFERENCES_ADDITIONAL_PREFIX ) && ! m_additionalPreferences . containsKey ( key . substring ( PREFERENCES_ADDITIONAL_PREFIX . length ( ) ) ) ) { additionalInfosToDelete . add ( key ) ; } } for ( String key : additionalInfosToDelete ) { m_user . deleteAdditionalInfo ( key ) ; } for ( Map . Entry < String , String > entry : m_additionalPreferences . entrySet ( ) ) { String key = entry . getKey ( ) ; String value = entry . getValue ( ) ; m_user . setAdditionalInfo ( PREFERENCES_ADDITIONAL_PREFIX + key , value ) ; } if ( cms != null ) { cms . writeUser ( m_user ) ; } }
Saves the changed settings of the user to the users {@link CmsUser#getAdditionalInfo()} map.<p>

If the given CmsObject is <code>null</code>, the additional user infos are only updated in memory
and not saved into the database.<p>

@param cms the CmsObject needed to write the user to the db

@throws CmsException if user cannot be written to the db