|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.workplace.CmsWorkplaceManager
public final class CmsWorkplaceManager
Manages the global OpenCms workplace settings for all users.
This class reads the settings from the "opencms.properties" and stores them in member variables. For each setting one or more get methods are provided.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_WORKPLACE_ENCODING
The default encoding for the workplace (UTF-8). |
static java.lang.String |
PARAM_LOGIN_REQUESTED_RESOURCE
The id of the "requestedResource" parameter for the OpenCms login form. |
static java.lang.String |
SESSION_WORKPLACE_SETTINGS
Key name for the session workplace settings. |
Constructor Summary | |
---|---|
CmsWorkplaceManager()
Creates a new instance for the workplace manager, will be called by the workplace configuration manager. |
Method Summary | |
---|---|
void |
addDialogHandler(I_CmsDialogHandler clazz)
Adds a dialog handler instance to the list of configured dialog handlers. |
void |
addEditorCssHandler(java.lang.String editorCssHandlerClassName)
Adds an editor CSS handler class to the list of handlers. |
void |
addEditorCssHandlerToHead(java.lang.String editorCssHandlerClassName)
Adds an editor CSS handler class at the first position of the list of handlers. |
void |
addExplorerTypeSetting(CmsExplorerTypeSettings settings)
Adds an explorer type setting object to the list of type settings. |
void |
addExplorerTypeSettings(CmsModule module)
Adds the list of explorer type settings from the given module. |
void |
addExportPoint(java.lang.String uri,
java.lang.String destination)
Adds newly created export point to the workplace configuration. |
void |
addLabeledFolder(java.lang.String uri)
Adds a folder to the list of labeled folders. |
void |
addLocalizedFolder(java.lang.String uri)
Adds a new folder to the list of localized workplace folders. |
void |
addMenuRule(CmsMenuRule menuRule)
Adds a menu rule set from the workplace configuration to the configured menu rules. |
void |
addPreEditorConditionDefinition(java.lang.String resourceTypeName,
java.lang.String preEditorConditionDefinitionClassName)
Adds a condition definition class for a given resource type glass name that is triggered before opening the editor. |
boolean |
autoLockResources()
Returns if the autolock resources feature is enabled. |
void |
cmsEvent(CmsEvent event)
Implements the event listener of this class. |
java.lang.String |
createTempFile(CmsObject cms,
java.lang.String resourceName,
CmsUUID currentProjectId)
Creates a temporary file which is needed while working in an editor with preview option. |
CmsWorkplaceCustomFoot |
getCustomFoot()
Returns the customized workplace foot. |
CmsExplorerTypeAccess |
getDefaultAccess()
Gets the access object of the type settings. |
java.util.Locale |
getDefaultLocale()
Returns the Workplace default locale. |
CmsDefaultUserSettings |
getDefaultUserSettings()
Returns the Workplace default user settings. |
java.util.Map |
getDialogHandler()
Returns all instantiated dialog handlers for the workplace. |
java.lang.Object |
getDialogHandler(java.lang.String key)
Returns the instantiated dialog handler class for the key or null, if there is no mapping for the key. |
I_CmsDirectEditProvider |
getDirectEditProvider()
Returns a new instance of the configured direct edit provider. |
I_CmsEditorActionHandler |
getEditorActionHandler()
Returns the instantiated editor action handler class. |
java.util.List |
getEditorCssHandlers()
Returns the instantiated editor CSS handler classes. |
CmsEditorDisplayOptions |
getEditorDisplayOptions()
Returns the instantiated editor display option class. |
I_CmsEditorHandler |
getEditorHandler()
Returns the instantiated editor handler class. |
java.lang.String |
getEncoding()
Returns the configured workplace encoding. |
CmsExplorerTypeSettings |
getExplorerTypeSetting(java.lang.String type)
Returns the explorer type settings for the specified resource type. |
java.util.List |
getExplorerTypeSettings()
Returns the list of explorer type settings. |
java.util.Set |
getExportPoints()
Returns the set of configured export points for the workplace. |
long |
getFileBytesMaxUploadSize(CmsObject cms)
Returns the value (in bytes) for the maximum file upload size of the current user. |
int |
getFileMaxUploadSize()
Returns the value (in kb) for the maximum file upload size. |
CmsRfsFileViewer |
getFileViewSettings()
Returns the system-wide file view settings for the workplace. |
java.util.Map |
getGalleries()
Returns a collection of all available galleries. |
CmsI18nInfo |
getI18nInfo(javax.servlet.http.HttpServletRequest req,
CmsUser user,
CmsProject project,
java.lang.String resource)
Returns the i18n information to use in the request context. |
java.util.List |
getLabelSiteFolders()
Returns a list of site folders which generate labeled links. |
java.util.List |
getLocales()
Returns the list of available workplace locales, sorted ascending. |
java.util.List |
getLocalizedFolders()
Returns the configured list of localized workplace folders. |
CmsMenuRule |
getMenuRule(java.lang.String ruleName)
Returns the menu rule set with the given name. |
java.util.List |
getMenuRules()
Returns the configured menu rule sets. |
java.util.Map |
getMenuRulesMap()
Returns the configured menu rule sets as Map. |
CmsWorkplaceMessages |
getMessages(java.util.Locale locale)
Returns the CmsWorkplaceMessages for the given locale. |
CmsExplorerContextMenu |
getMultiContextMenu()
Returns the configured multi context menu to use in the Explorer view. |
I_CmsPreEditorActionDefinition |
getPreEditorConditionDefinition(I_CmsResourceType resourceType)
Returns the condition definition for the given resource type that is triggered before opening the editor. |
java.util.List |
getPreEditorConditionDefinitions()
Returns the condition definitions for the different resource types which are triggered before opening the editor. |
CmsUUID |
getTempFileProjectId()
Returns the id of the temporary file project required by the editors. |
CmsToolManager |
getToolManager()
Returns the tool manager. |
CmsWorkplaceUserInfoManager |
getUserInfoManager()
Returns the user additional information configuration Manager. |
java.util.List |
getViews()
Returns the map of configured workplace views. |
CmsWorkplaceEditorManager |
getWorkplaceEditorManager()
Returns the instantiated workplace editor manager class. |
void |
initHandler(CmsObject cms)
Will be called during system startup. |
void |
initialize(CmsObject cms)
Initializes the workplace manager with the OpenCms system configuration. |
boolean |
isDefaultPropertiesOnStructure()
Returns the default property editing mode on resources. |
boolean |
isEnableAdvancedPropertyTabs()
Returns if tabs in the advanced property dialog are enabled. |
static boolean |
isWorkplaceUser(javax.servlet.http.HttpServletRequest req)
Returns true if the provided request was done by a Workplace user. |
boolean |
isXmlContentAutoCorrect()
Returns if XML content is automatically corrected when opened with the editor. |
void |
removeExplorerTypeSettings(CmsModule module)
Removes the list of explorer type settings from the given module. |
void |
setAutoLock(java.lang.String value)
Sets if the autolock resources feature is enabled. |
void |
setCustomFoot(CmsWorkplaceCustomFoot footCustom)
Sets the customized workplace foot. |
void |
setDefaultAccess(CmsExplorerTypeAccess access)
Sets the access object of the type settings. |
void |
setDefaultLocale(java.lang.String locale)
Sets the Workplace default locale. |
void |
setDefaultPropertiesOnStructure(java.lang.String defaultPropertiesOnStructure)
Sets the default property editing mode on resources. |
void |
setDefaultUserSettings(CmsDefaultUserSettings defaultUserSettings)
Sets the Workplace default user settings. |
void |
setDirectEditProvider(I_CmsDirectEditProvider clazz)
Sets the direct edit provider. |
void |
setEditorAction(I_CmsEditorActionHandler clazz)
Sets the editor action class. |
void |
setEditorDisplayOptions(CmsEditorDisplayOptions clazz)
Sets the editor display option class. |
void |
setEditorHandler(I_CmsEditorHandler clazz)
Sets the editor handler class. |
void |
setEnableAdvancedPropertyTabs(java.lang.String enableAdvancedPropertyTabs)
Sets if tabs in the advanced property dialog are enabled. |
void |
setFileMaxUploadSize(java.lang.String value)
Sets the value (in kb) for the maximum file upload size. |
void |
setFileViewSettings(CmsObject cms,
CmsRfsFileViewer fileViewSettings)
Sets the system-wide file view settings for the workplace. |
void |
setMultiContextMenu(CmsExplorerContextMenu multiContextMenu)
Sets the configured multi context menu to use in the Explorer view. |
void |
setToolManager(CmsToolManager toolManager)
Sets the tool Manager object. |
void |
setUserInfoManager(CmsWorkplaceUserInfoManager userInfoManager)
Sets the user additional information configuration manager. |
void |
setUserManagementEnabled(java.lang.String value)
Controls if the user/group icon in the administration view should be shown. |
void |
setXmlContentAutoCorrect(java.lang.String xmlContentAutoCorrect)
Sets the auto correction of XML contents when they are opened with the editor. |
boolean |
showUserGroupIcon()
Returns if the user/group icon in the administration view should be shown. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_WORKPLACE_ENCODING
public static final java.lang.String PARAM_LOGIN_REQUESTED_RESOURCE
public static final java.lang.String SESSION_WORKPLACE_SETTINGS
Constructor Detail |
---|
public CmsWorkplaceManager()
Method Detail |
---|
public static boolean isWorkplaceUser(javax.servlet.http.HttpServletRequest req)
req
- the request to check
public void addDialogHandler(I_CmsDialogHandler clazz)
clazz
- the instantiated dialog handler to addpublic void addEditorCssHandler(java.lang.String editorCssHandlerClassName)
editorCssHandlerClassName
- full class name of the css handler classpublic void addEditorCssHandlerToHead(java.lang.String editorCssHandlerClassName)
editorCssHandlerClassName
- full class name of the css handler classpublic void addExplorerTypeSetting(CmsExplorerTypeSettings settings)
settings
- the explorer type settingspublic void addExplorerTypeSettings(CmsModule module)
module
- the module witch contains the explorer type settings to addpublic void addExportPoint(java.lang.String uri, java.lang.String destination)
uri
- the export point uridestination
- the export point destinationpublic void addLabeledFolder(java.lang.String uri)
uri
- the folder uri to addpublic void addLocalizedFolder(java.lang.String uri)
uri
- a new folder to add to the list of localized workplace folderspublic void addMenuRule(CmsMenuRule menuRule)
menuRule
- the menu rule to addpublic void addPreEditorConditionDefinition(java.lang.String resourceTypeName, java.lang.String preEditorConditionDefinitionClassName)
resourceTypeName
- the name of the resource typepreEditorConditionDefinitionClassName
- full class name of the condition definition classpublic boolean autoLockResources()
public void cmsEvent(CmsEvent event)
cmsEvent
in interface I_CmsEventListener
event
- CmsEvent that has occurredI_CmsEventListener.cmsEvent(org.opencms.main.CmsEvent)
public java.lang.String createTempFile(CmsObject cms, java.lang.String resourceName, CmsUUID currentProjectId) throws CmsException
cms
- the cms contextresourceName
- the name of the resource to copycurrentProjectId
- the id of the project to work with
CmsException
- if something goes wrongpublic CmsWorkplaceCustomFoot getCustomFoot()
public CmsExplorerTypeAccess getDefaultAccess()
public java.util.Locale getDefaultLocale()
public CmsDefaultUserSettings getDefaultUserSettings()
public java.util.Map getDialogHandler()
public java.lang.Object getDialogHandler(java.lang.String key)
key
- the key whose associated value is to be returned
public I_CmsDirectEditProvider getDirectEditProvider()
public I_CmsEditorActionHandler getEditorActionHandler()
public java.util.List getEditorCssHandlers()
public CmsEditorDisplayOptions getEditorDisplayOptions()
public I_CmsEditorHandler getEditorHandler()
public java.lang.String getEncoding()
public CmsExplorerTypeSettings getExplorerTypeSetting(java.lang.String type)
type
- the resource type for which the settings are required
public java.util.List getExplorerTypeSettings()
These settings provide information for the new resource dialog and the context menu appearance.
public java.util.Set getExportPoints()
public long getFileBytesMaxUploadSize(CmsObject cms)
cms
- the initialized CmsObject
public int getFileMaxUploadSize()
public CmsRfsFileViewer getFileViewSettings()
Note that this instance may not modified (invocation of setters) directly or a
will be thrown.CmsRuntimeException
It has to be cloned first and then may be written back to the workplace settings using
method setFileViewSettings(CmsObject, org.opencms.util.CmsRfsFileViewer)
.
public java.util.Map getGalleries()
The Map has the gallery type name as key and an instance of the gallery class (not completely initialized) as value.
public CmsI18nInfo getI18nInfo(javax.servlet.http.HttpServletRequest req, CmsUser user, CmsProject project, java.lang.String resource)
I_CmsLocaleHandler
getI18nInfo
in interface I_CmsLocaleHandler
req
- the current http requestuser
- the current userproject
- the current projectresource
- the URI of the requested resource (with full site root added)
I_CmsLocaleHandler.getI18nInfo(javax.servlet.http.HttpServletRequest, org.opencms.file.CmsUser, org.opencms.file.CmsProject, java.lang.String)
public java.util.List getLabelSiteFolders()
public java.util.List getLocales()
Please note: Be careful not to modify the returned Set as it is not a clone.
public java.util.List getLocalizedFolders()
public CmsMenuRule getMenuRule(java.lang.String ruleName)
If no rule set with the specified name is found, null
is returned.
ruleName
- the name of the rule set to get
public java.util.List getMenuRules()
public java.util.Map getMenuRulesMap()
public CmsWorkplaceMessages getMessages(java.util.Locale locale)
CmsWorkplaceMessages
for the given locale.The workplace messages are a collection of resource bundles, containing the messages for all OpenCms core bundles and of all initialized modules.
Please note that the message objects are cached internally. The returned message object should therefore never be modified directly in any way.
locale
- the locale to get the messages for
CmsWorkplaceMessages
for the given localepublic CmsExplorerContextMenu getMultiContextMenu()
public I_CmsPreEditorActionDefinition getPreEditorConditionDefinition(I_CmsResourceType resourceType)
resourceType
- the resource type
public java.util.List getPreEditorConditionDefinitions()
public CmsUUID getTempFileProjectId()
public CmsToolManager getToolManager()
public CmsWorkplaceUserInfoManager getUserInfoManager()
public java.util.List getViews()
public CmsWorkplaceEditorManager getWorkplaceEditorManager()
public void initHandler(CmsObject cms)
I_CmsLocaleHandler
initHandler
in interface I_CmsLocaleHandler
cms
- an initialized cms permission context for VFS accessI_CmsLocaleHandler.initHandler(org.opencms.file.CmsObject)
public void initialize(CmsObject cms) throws CmsException, CmsRoleViolationException
cms
- an OpenCms context object that must have been initialized with "Admin" permissions
CmsRoleViolationException
- if the provided OpenCms user context does
not have CmsRole.WORKPLACE_MANAGER
role permissions
CmsException
- if something goes wrongpublic boolean isDefaultPropertiesOnStructure()
public boolean isEnableAdvancedPropertyTabs()
true
if tabs should be enabled, otherwise false
public boolean isXmlContentAutoCorrect()
true
if XML content is automatically corrected when opened with the editor, otherwise false
public void removeExplorerTypeSettings(CmsModule module)
module
- the module witch contains the explorer type settings to removepublic void setAutoLock(java.lang.String value)
value
- "true"
if the autolock resources feature is enabled, otherwise falsepublic void setCustomFoot(CmsWorkplaceCustomFoot footCustom)
footCustom
- the customized workplace footpublic void setDefaultAccess(CmsExplorerTypeAccess access)
access
- access objectpublic void setDefaultLocale(java.lang.String locale)
locale
- the locale to setpublic void setDefaultPropertiesOnStructure(java.lang.String defaultPropertiesOnStructure)
defaultPropertiesOnStructure
- the default property editing mode on resourcespublic void setDefaultUserSettings(CmsDefaultUserSettings defaultUserSettings)
defaultUserSettings
- the user settings to setpublic void setDirectEditProvider(I_CmsDirectEditProvider clazz)
clazz
- the direct edit provider to setpublic void setEditorAction(I_CmsEditorActionHandler clazz)
clazz
- the editor action class to setpublic void setEditorDisplayOptions(CmsEditorDisplayOptions clazz)
clazz
- the editor display option class to setpublic void setEditorHandler(I_CmsEditorHandler clazz)
clazz
- the editor handler class to setpublic void setEnableAdvancedPropertyTabs(java.lang.String enableAdvancedPropertyTabs)
enableAdvancedPropertyTabs
- true if tabs should be enabled, otherwise falsepublic void setFileMaxUploadSize(java.lang.String value)
value
- the value (in kb) for the maximum file upload sizepublic void setFileViewSettings(CmsObject cms, CmsRfsFileViewer fileViewSettings) throws CmsRoleViolationException
cms
- the CmsObject for ensuring security constraints.fileViewSettings
- the system-wide file view settings for the workplace to set
CmsRoleViolationException
- if the current user does not own the administrator role (CmsRole.ROOT_ADMIN
)public void setMultiContextMenu(CmsExplorerContextMenu multiContextMenu)
multiContextMenu
- the configured multi context menu to use in the Explorer viewpublic void setToolManager(CmsToolManager toolManager)
toolManager
- the tool Manager object to setpublic void setUserInfoManager(CmsWorkplaceUserInfoManager userInfoManager)
userInfoManager
- the manager to setpublic void setUserManagementEnabled(java.lang.String value)
value
- "true"
if the user/group icon in the administration view should be shown, otherwise falsepublic void setXmlContentAutoCorrect(java.lang.String xmlContentAutoCorrect)
xmlContentAutoCorrect
- if "true", the content will be corrected without notification, otherwise a confirmation is neededpublic boolean showUserGroupIcon()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |