Package org.opencms.ui.apps
Class A_CmsWorkplaceApp
- java.lang.Object
-
- org.opencms.ui.apps.A_CmsWorkplaceApp
-
- All Implemented Interfaces:
I_CmsWorkplaceApp
- Direct Known Subclasses:
A_CmsAttributeAwareApp
,CmsAccountsApp
,CmsCacheAdminApp
,CmsCacheViewApp
,CmsDbExportApp
,CmsDbPropertiesApp
,CmsFileHistoryApp
,CmsJobManagerApp
,CmsLinkInFolderValidationApp
,CmsLinkValidationApp
,CmsLinkValidationExternalApp
,CmsListManager
,CmsLogFileApp
,CmsProjectManager
,CmsPublishQueue
,CmsQuickLaunchEditorConfiguration.QuickLaunchEditorApp
,CmsResourceTypeApp
,CmsSearchindexApp
,CmsSessionsApp
,CmsShellApp
,CmsSiteManager
,CmsSourceSearchApp
,CmsSqlConsoleApp
,CmsUserDataApp
public abstract class A_CmsWorkplaceApp extends java.lang.Object implements I_CmsWorkplaceApp
Super class for workplace apps to help implementing the app navigation and layout.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
A_CmsWorkplaceApp.NavEntry
An app navigation entry.
-
Field Summary
Fields Modifier and Type Field Description protected com.vaadin.ui.HorizontalLayout
m_infoLayout
The app info layout containing the bread crumb navigation as first component.protected CmsToolLayout
m_rootLayout
The root layout.protected I_CmsAppUIContext
m_uiContext
The app UI context.static java.lang.String
PARAM_ASSIGN
State parameter value separator.static java.lang.String
PARAM_SEPARATOR
State parameter separator.
-
Constructor Summary
Constructors Modifier Constructor Description protected
A_CmsWorkplaceApp()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static java.lang.String
addParamToState(java.lang.String state, java.lang.String paramName, java.lang.String value)
Adds a parameter value to the given state.protected void
addSubNavEntry(A_CmsWorkplaceApp.NavEntry navEntry)
Adds a navigation entry.protected abstract java.util.LinkedHashMap<java.lang.String,java.lang.String>
getBreadCrumbForState(java.lang.String state)
Returns the current bread crumb entries in an ordered map.protected abstract com.vaadin.ui.Component
getComponentForState(java.lang.String state)
Returns the app component for the given state.protected java.lang.String
getLastPathLevel(java.lang.String path)
Returns the last path level.CmsObject
getOfflineCmsObject(CmsObject cms)
Gets an offline version of the cms object.static java.lang.String
getParamFromState(java.lang.String state, java.lang.String paramName)
Parses the requested parameter from the given state.static java.util.Map<java.lang.String,java.lang.String>
getParamsFromState(java.lang.String state)
Returns the parameters contained in the state string.protected abstract java.util.List<A_CmsWorkplaceApp.NavEntry>
getSubNavEntries(java.lang.String state)
Returns the sub navigation entries.void
initUI(I_CmsAppUIContext context)
Within this method the app UI should be initialized.void
onStateChange(java.lang.String state)
Called on navigation events.void
openSubView(java.lang.String state, boolean updateState)
Opens the requested sub view.static java.lang.String
removeParamsFromState(java.lang.String state)
Removes all parameter from given state.protected void
setBreadCrumbEntries(java.util.LinkedHashMap<java.lang.String,java.lang.String> entries)
Method to set bread crumb entries.protected void
updateBreadCrumb(java.util.Map<java.lang.String,java.lang.String> breadCrumbEntries)
Updates the bread crumb navigation.protected void
updateSubNav(java.util.List<A_CmsWorkplaceApp.NavEntry> subEntries)
Updates the sub navigation with the given entries.
-
-
-
Field Detail
-
PARAM_ASSIGN
public static final java.lang.String PARAM_ASSIGN
State parameter value separator.- See Also:
- Constant Field Values
-
PARAM_SEPARATOR
public static final java.lang.String PARAM_SEPARATOR
State parameter separator.- See Also:
- Constant Field Values
-
m_infoLayout
protected com.vaadin.ui.HorizontalLayout m_infoLayout
The app info layout containing the bread crumb navigation as first component.
-
m_rootLayout
protected CmsToolLayout m_rootLayout
The root layout.
-
m_uiContext
protected I_CmsAppUIContext m_uiContext
The app UI context.
-
-
Constructor Detail
-
A_CmsWorkplaceApp
protected A_CmsWorkplaceApp()
Constructor.
-
-
Method Detail
-
addParamToState
public static java.lang.String addParamToState(java.lang.String state, java.lang.String paramName, java.lang.String value)
Adds a parameter value to the given state.- Parameters:
state
- the stateparamName
- the parameter namevalue
- the parameter value- Returns:
- the state
-
getParamFromState
public static java.lang.String getParamFromState(java.lang.String state, java.lang.String paramName)
Parses the requested parameter from the given state.- Parameters:
state
- the stateparamName
- the parameter name- Returns:
- the parameter value
-
getParamsFromState
public static java.util.Map<java.lang.String,java.lang.String> getParamsFromState(java.lang.String state)
Returns the parameters contained in the state string.- Parameters:
state
- the state- Returns:
- the parameters
-
removeParamsFromState
public static java.lang.String removeParamsFromState(java.lang.String state)
Removes all parameter from given state.- Parameters:
state
- state to be cleaned from parameter- Returns:
- given state without parameter
-
getOfflineCmsObject
public CmsObject getOfflineCmsObject(CmsObject cms)
Gets an offline version of the cms object.- Parameters:
cms
- initial CmsObject- Returns:
- CmsObject adjusted to offline project (cloned)
-
initUI
public void initUI(I_CmsAppUIContext context)
Description copied from interface:I_CmsWorkplaceApp
Within this method the app UI should be initialized.Use the context to add the app's components to the UI.
- Specified by:
initUI
in interfaceI_CmsWorkplaceApp
- Parameters:
context
- the UI context- See Also:
I_CmsWorkplaceApp.initUI(org.opencms.ui.apps.I_CmsAppUIContext)
-
onStateChange
public void onStateChange(java.lang.String state)
Description copied from interface:I_CmsWorkplaceApp
Called on navigation events.- Specified by:
onStateChange
in interfaceI_CmsWorkplaceApp
- Parameters:
state
- the app state to show- See Also:
I_CmsWorkplaceApp.onStateChange(java.lang.String)
-
openSubView
public void openSubView(java.lang.String state, boolean updateState)
Opens the requested sub view.- Parameters:
state
- the stateupdateState
-true
to update the state URL token
-
addSubNavEntry
protected void addSubNavEntry(A_CmsWorkplaceApp.NavEntry navEntry)
Adds a navigation entry.- Parameters:
navEntry
- the navigation entry
-
getBreadCrumbForState
protected abstract java.util.LinkedHashMap<java.lang.String,java.lang.String> getBreadCrumbForState(java.lang.String state)
Returns the current bread crumb entries in an ordered map.- Parameters:
state
- the current state- Returns:
- bread crumb entry name by state, in case the state is empty, the entry will be disabled
-
getComponentForState
protected abstract com.vaadin.ui.Component getComponentForState(java.lang.String state)
Returns the app component for the given state.- Parameters:
state
- the state to render- Returns:
- the app component
-
getLastPathLevel
protected java.lang.String getLastPathLevel(java.lang.String path)
Returns the last path level.- Parameters:
path
- the path- Returns:
- the last path level
-
getSubNavEntries
protected abstract java.util.List<A_CmsWorkplaceApp.NavEntry> getSubNavEntries(java.lang.String state)
Returns the sub navigation entries.- Parameters:
state
- the state- Returns:
- the sub navigation entries
-
setBreadCrumbEntries
protected void setBreadCrumbEntries(java.util.LinkedHashMap<java.lang.String,java.lang.String> entries)
Method to set bread crumb entries.- Parameters:
entries
- to be set
-
updateBreadCrumb
protected void updateBreadCrumb(java.util.Map<java.lang.String,java.lang.String> breadCrumbEntries)
Updates the bread crumb navigation.- Parameters:
breadCrumbEntries
- the bread crumb entries
-
updateSubNav
protected void updateSubNav(java.util.List<A_CmsWorkplaceApp.NavEntry> subEntries)
Updates the sub navigation with the given entries.- Parameters:
subEntries
- the sub navigation entries
-
-