Package org.opencms.ui.apps
Class CmsWorkplaceAppManager
java.lang.Object
org.opencms.ui.apps.CmsWorkplaceAppManager
The workplace app manager.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Comparator for configuration objects implementing I_CmsHasOrder.static class
Wrapper for the navigation state. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The administration category id.static final String
The legacy category id.protected static org.apache.commons.logging.Log
The logger for this class.static final String
The main category id.static final String
The toolbar.css resource name.static String
The workplace app settings additional info key.static String
The workplace CSS module parameter name. -
Constructor Summary
ModifierConstructorDescriptionprotected
Constructor for testing only.CmsWorkplaceAppManager
(CmsObject adminCms) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the additional style sheets provided by I_CmsWorkplaceStylesheetProvider services.getAppConfiguration
(String appId) Returns the app configuration with the given id.getAppConfigurations
(String... appIds) Returns the app configuration instances for the given ids.<T extends I_CmsAppSettings>
TgetAppSettings
(CmsObject cms, Class<T> type) Returns the user app setting of the given type.Returns the configured categories.getDefaultAction
(I_CmsDialogContext context) Returns the default action for the given context if available.getDefaultAction
(I_CmsDialogContext context, I_CmsContextMenuItemProvider menuItemProvider) Returns the default action for the given context if available.Gets all configured quick launch apps, independent of the current user.getEditorForResource
(CmsObject cms, CmsResource resource, boolean plainText) Returns the editor for the given resource.getEditorForType
(I_CmsResourceType type, boolean plainText) Returns the editor for the given resource type.Gets the menu item provider for the workplace.Gets the configured quick launch apps which are visible for the current user.Returns the user icon helper.protected List<I_CmsWorkplaceAppConfiguration>
Returns the quick launch apps set for the current user.Returns all available workplace apps.Returns the additional workplace CSS URIs.void
initWorkplaceCssUris
(CmsModuleManager moduleManager) Initializes the additional workplace CSS URIs.void
loadApps()
Loads the workplace apps.protected void
setUserQuickLaunchApps
(CmsObject cms, List<String> apps) Writes the user quick launch apps setting to the user additional info.void
storeAppSettings
(CmsObject cms, Class<? extends I_CmsAppSettings> type, I_CmsAppSettings appSettings) Stores the given app setting within the users additional info.
-
Field Details
-
ADMINISTRATION_CATEGORY_ID
The administration category id.- See Also:
-
LEGACY_CATEGORY_ID
The legacy category id.- See Also:
-
MAIN_CATEGORY_ID
The main category id.- See Also:
-
TOOLBAR_CSS
The toolbar.css resource name.- See Also:
-
WORKPLACE_APP_SETTINGS_KEY
The workplace app settings additional info key. -
WORKPLACE_CSS_PARAM
The workplace CSS module parameter name. -
LOG
The logger for this class.
-
-
Constructor Details
-
CmsWorkplaceAppManager
Constructor.- Parameters:
adminCms
- the admin cms context- Throws:
CmsException
- in case initializing the cms object fails
-
CmsWorkplaceAppManager
protected CmsWorkplaceAppManager()Constructor for testing only.
-
-
Method Details
-
getAdditionalStyleSheets
Returns the additional style sheets provided by I_CmsWorkplaceStylesheetProvider services.- Returns:
- the additional style sheets
-
getAppConfiguration
Returns the app configuration with the given id.- Parameters:
appId
- the app id- Returns:
- the app configuration
-
getAppConfigurations
Returns the app configuration instances for the given ids.- Parameters:
appIds
- the app ids- Returns:
- the app configurations
-
getAppSettings
public <T extends I_CmsAppSettings> T getAppSettings(CmsObject cms, Class<T> type) throws InstantiationException, IllegalAccessException Returns the user app setting of the given type.- Parameters:
cms
- the cms contexttype
- the app setting type- Returns:
- the app setting
- Throws:
InstantiationException
- in case instantiating the settings type failsIllegalAccessException
- in case the settings default constructor is not accessible
-
getCategories
Returns the configured categories.- Returns:
- the app categories
-
getDefaultAction
Returns the default action for the given context if available.- Parameters:
context
- the dialog context- Returns:
- the default action
-
getDefaultQuickLaunchConfigurations
Gets all configured quick launch apps, independent of the current user.- Returns:
- the quick launch apps
-
getEditorForResource
Returns the editor for the given resource.- Parameters:
cms
- the CMS contextresource
- the resource to editplainText
- if plain text editing is required- Returns:
- the editor
-
getEditorForType
Returns the editor for the given resource type.- Parameters:
type
- the resource type to editplainText
- if plain text editing is required- Returns:
- the editor
-
getMenuItemProvider
Gets the menu item provider for the workplace.- Returns:
- the menu item provider
-
getQuickLaunchConfigurations
Gets the configured quick launch apps which are visible for the current user.- Parameters:
cms
- the current CMS context- Returns:
- the list of available quick launch apps
-
getUserIconHelper
Returns the user icon helper.- Returns:
- the user icon helper
-
getWorkplaceApps
Returns all available workplace apps.- Returns:
- the available workpllace apps
-
getWorkplaceCssUris
Returns the additional workplace CSS URIs.- Returns:
- the additional workplace CSS URIs
-
initWorkplaceCssUris
Initializes the additional workplace CSS URIs.They will be taken from the module parameter 'workplace-css' if present in any module.
- Parameters:
moduleManager
- the module manager instance
-
loadApps
Loads the workplace apps. -
storeAppSettings
public void storeAppSettings(CmsObject cms, Class<? extends I_CmsAppSettings> type, I_CmsAppSettings appSettings) Stores the given app setting within the users additional info.- Parameters:
cms
- the cms contexttype
- the app setting type, used as the settings keyappSettings
- the settings to store
-
getUserQuickLauchConfigurations
Returns the quick launch apps set for the current user.- Parameters:
cms
- the cms context- Returns:
- the quick launch app configurations
-
setUserQuickLaunchApps
Writes the user quick launch apps setting to the user additional info.- Parameters:
cms
- the cms contextapps
- the app ids- Throws:
Exception
- in case writing the user fails
-