📄 cmsusersettings.java
字号:
} catch (Throwable t) {
m_explorerButtonStyle = OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerButtonStyle();
}
// explorer file entires
try {
m_explorerFileEntries = ((Integer)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_EXPLORERGENERALOPTIONS
+ CmsWorkplaceConfiguration.N_ENTRIES)).intValue();
} catch (Throwable t) {
m_explorerFileEntries = OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerFileEntries();
}
// explorer settings
try {
m_explorerSettings = ((Integer)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_EXPLORERGENERALOPTIONS
+ CmsWorkplaceConfiguration.N_EXPLORERDISPLAYOPTIONS)).intValue();
} catch (Throwable t) {
m_explorerSettings = OpenCms.getWorkplaceManager().getDefaultUserSettings().getExplorerSettings();
}
// dialog file copy mode
try {
m_dialogFileCopy = ((Integer)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_FILECOPY)).intValue();
} catch (Throwable t) {
m_dialogFileCopy = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogCopyFileMode();
}
// dialog folder copy mode
try {
m_dialogFolderCopy = ((Integer)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_FOLDERCOPY)).intValue();
} catch (Throwable t) {
m_dialogFolderCopy = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogCopyFolderMode();
}
// dialog file delete mode
try {
m_dialogFileDelete = ((Integer)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_FILEDELETION)).intValue();
} catch (Throwable t) {
m_dialogFileDelete = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogDeleteFileMode();
}
// dialog directpublish mode
try {
m_dialogDirectpublish = ((Boolean)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_DIRECTPUBLISH)).booleanValue();
} catch (Throwable t) {
m_dialogDirectpublish = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogPublishSiblings();
}
// dialog show lock mode
try {
m_showLock = ((Boolean)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_SHOWLOCK)).booleanValue();
} catch (Throwable t) {
m_showLock = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogShowLock();
}
// dialog show export settings mode
try {
m_showExportSettings = ((Boolean)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_SHOWEXPORTSETTINGS)).booleanValue();
} catch (Throwable t) {
m_showExportSettings = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogShowExportSettings();
}
// dialog permissions inheritation mode
try {
m_dialogPermissionsInheritOnFolder = ((Boolean)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_PERMISSIONSINHERITONFOLDER)).booleanValue();
} catch (Throwable t) {
m_dialogPermissionsInheritOnFolder = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogPermissionsInheritOnFolder();
}
// dialog expand inherited permissions mode
try {
m_dialogExpandInheritedPermissions = ((Boolean)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_EXPANDPERMISSIONSINHERITED)).booleanValue();
} catch (Throwable t) {
m_dialogExpandInheritedPermissions = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogExpandInheritedPermissions();
}
// dialog expand users permissions mode
try {
m_dialogExpandUserPermissions = ((Boolean)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_EXPANDPERMISSIONSUSER)).booleanValue();
} catch (Throwable t) {
m_dialogExpandUserPermissions = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogExpandUserPermissions();
}
// editor button style
try {
m_editorButtonStyle = ((Integer)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_EDITORGENERALOPTIONS
+ CmsWorkplaceConfiguration.N_BUTTONSTYLE)).intValue();
} catch (Throwable t) {
m_editorButtonStyle = OpenCms.getWorkplaceManager().getDefaultUserSettings().getEditorButtonStyle();
}
// directedit button style
try {
m_directeditButtonStyle = ((Integer)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_EDITORGENERALOPTIONS
+ CmsWorkplaceConfiguration.N_DIRECTEDITSTYLE)).intValue();
} catch (Throwable t) {
m_directeditButtonStyle = OpenCms.getWorkplaceManager().getDefaultUserSettings().getDirectEditButtonStyle();
}
// editor settings
m_editorSettings = (HashMap)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_EDITORPREFERREDEDITORS);
if (m_editorSettings == null) {
m_editorSettings = new HashMap(OpenCms.getWorkplaceManager().getDefaultUserSettings().getEditorSettings());
}
// task startupfilter
m_taskStartupfilter = (String)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKFLOWGENERALOPTIONS
+ CmsWorkplaceConfiguration.N_STARTUPFILTER);
if (m_taskStartupfilter == null) {
m_taskStartupfilter = OpenCms.getWorkplaceManager().getDefaultUserSettings().getTaskStartupFilter();
}
// task show all projects
try {
m_taskShowProjects = ((Boolean)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKFLOWGENERALOPTIONS
+ CmsWorkplaceConfiguration.N_SHOWPROJECTS)).booleanValue();
} catch (Throwable t) {
m_taskShowProjects = OpenCms.getWorkplaceManager().getDefaultUserSettings().getTaskShowAllProjects();
}
// task messages
try {
m_taskMessages = ((Integer)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKFLOWDEFAULTSETTINGS)).intValue();
} catch (Throwable t) {
m_taskMessages = OpenCms.getWorkplaceManager().getDefaultUserSettings().getTaskMessageValue();
}
// start site
m_startSite = ((String)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
+ I_CmsXmlConfiguration.N_SITE));
if (m_startSite == null) {
m_startSite = OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartSite();
}
// start folder
m_startFolder = ((String)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
+ CmsWorkplaceConfiguration.N_FOLDER));
if (m_startFolder == null) {
m_startFolder = OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartFolder();
}
// restrict explorer folder view
try {
m_restrictExplorerView = ((Boolean)m_user.getAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
+ CmsWorkplaceConfiguration.N_RESTRICTEXPLORERVIEW)).booleanValue();
} catch (Throwable t) {
m_restrictExplorerView = OpenCms.getWorkplaceManager().getDefaultUserSettings().getRestrictExplorerView();
}
// synchronize settings
try {
m_synchronizeSettings = ((CmsSynchronizeSettings)m_user.getAdditionalInfo(PREFERENCES + SYNC_SETTINGS));
} catch (Throwable t) {
// default is to disable the synchronize settings
m_synchronizeSettings = null;
}
// project settings
try {
m_projectSettings = ((CmsUserProjectSettings)m_user.getAdditionalInfo(PREFERENCES + PROJECT_SETTINGS));
} catch (Throwable t) {
m_projectSettings = null;
}
if (m_projectSettings == null) {
// default
m_projectSettings = new CmsUserProjectSettings();
m_projectSettings.setDeleteAfterPublishing(false);
try {
m_projectSettings.setManagerGroup(cms.readGroup(OpenCms.getDefaultUsers().getGroupProjectmanagers()).getId());
} catch (Exception e) {
// ignore
}
try {
m_projectSettings.setUserGroup(cms.readGroup(OpenCms.getDefaultUsers().getGroupUsers()).getId());
} catch (Exception e) {
// ignore
}
m_projectSettings.setProjectFilesMode(CmsProjectResourcesDisplayMode.ALL_CHANGES);
}
try {
save(null);
} catch (CmsException e) {
// to nothing here
}
}
/**
* Initializes the user settings with the given users setting parameters.<p>
*
* Some default settings will be unset, if no cms object is given.<p>
*
* @param user the current CmsUser
*
* @see #init(CmsObject, CmsUser)
*/
public void init(CmsUser user) {
init(null, user);
}
/**
* Saves the changed settings of the user to the user object.<p>
*
* If the given CmsObject is null, 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
*/
public void save(CmsObject cms) throws CmsException {
// only set those values that are different than the default values
// if the user info should be updated in the databas (i.e. the CmsObject != null)
// all values that are equal to the defaul values must be deleted form the additinal
// 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 uploadapplet
if (useUploadApplet() != OpenCms.getWorkplaceManager().getDefaultUserSettings().useUploadApplet()) {
m_user.setAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
+ CmsWorkplaceConfiguration.N_UPLOADAPPLET, new Boolean(useUploadApplet()));
} else if (cms != null) {
m_user.deleteAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACEGENERALOPTIONS
+ CmsWorkplaceConfiguration.N_UPLOADAPPLET);
}
// locale
if (!getLocale().equals(OpenCms.getWorkplaceManager().getDefaultUserSettings().getLocale())) {
m_user.setAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
+ CmsWorkplaceConfiguration.N_LOCALE, getLocale());
} else if (cms != null) {
m_user.deleteAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
+ CmsWorkplaceConfiguration.N_LOCALE);
}
// startproject
if (!getStartProject().equals(OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartProject())) {
m_user.setAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_WORKPLACESTARTUPSETTINGS
+ CmsWorkplaceConfiguration.N_PROJECT, getStartProject());
} 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);
}
// 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 entires
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()));
} 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()));
} 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()));
} else if (cms != null) {
m_user.deleteAdditionalInfo(PREFERENCES
+ CmsWorkplaceConfiguration.N_DIALOGSDEFAULTSETTINGS
+ CmsWorkplaceConfiguration.N_FILEDELETION);
}
// dialog directpublish mode
if (getDialogPublishSiblings() != OpenCms.getWorkplaceManager().getDefaultUserSettings().getDialogPublishSiblings()) {
m_user.setAdditionalInfo(PREFERENCES
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -