📄 cmsusersettings.java
字号:
/*
* File : $Source: /usr/local/cvs/opencms/src/org/opencms/db/CmsUserSettings.java,v $
* Date : $Date: 2006/03/27 14:52:27 $
* Version: $Revision: 1.36 $
*
* This library is part of OpenCms -
* the Open Source Content Mananagement System
*
* Copyright (c) 2005 Alkacon Software GmbH (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software GmbH, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.db;
import org.opencms.configuration.CmsWorkplaceConfiguration;
import org.opencms.configuration.I_CmsXmlConfiguration;
import org.opencms.file.CmsObject;
import org.opencms.file.CmsUser;
import org.opencms.main.CmsException;
import org.opencms.main.OpenCms;
import org.opencms.report.I_CmsReport;
import org.opencms.synchronize.CmsSynchronizeSettings;
import org.opencms.util.CmsStringUtil;
import org.opencms.workflow.CmsTaskService;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* Object to conveniently access and modify the users workplace settings.<p>
*
* @author Andreas Zahner
* @author Michael Emmerich
*
* @version $Revision: 1.36 $
*
* @since 6.0.0
*/
public class CmsUserSettings {
/** Key for additional info of resources that were confirmemed by the user. */
public static final String ADDITIONAL_INFO_CONFIRMED_RESOURCES = "ADDITIONAL_INFO_CONFIRMED_RESOURCES";
/** Key for additional info address. */
public static final String ADDITIONAL_INFO_COUNTRY = "USER_COUNTRY";
/** Key for additional info default group. */
public static final String ADDITIONAL_INFO_DEFAULTGROUP = "USER_DEFAULTGROUP";
/** Key for additional info explorer settings. */
public static final String ADDITIONAL_INFO_EXPLORERSETTINGS = "USER_EXPLORERSETTINGS";
/** Key for additional info flags. */
public static final String ADDITIONAL_INFO_PREFERENCES = "USER_PREFERENCES";
/** Key for additional info start settings. */
public static final String ADDITIONAL_INFO_STARTSETTINGS = "USER_STARTSETTINGS";
/** Key for additional info city. */
// Value must unfortunatly still be "USER_TOWN" or existing serialized user information will be lost
public static final String ADDITIONAL_INFO_CITY = "USER_TOWN";
/**
* Key for additional info city.
*
* @deprecated use {@link #ADDITIONAL_INFO_CITY} instead
*/
public static final String ADDITIONAL_INFO_TOWN = "USER_TOWN";
/** Key for additional info address. */
public static final String ADDITIONAL_INFO_ZIPCODE = "USER_ZIPCODE";
/** Flag for displaying the date created column. */
public static final int FILELIST_DATE_CREATED = 1024;
/** Flag for displaying the date expired column. */
public static final int FILELIST_DATE_EXPIRED = 8192;
/** Flag for displaying the changed column. */
public static final int FILELIST_DATE_LASTMODIFIED = 4;
/** Flag for displaying the date released column. */
public static final int FILELIST_DATE_RELEASED = 4096;
/** Flag for displaying the locked column. */
public static final int FILELIST_LOCKEDBY = 256;
/** Flag for displaying the name column. */
public static final int FILELIST_NAME = 512;
/** Flag for displaying the access column. */
public static final int FILELIST_PERMISSIONS = 128;
/** Flag for displaying the size column. */
public static final int FILELIST_SIZE = 8;
/** Flag for displaying the state column. */
public static final int FILELIST_STATE = 16;
/** Flag for displaying the title column. */
public static final int FILELIST_TITLE = 1;
/** Flag for displaying the filetype column. */
public static final int FILELIST_TYPE = 2;
/** Flag for displaying the owner column. */
public static final int FILELIST_USER_CREATED = 32;
/** Flag for displaying the user who last modified column. */
public static final int FILELIST_USER_LASTMODIFIED = 2048;
/** The default button style. */
private static final int BUTTONSTYLE_DEFAULT = 1;
/** The default number of entries per page. */
private static final int ENTRYS_PER_PAGE_DEFAULT = 50;
/** Identifier prefix for all keys in the user additional info table. */
private static final String PREFERENCES = "USERPREFERENCES_";
/** Identifier for the project settings key. */
private static final String PROJECT_SETTINGS = "PROJECT_SETTINGS";
/** Identifier for the synchronize setting key. */
private static final String SYNC_SETTINGS = "SYNC_SETTINGS";
private boolean m_dialogDirectpublish;
private boolean m_dialogExpandInheritedPermissions;
private boolean m_dialogExpandUserPermissions;
private int m_dialogFileCopy;
private int m_dialogFileDelete;
private int m_dialogFolderCopy;
private boolean m_dialogPermissionsInheritOnFolder;
private int m_directeditButtonStyle;
private int m_editorButtonStyle;
private HashMap m_editorSettings;
private int m_explorerButtonStyle;
private int m_explorerFileEntries;
private int m_explorerSettings;
private Locale m_locale;
private String m_project;
private CmsUserProjectSettings m_projectSettings;
private String m_publishButtonAppearance;
private boolean m_restrictExplorerView;
private boolean m_showExportSettings;
private boolean m_showLock;
private String m_startFolder;
private String m_startSite;
private CmsSynchronizeSettings m_synchronizeSettings;
private int m_taskMessages;
private boolean m_taskShowProjects;
private String m_taskStartupfilter;
private boolean m_uploadApplet;
private CmsUser m_user;
private String m_view;
private int m_workplaceButtonStyle;
private String m_workplaceReportType;
/**
* Creates an empty new user settings object.<p>
*/
public CmsUserSettings() {
m_workplaceButtonStyle = BUTTONSTYLE_DEFAULT;
m_workplaceReportType = I_CmsReport.REPORT_TYPE_SIMPLE;
m_explorerButtonStyle = BUTTONSTYLE_DEFAULT;
m_explorerFileEntries = ENTRYS_PER_PAGE_DEFAULT;
m_explorerSettings = CmsUserSettings.FILELIST_NAME;
m_editorSettings = new HashMap();
}
/**
* Creates a user settings object with initialized settings of the current user.<p>
*
* @param cms the OpenCms context
*/
public CmsUserSettings(CmsObject cms) {
init(cms, cms.getRequestContext().currentUser());
}
/**
* Creates a user settings object with initialized settings of the user.<p>
*
* @param cms the OpenCms context
* @param user the OpenCms user
*/
public CmsUserSettings(CmsObject cms, CmsUser user) {
init(cms, user);
}
/**
* Creates a user settings object with initialized settings of the user.<p>
*
* Some default settings will be unset, if no cms object is given.<p>
*
* @param user the current CmsUser
*
* @see #CmsUserSettings(CmsObject, CmsUser)
*/
public CmsUserSettings(CmsUser user) {
init(user);
}
/**
* Gets the default copy mode when copying a file of the user.<p>
*
* @return the default copy mode when copying a file of the user
*/
public int getDialogCopyFileMode() {
return m_dialogFileCopy;
}
/**
* Gets the default copy mode when copying a folder of the user.<p>
*
* @return the default copy mode when copying a folder of the user
*/
public int getDialogCopyFolderMode() {
return m_dialogFolderCopy;
}
/**
* Returns the default setting for file deletion.<p>
*
* @return the default setting for file deletion
*/
public int getDialogDeleteFileMode() {
return m_dialogFileDelete;
}
/**
* Returns the default setting for expanding inherited permissions in the dialog.<p>
*
* @return true if inherited permissions should be expanded, otherwise false
*/
public boolean getDialogExpandInheritedPermissions() {
return m_dialogExpandInheritedPermissions;
}
/**
* Returns the default setting for expanding the users permissions in the dialog.<p>
*
* @return true if the users permissions should be expanded, otherwise false
*/
public boolean getDialogExpandUserPermissions() {
return m_dialogExpandUserPermissions;
}
/**
* Returns the default setting for inheriting permissions on folders.<p>
*
* @return true if permissions should be inherited on folders, otherwise false
*/
public boolean getDialogPermissionsInheritOnFolder() {
return m_dialogPermissionsInheritOnFolder;
}
/**
* Returns the default setting for direct publishing.<p>
*
* @return the default setting for direct publishing: true if siblings should be published, otherwise false
*/
public boolean getDialogPublishSiblings() {
return m_dialogDirectpublish;
}
/**
* Determines if the export part of the secure/export dialog should be shown.<p>
*
* @return true if the export dialog is shown, otherwise false
*/
public boolean getDialogShowExportSettings() {
return m_showExportSettings;
}
/**
* Determines if the lock dialog should be shown.<p>
*
* @return true if the lock dialog is shown, otherwise false
*/
public boolean getDialogShowLock() {
return m_showLock;
}
/**
* Returns the style of the direct edit buttons of the user.<p>
*
* @return the style of the direct edit buttons of the user
*/
public int getDirectEditButtonStyle() {
return m_directeditButtonStyle;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -