Package org.opencms.ui.apps.modules
Class CmsModuleApp
- java.lang.Object
-
- org.opencms.ui.apps.A_CmsWorkplaceApp
-
- org.opencms.ui.apps.A_CmsAttributeAwareApp
-
- org.opencms.ui.apps.modules.CmsModuleApp
-
- All Implemented Interfaces:
java.io.Serializable
,I_CmsCachableApp
,I_CmsWorkplaceApp
public class CmsModuleApp extends A_CmsAttributeAwareApp implements I_CmsCachableApp
Main module manager app class.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsModuleApp.Attributes
Additional app attributes for the module manager.static class
CmsModuleApp.Icons
Contains the icon constants for the module manager.static class
CmsModuleApp.States
Contains the different navigation states for the module maanger.-
Nested classes/interfaces inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
A_CmsWorkplaceApp.NavEntry
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PARAM_MODULE
The 'module' parameter.-
Fields inherited from class org.opencms.ui.apps.A_CmsAttributeAwareApp
ATTR_INFO_COMPONENT, ATTR_MAIN_HEIGHT_FULL
-
Fields inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
m_infoLayout, m_rootLayout, m_uiContext, PARAM_ASSIGN, PARAM_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description CmsModuleApp()
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
editModule(java.lang.String moduleName)
Opens the edit dialog for the given module.static void
editModule(CmsModule module, boolean isNew, java.lang.String caption, java.lang.Runnable callback)
Opens the module editor for the given module.void
editNewModule(java.lang.Runnable callback)
Opens module edit dialog for a new module.protected 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 com.vaadin.ui.Component
getComponentForState(java.lang.String state)
Returns the app component for the given state.java.util.List<I_CmsSimpleContextMenuEntry<java.util.Set<java.lang.String>>>
getMenuEntries()
Returns the available menu entries.protected com.vaadin.ui.Component
getModuleTable()
Gets the module table.protected java.lang.String
getReportLabel(java.lang.String state)
Gets the label for a given report.protected 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.boolean
isCachable()
Returns whether this app should be cached within the user session.void
onRestoreFromCache()
Called after the view is fetched from the cache.void
onStateChange(java.lang.String state)
Called on navigation events.void
openModuleInfo(java.util.Set<java.lang.String> name)
Opens the module info dialog.void
openReport(java.lang.String newState, A_CmsReportThread thread, java.lang.String label)
Changes to a new sub-view and stores a report to be displayed by that subview.protected void
reload()
Reloads the table.void
setReport(java.lang.String key, A_CmsReportThread report)
Stores a report thread isntance under a given key.protected void
updateAppAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Handles the attributes.static CmsMenuItemVisibilityMode
visibilityCheckHasModule(java.lang.String name)
Returns VISIBILITY_ACTIVE if a module with the given name exists, and VISIBILITY_INVISIBLE otherwise.-
Methods inherited from class org.opencms.ui.apps.A_CmsAttributeAwareApp
getAttributesForComponent, openSubView, updateMainComponent
-
Methods inherited from class org.opencms.ui.apps.A_CmsWorkplaceApp
addParamToState, addSubNavEntry, getLastPathLevel, getOfflineCmsObject, getParamFromState, getParamsFromState, removeParamsFromState, setBreadCrumbEntries, updateBreadCrumb, updateSubNav
-
-
-
-
Field Detail
-
PARAM_MODULE
public static final java.lang.String PARAM_MODULE
The 'module' parameter.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsModuleApp
public CmsModuleApp()
Creates a new instance.
-
-
Method Detail
-
editModule
public static void editModule(CmsModule module, boolean isNew, java.lang.String caption, java.lang.Runnable callback)
Opens the module editor for the given module.- Parameters:
module
- the edited moduleisNew
- true if this is a new modulecaption
- the caption for the module editor dialogcallback
- the callback to call after the edit dialog is done
-
visibilityCheckHasModule
public static CmsMenuItemVisibilityMode visibilityCheckHasModule(java.lang.String name)
Returns VISIBILITY_ACTIVE if a module with the given name exists, and VISIBILITY_INVISIBLE otherwise.- Parameters:
name
- a module name- Returns:
- the visibility
-
editModule
public void editModule(java.lang.String moduleName)
Opens the edit dialog for the given module.- Parameters:
moduleName
- the name of the module
-
editNewModule
public void editNewModule(java.lang.Runnable callback)
Opens module edit dialog for a new module.- Parameters:
callback
- the callback to call after finishing
-
getMenuEntries
public java.util.List<I_CmsSimpleContextMenuEntry<java.util.Set<java.lang.String>>> getMenuEntries()
Returns the available menu entries.- Returns:
- the menu entries
-
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
- Overrides:
initUI
in classA_CmsWorkplaceApp
- Parameters:
context
- the UI context- See Also:
A_CmsWorkplaceApp.initUI(org.opencms.ui.apps.I_CmsAppUIContext)
-
isCachable
public boolean isCachable()
Description copied from interface:I_CmsCachableApp
Returns whether this app should be cached within the user session.- Specified by:
isCachable
in interfaceI_CmsCachableApp
- Returns:
true
if the app is cachable- See Also:
I_CmsCachableApp.isCachable()
-
onRestoreFromCache
public void onRestoreFromCache()
Description copied from interface:I_CmsCachableApp
Called after the view is fetched from the cache.- Specified by:
onRestoreFromCache
in interfaceI_CmsCachableApp
- See Also:
I_CmsCachableApp.onRestoreFromCache()
-
onStateChange
public void onStateChange(java.lang.String state)
Description copied from interface:I_CmsWorkplaceApp
Called on navigation events.- Specified by:
onStateChange
in interfaceI_CmsWorkplaceApp
- Overrides:
onStateChange
in classA_CmsWorkplaceApp
- Parameters:
state
- the app state to show- See Also:
A_CmsWorkplaceApp.onStateChange(java.lang.String)
-
openModuleInfo
public void openModuleInfo(java.util.Set<java.lang.String> name)
Opens the module info dialog.- Parameters:
name
- the name of the module
-
openReport
public void openReport(java.lang.String newState, A_CmsReportThread thread, java.lang.String label)
Changes to a new sub-view and stores a report to be displayed by that subview.- Parameters:
newState
- the new statethread
- the report thread which should be displayed in the sub viewlabel
- the label to display for the report
-
setReport
public void setReport(java.lang.String key, A_CmsReportThread report)
Stores a report thread isntance under a given key.- Parameters:
key
- the keyreport
- the report thread instance
-
getBreadCrumbForState
protected java.util.LinkedHashMap<java.lang.String,java.lang.String> getBreadCrumbForState(java.lang.String state)
Description copied from class:A_CmsWorkplaceApp
Returns the current bread crumb entries in an ordered map.- Specified by:
getBreadCrumbForState
in classA_CmsWorkplaceApp
- Parameters:
state
- the current state- Returns:
- bread crumb entry name by state, in case the state is empty, the entry will be disabled
- See Also:
A_CmsWorkplaceApp.getBreadCrumbForState(java.lang.String)
-
getComponentForState
protected com.vaadin.ui.Component getComponentForState(java.lang.String state)
Description copied from class:A_CmsWorkplaceApp
Returns the app component for the given state.- Specified by:
getComponentForState
in classA_CmsWorkplaceApp
- Parameters:
state
- the state to render- Returns:
- the app component
- See Also:
A_CmsWorkplaceApp.getComponentForState(java.lang.String)
-
getModuleTable
protected com.vaadin.ui.Component getModuleTable()
Gets the module table.- Returns:
- the module table
-
getReportLabel
protected java.lang.String getReportLabel(java.lang.String state)
Gets the label for a given report.- Parameters:
state
- the state for which to get the label- Returns:
- the label
-
getSubNavEntries
protected java.util.List<A_CmsWorkplaceApp.NavEntry> getSubNavEntries(java.lang.String state)
Description copied from class:A_CmsWorkplaceApp
Returns the sub navigation entries.- Specified by:
getSubNavEntries
in classA_CmsWorkplaceApp
- Parameters:
state
- the state- Returns:
- the sub navigation entries
- See Also:
A_CmsWorkplaceApp.getSubNavEntries(java.lang.String)
-
reload
protected void reload()
Reloads the table.
-
updateAppAttributes
protected void updateAppAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
Description copied from class:A_CmsAttributeAwareApp
Handles the attributes.- Overrides:
updateAppAttributes
in classA_CmsAttributeAwareApp
- Parameters:
attributes
- to set- See Also:
A_CmsAttributeAwareApp.updateAppAttributes(java.util.Map)
-
-