Package org.ametys.core.ui
Class SimpleMenu
-
- All Implemented Interfaces:
ClientSideElement,MenuClientSideElement,LogEnabled,PluginAware,Configurable,Serviceable
- Direct Known Subclasses:
AbstractEditorStyleMenu,AbstractPageMenu,ApogeeSimpleMenu,ContentPrivacyMenu,ContentTypesGallery,ContentTypesMenuItem,DesignsMenu,DevModeClientSideElement,FormEditionModeMenu,FormsContentClientSideElement,ImportModelClientSideElement,ImportSkinClientSideElement,LanguageMenu,ModelsMenu,ODFPilotageSimpleMenuClientSideElement,SetContentViewMenu,ShareableCourseMenuItemClientSideElement,SkinLanguageMenu,TemplatesMenu,ThemeColorsMenu,ThesaurusGallery
public class SimpleMenu extends StaticClientSideElement implements MenuClientSideElement
This element creates a control button with a menu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSimpleMenu.GalleryGroupClass representing a gallery groupclassSimpleMenu.GalleryItemClass representing a gallery itemprotected classSimpleMenu.UnresolvedItemThe unresolved item-
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
-
Field Summary
Fields Modifier and Type Field Description protected List<SimpleMenu.GalleryItem>_galleryItemsThe gallery itemsprotected ThreadSafeComponentManager<ClientSideElement>_menuItemManagerThe client side element component manager for menu items.protected List<ClientSideElement>_menuItemsThe menu itemsprotected ClientSideElement_primaryMenuItemThe primary menu itemprotected RibbonControlsManager_ribbonControlManagerThe ribbon control managerprotected ServiceManager_smanagerThe service managerprotected List<SimpleMenu.UnresolvedItem>_unresolvedMenuItemsThe unresolved menu items-
Fields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
-
-
Constructor Summary
Constructors Constructor Description SimpleMenu()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_addDependencies(Map<String,List<String>> additionalDependencies)Add additional dependencies to the Menu, such as dependencies inherited from its menu items or gallery items.protected String_configureClass(Configuration configuration)Configure the js class nameprotected void_configureGalleries(Configuration configuration)Configure the galleriesprotected SimpleMenu.GalleryGroup_configureGroupGallery(Configuration configuration)Configure a group galleryprotected void_configureItemsMenu(Configuration configuration)Configure the items menuprotected ThreadSafeComponentManager<ClientSideElement>_getGalleryItemManager()Get the gallery item managerprotected List<SimpleMenu.GalleryItem>_getGalleryItems()Get the gallery itemsprotected void_getGalleryItems(Map<String,Object> parameters, Map<String,Object> contextualParameters)Get the gallery itemsprotected void_getMenuItems(Map<String,Object> parameters, Map<String,Object> contextualParameters)Get the menu itemsvoidconfigure(Configuration configuration)List<ClientSideElement>getReferencedClientSideElements(Map<String,Object> contextParameters)This method returns theClientSideElementreferenced by the menu through its menu or gallery itemsMap<String,String>getRights(Map<String,Object> contextParameters)This method return the right that will be needed on client side.List<ClientSideElement.Script>getScripts(boolean ignoreRights, Map<String,Object> contextParameters)This method return the scripts that will be used on client side.voidservice(ServiceManager smanager)-
Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureParameters, _configureScript, configureInitialParameters
-
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, getDependencies, getId, getPluginName, getScripts, hasRight, setPluginInfo, toString
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_menuItemManager
protected ThreadSafeComponentManager<ClientSideElement> _menuItemManager
The client side element component manager for menu items.
-
_ribbonControlManager
protected RibbonControlsManager _ribbonControlManager
The ribbon control manager
-
_smanager
protected ServiceManager _smanager
The service manager
-
_menuItems
protected List<ClientSideElement> _menuItems
The menu items
-
_galleryItems
protected List<SimpleMenu.GalleryItem> _galleryItems
The gallery items
-
_primaryMenuItem
protected ClientSideElement _primaryMenuItem
The primary menu item
-
_unresolvedMenuItems
protected List<SimpleMenu.UnresolvedItem> _unresolvedMenuItems
The unresolved menu items
-
-
Constructor Detail
-
SimpleMenu
public SimpleMenu()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classStaticFileImportsClientSideElement- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classStaticFileImportsClientSideElement- Throws:
ConfigurationException
-
_configureClass
protected String _configureClass(Configuration configuration) throws ConfigurationException
Description copied from class:StaticClientSideElementConfigure the js class name- Overrides:
_configureClassin classStaticClientSideElement- Parameters:
configuration- The configuration on action tag- Returns:
- The js class name
- Throws:
ConfigurationException- If an error occurs
-
_getGalleryItemManager
protected ThreadSafeComponentManager<ClientSideElement> _getGalleryItemManager()
Get the gallery item manager- Returns:
- the gallery item manager
-
_getGalleryItems
protected List<SimpleMenu.GalleryItem> _getGalleryItems()
Get the gallery items- Returns:
- the gallery items
-
getScripts
public List<ClientSideElement.Script> getScripts(boolean ignoreRights, Map<String,Object> contextParameters)
Description copied from interface:ClientSideElementThis method return the scripts that will be used on client side. This class will be parametrized by initial and current parameters.- Specified by:
getScriptsin interfaceClientSideElement- Overrides:
getScriptsin classStaticFileImportsClientSideElement- Parameters:
ignoreRights- True to ignore the rights verification.contextParameters- Contextuals parameters transmitted by the environment.- Returns:
- The list of scripts or an empty list.
-
getRights
public Map<String,String> getRights(Map<String,Object> contextParameters)
Description copied from interface:ClientSideElementThis method return the right that will be needed on client side. This class will be parametrized by initial and current parameters.- Specified by:
getRightsin interfaceClientSideElement- Overrides:
getRightsin classStaticFileImportsClientSideElement- Parameters:
contextParameters- Contextuals parameters transmitted by the environment.- Returns:
- The rights in a Map of (rightId, context). Can be empty.
-
_getGalleryItems
protected void _getGalleryItems(Map<String,Object> parameters, Map<String,Object> contextualParameters)
Get the gallery items- Parameters:
parameters- Contextual the parameters given to the control script class.contextualParameters- Contextual parameters transmitted by the environment.
-
_getMenuItems
protected void _getMenuItems(Map<String,Object> parameters, Map<String,Object> contextualParameters)
Get the menu items- Parameters:
parameters- Contextual the parameters given to the control script class.contextualParameters- Contextual parameters transmitted by the environment.
-
getReferencedClientSideElements
public List<ClientSideElement> getReferencedClientSideElements(Map<String,Object> contextParameters)
Description copied from interface:MenuClientSideElementThis method returns theClientSideElementreferenced by the menu through its menu or gallery items- Specified by:
getReferencedClientSideElementsin interfaceMenuClientSideElement- Parameters:
contextParameters- Contextuals parameters transmitted by the environment.- Returns:
- the referenced client side elements.
-
_configureGalleries
protected void _configureGalleries(Configuration configuration) throws ConfigurationException
Configure the galleries- Parameters:
configuration- the configuration- Throws:
ConfigurationException- If the configuration has an issue
-
_configureGroupGallery
protected SimpleMenu.GalleryGroup _configureGroupGallery(Configuration configuration) throws ConfigurationException
Configure a group gallery- Parameters:
configuration- the configuration- Returns:
- The configured group gallery
- Throws:
ConfigurationException- If the configuration has an issue
-
_configureItemsMenu
protected void _configureItemsMenu(Configuration configuration) throws ConfigurationException
Configure the items menu- Parameters:
configuration- the configuration- Throws:
ConfigurationException- If the configuration has an issue
-
_addDependencies
protected void _addDependencies(Map<String,List<String>> additionalDependencies) throws ConfigurationException
Add additional dependencies to the Menu, such as dependencies inherited from its menu items or gallery items.- Parameters:
additionalDependencies- The dependencies to add- Throws:
ConfigurationException- If an error occurs
-
-