⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmsusersettings.java

📁 cms是开源的框架
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                + CmsWorkplaceConfiguration.N_EXPANDPERMISSIONSINHERITED);
        }
        // dialog expand users permissions mode
        if (getDialogExpandUserPermissions() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogExpandUserPermissions()) {
            m_user.setAdditionalInfo(PREFERENCES
                + CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
                + CmsWorkplaceConfiguration.N_EXPANDPERMISSIONSUSER, new Boolean(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);
        }
        // directedit 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);
        }
        // editorsettings
        if (m_editorSettings.size() > 0) {
            m_user.setAdditionalInfo(PREFERENCES + CmsWorkplaceConfiguration.N_EDITORPREFERREDEDITORS, m_editorSettings);
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(PREFERENCES + CmsWorkplaceConfiguration.N_EDITORPREFERREDEDITORS);
        }
        // task startup filter
        if (!getTaskStartupFilter().equals(
            OpenCms.getWorkplaceManager().getDefaultUserSettings().getTaskStartupFilter())) {
            m_user.setAdditionalInfo(PREFERENCES
                + CmsWorkplaceConfiguration.N_WORKFLOWGENERALOPTIONS
                + CmsWorkplaceConfiguration.N_STARTUPFILTER, getTaskStartupFilter());
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(PREFERENCES
                + CmsWorkplaceConfiguration.N_WORKFLOWGENERALOPTIONS
                + CmsWorkplaceConfiguration.N_STARTUPFILTER);
        }
        // task show all projects
        if (getTaskShowAllProjects() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getTaskShowAllProjects()) {
            m_user.setAdditionalInfo(PREFERENCES
                + CmsWorkplaceConfiguration.N_WORKFLOWGENERALOPTIONS
                + CmsWorkplaceConfiguration.N_SHOWPROJECTS, new Boolean(getTaskShowAllProjects()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(PREFERENCES
                + CmsWorkplaceConfiguration.N_WORKFLOWGENERALOPTIONS
                + CmsWorkplaceConfiguration.N_SHOWPROJECTS);
        }
        // task messages        
        if (getTaskMessageValue() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getTaskMessageValue()) {
            m_user.setAdditionalInfo(PREFERENCES + CmsWorkplaceConfiguration.N_WORKFLOWDEFAULTSETTINGS, new Integer(
                m_taskMessages));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(PREFERENCES + CmsWorkplaceConfiguration.N_WORKFLOWDEFAULTSETTINGS);
        }

        // 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, new Boolean(getRestrictExplorerView()));
        } else if (cms != null) {
            m_user.deleteAdditionalInfo(PREFERENCES
                + CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
                + CmsWorkplaceConfiguration.N_RESTRICTEXPLORERVIEW);
        }

        // synchronize settings        
        if (getSynchronizeSettings() != null) {
            m_user.setAdditionalInfo(PREFERENCES + SYNC_SETTINGS, getSynchronizeSettings());
        } else {
            m_user.deleteAdditionalInfo(PREFERENCES + SYNC_SETTINGS);
        }

        // project settings        
        if (getProjectSettings() != null) {
            m_user.setAdditionalInfo(PREFERENCES + PROJECT_SETTINGS, getProjectSettings());
        } else {
            m_user.deleteAdditionalInfo(PREFERENCES + PROJECT_SETTINGS);
        }

        // only write the updated user to the DB if we have the cms object
        if (cms != null) {
            cms.writeUser(m_user);
        }
    }

    /**
     * Sets the default copy mode when copying a file of the user.<p>
     * 
     * @param mode the default copy mode when copying a file of the user
     */
    public void setDialogCopyFileMode(int mode) {

        m_dialogFileCopy = mode;
    }

    /**
     * Sets the default copy mode when copying a folder of the user.<p>
     * 
     * @param mode the default copy mode when copying a folder of the user
     */
    public void setDialogCopyFolderMode(int mode) {

        m_dialogFolderCopy = mode;
    }

    /**
     * Sets the default setting for file deletion.<p>
     * 
     * @param mode the default setting for file deletion
     */
    public void setDialogDeleteFileMode(int mode) {

        m_dialogFileDelete = mode;
    }

    /**
     * Sets the default setting for expanding inherited permissions in the dialog.<p>
     *
     * @param dialogShowInheritedPermissions the default setting for expanding inherited permissions in the dialog
     */
    public void setDialogExpandInheritedPermissions(boolean dialogShowInheritedPermissions) {

        m_dialogExpandInheritedPermissions = dialogShowInheritedPermissions;
    }

    /**
     * Sets the default setting for expanding the users permissions in the dialog.<p>
     *
     * @param dialogShowUserPermissions the default setting for expanding the users permissions in the dialog
     */
    public void setDialogExpandUserPermissions(boolean dialogShowUserPermissions) {

        m_dialogExpandUserPermissions = dialogShowUserPermissions;
    }

    /**
     * Sets the default setting for inheriting permissions on folders.<p>
     *
     * @param dialogPermissionsInheritOnFolder the default setting for inheriting permissions on folders
     */
    public void setDialogPermissionsInheritOnFolder(boolean dialogPermissionsInheritOnFolder) {

        m_dialogPermissionsInheritOnFolder = dialogPermissionsInheritOnFolder;
    }

    /**
     * Sets the default setting for direct publishing.<p>
     * 
     * @param publishSiblings the default setting for direct publishing: true if siblings should be published, otherwise false
     */
    public void setDialogPublishSiblings(boolean publishSiblings) {

        m_dialogDirectpublish = publishSiblings;
    }

    /**
     *  Sets if the export setting part of the secure/export dialog should be shown.<p>
     * 
     * @param show true if the export dialog should be shown, otherwise false
     */
    public void setDialogShowExportSettings(boolean show) {

        m_showExportSettings = show;
    }

    /**
     *  Sets if the lock dialog should be shown.<p>
     * 
     * @param show true if the lock dialog should be shown, otherwise false
     */
    public void setDialogShowLock(boolean show) {

        m_showLock = show;
    }

    /**
     * Sets the style of the direct edit buttons of the user.<p>
     * 
     * @param style the style of the direct edit buttons of the user
     */
    public void setDirectEditButtonStyle(int style) {

        m_directeditButtonStyle = style;
    }

    /**
     * Sets the style of the editor buttons of the user.<p>
     * 
     * @param style the style of the editor buttons of the user
     */
    public void setEditorButtonStyle(int style) {

        m_editorButtonStyle = style;
    }

    /**
     * Sets the editor settings of the user.<p>
     * 
     * @param settings the editor settings of the user
     */
    public void setEditorSettings(Map settings) {

        m_editorSettings = new HashMap(settings);
    }

    /**
     * Sets the style of the explorer buttons of the user.<p>
     * 
     * @param style the style of the explorer buttons of the user
     */
    public void setExplorerButtonStyle(int style) {

        m_explorerButtonStyle = style;
    }

    /**
     * Sets the number of displayed files per page of the user.<p>
     * 
     * @param entries the number of displayed files per page of the user
     */
    public void setExplorerFileEntries(int entries) {

        m_explorerFileEntries = entries;
    }

    /**
     * Sets the explorer start settings.<p>
     * 
     * @param settings explorer start settings tu use
     */
    public void setExplorerSettings(int settings) {

        m_explorerSettings = settings;
    }

    /**
     * Sets the locale of the user.<p>
     * 
     * @param locale the locale of the user
     */
    public void setLocale(Locale locale) {

        m_locale = locale;
    }

    /**
     * Sets the preferred editor for the given resource type of the user.<p>
     * 
     * @param resourceType the resource type
     * @param editorUri the editor URI
     */
    public void setPreferredEditor(String resourceType, String editorUri) {

        if (editorUri == null) {
            m_editorSettings.remove(resourceType);
        }
        m_editorSettings.put(resourceType, editorUri);
    }

    /**
     * Sets the project Settings.<p>
     *
     * @param projectSettings the project Settings to set
     */
    public void setProjectSettings(CmsUserProjectSettings projectSettings) {

        m_projectSettings = projectSettings;
    }

    /**
     * Sets the appearance of the "publish project" button.<p>
     * 
     * @param publishButtonAppearance the appearance of the "publish project" button
     */
    public void setPublishButtonAppearance(String publishButtonAppearance) {

        m_publishButtonAppearance = publishButtonAppearance;
    }

    /**
     * Sets if the explorer view is restricted to the defined site and folder.<p>
     * 
     * @param restrict true if the explorer view is restricted, otherwise false
     */
    public void setRestrictExplorerView(boolean restrict) {

        m_restrictExplorerView = restrict;
    }

    /**
     * Sets if the file creation date should be shown in explorer view.<p>
     * 
     * @param show true if the file creation date should be shown, otherwise false
     */
    public void setShowExplorerFileDateCreated(boolean show) {

        setExplorerSetting(show, CmsUserSettings.FILELIST_DATE_CREATED);
    }

    /**
     * Sets if the file expire date should be shown in explorer view.<p>
     * 
     * @param show true if the file expire date should be shown, otherwise false
     */
    public void setShowExplorerFileDateExpired(boolean show) {

        setExplorerSetting(show, CmsUserSettings.FILELIST_DATE_EXPIRED);
    }

    /**
     * Sets if the file last modified date should be shown in explorer view.<p>
     * 
     * @param show true if the file last modified date should be shown, otherwise false
     */
    public void setShowExplorerFileDateLastModified(boolean show) {

        setExplorerSetting(show, CmsUserSettings.FILELIST_DATE_LASTMODIFIED);
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -