public class ContentTypesGallery extends SimpleMenu
Modifier and Type | Class and Description |
---|---|
(package private) class |
ContentTypesGallery.ContentTypeComparator |
(package private) class |
ContentTypesGallery.I18nizableTextComparator |
SimpleMenu.GalleryGroup, SimpleMenu.GalleryItem, SimpleMenu.UnresolvedItem
ClientSideElement.Script, ClientSideElement.ScriptFile
Modifier and Type | Field and Description |
---|---|
private Set<String> |
_addedComponents |
protected ContentTypeExtensionPoint |
_contentTypeExtensionPoint
The list of content types
|
private boolean |
_contentTypesInitialized |
protected I18nUtils |
_i18nUtils
The i18n utils
|
protected LanguagesManager |
_languagesManager
The language manager
|
protected RootContentHelper |
_rootContentHelper
Helper for root content
|
_galleryItemManager, _galleryItems, _menuItemManager, _menuItems, _primaryMenuItem, _referencedClientSideElement, _ribbonControlManager, _smanager, _unresolvedMenuItems
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script
Constructor and Description |
---|
ContentTypesGallery() |
Modifier and Type | Method and Description |
---|---|
protected void |
_addContentTypeConfiguration(DefaultConfiguration rootConf,
ContentType cType)
Get the configuration of the content type item
|
protected void |
_addGroupContentTypeConfiguration(DefaultConfiguration rootConf,
I18nizableText groupLabel,
Set<ContentType> cTypes)
Get the configuration of the content type item
|
protected void |
_addRightsOnContentTypeConfiguration(DefaultConfiguration rootConf)
Get the 'rights' configuration of the content type item
|
protected ClientSideElement.Script |
_configureScript(Configuration configuration)
Configure the script
|
protected Map<I18nizableText,Set<ContentType>> |
_getContentTypesByGroup()
Get the list of content types classified by groups
|
protected void |
_getGalleryItems(Map<String,Object> parameters,
Map<String,Object> contextualParameters)
Get the gallery items
|
private void |
_lazyInitializeContentTypeGallery() |
private void |
_lazyInitializeContentTypeMenu() |
private boolean |
_showInMenu() |
protected void |
addContentType(ContentType contentType,
Map<I18nizableText,Set<ContentType>> groups)
Add content to groups
|
List<ClientSideElement.Script> |
getScripts(boolean ignoreRights,
Map<String,Object> contextParameters)
This method return the scripts that will be used on client side.
|
protected boolean |
hasRight(ContentType cType)
Test if the current user has the right needed by the content type to create a content.
|
protected boolean |
isValidContentType(ContentType contentType)
Determines if the content type is a valid content type for the gallery
|
void |
service(ServiceManager smanager) |
_addDependencies, _configureClass, _configureGalleries, _configureGroupGallery, _configureItemsMenu, _getMenuItems, configure, getReferencedClientSideElements, getRights
_configureParameters, configureInitialParameters
_configureDependencies, _configureImports, _configureRights, _configureRightsMode, getDependencies, getId, getPluginName, getScripts, hasRight, setPluginInfo, toString
getLogger, setLogger
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
protected LanguagesManager _languagesManager
protected I18nUtils _i18nUtils
protected RootContentHelper _rootContentHelper
private boolean _contentTypesInitialized
private Set<String> _addedComponents
public ContentTypesGallery()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class SimpleMenu
ServiceException
protected ClientSideElement.Script _configureScript(Configuration configuration) throws ConfigurationException
StaticFileImportsClientSideElement
_configureScript
in class StaticClientSideElement
configuration
- the global configurationConfigurationException
- The configuration is incorrectprotected void _getGalleryItems(Map<String,Object> parameters, Map<String,Object> contextualParameters)
SimpleMenu
_getGalleryItems
in class SimpleMenu
parameters
- Contextual the parameters given to the control script class.contextualParameters
- Contextual parameters transmitted by the environment.private boolean _showInMenu()
private void _lazyInitializeContentTypeGallery() throws ConfigurationException
ConfigurationException
private void _lazyInitializeContentTypeMenu()
protected void _addGroupContentTypeConfiguration(DefaultConfiguration rootConf, I18nizableText groupLabel, Set<ContentType> cTypes)
rootConf
- The root configurationgroupLabel
- The group's labelcTypes
- The content types of the groupprotected void _addContentTypeConfiguration(DefaultConfiguration rootConf, ContentType cType)
rootConf
- The root configurationcType
- The content typeprotected void _addRightsOnContentTypeConfiguration(DefaultConfiguration rootConf)
rootConf
- The root configurationprotected Map<I18nizableText,Set<ContentType>> _getContentTypesByGroup()
protected void addContentType(ContentType contentType, Map<I18nizableText,Set<ContentType>> groups)
contentType
- The content typegroups
- The groupspublic List<ClientSideElement.Script> getScripts(boolean ignoreRights, Map<String,Object> contextParameters)
ClientSideElement
getScripts
in interface ClientSideElement
getScripts
in class SimpleMenu
ignoreRights
- True to ignore the rights verification.contextParameters
- Contextuals parameters transmitted by the environment.protected boolean isValidContentType(ContentType contentType)
contentType
- The coententprotected boolean hasRight(ContentType cType)
cType
- the content type