Package org.ametys.web.parameters.view
Class GlobalViewParametersManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.parameters.view.GlobalViewParametersManager
-
- All Implemented Interfaces:
LogEnabled
,Disposable
,Initializable
,Component
,Contextualizable
,Serviceable
public class GlobalViewParametersManager extends AbstractLogEnabled implements Component, Serviceable, Contextualizable, Initializable, Disposable
Manager for global view parameters
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GlobalViewParametersManager.GlobalViewParametersReloader
Class representing a global view parameters reloaderstatic class
GlobalViewParametersManager.ViewParametersType
The view parameters type
-
Field Summary
Fields Modifier and Type Field Description protected Context
_context
The avalon contextprotected FileReloaderUtils
_fileReloaderUtils
The file reloader utilsprotected ServiceManager
_manager
The service managerprotected org.ametys.web.parameters.view.GlobalViewParametersManager.SkinsGlobalViewParameters
_skinsGlobalViewParameters
The object representing the global view parameters by skinprotected ViewAndParametersParser
_viewAndParametersParser
The view and parameters parserprotected ViewParameterTypeExtensionPoint
_viewParametersEP
The view parameter type extension pointstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description GlobalViewParametersManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_addViewParameters(Configuration paramConfiguration, String skinId, GlobalViewParametersManager.ViewParametersType type, String plugin, String catalog)
Add view parameters from the configuration of a given typeprotected Optional<ViewParametersModel>
_configureViewParameters(Configuration paramConfiguration, String viewParametersId, String plugin, String catalog)
Parse global view parameters from the configurationvoid
contextualize(Context context)
void
dispose()
Optional<ViewParametersModel>
getViewParameters(String skinId, GlobalViewParametersManager.ViewParametersType type)
Get global view parameters for one type (template, zone, zone item, service or content)void
initialize()
void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_fileReloaderUtils
protected FileReloaderUtils _fileReloaderUtils
The file reloader utils
-
_viewParametersEP
protected ViewParameterTypeExtensionPoint _viewParametersEP
The view parameter type extension point
-
_viewAndParametersParser
protected ViewAndParametersParser _viewAndParametersParser
The view and parameters parser
-
_manager
protected ServiceManager _manager
The service manager
-
_skinsGlobalViewParameters
protected org.ametys.web.parameters.view.GlobalViewParametersManager.SkinsGlobalViewParameters _skinsGlobalViewParameters
The object representing the global view parameters by skin
-
-
Constructor Detail
-
GlobalViewParametersManager
public GlobalViewParametersManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getViewParameters
public Optional<ViewParametersModel> getViewParameters(String skinId, GlobalViewParametersManager.ViewParametersType type)
Get global view parameters for one type (template, zone, zone item, service or content)- Parameters:
skinId
- the skin idtype
- the type- Returns:
- the view parameters
-
_addViewParameters
protected void _addViewParameters(Configuration paramConfiguration, String skinId, GlobalViewParametersManager.ViewParametersType type, String plugin, String catalog) throws ConfigurationException
Add view parameters from the configuration of a given type- Parameters:
paramConfiguration
- the configurationskinId
- the skin Idtype
- the typeplugin
- the plugincatalog
- the catalog- Throws:
ConfigurationException
- if a configuration error occurred
-
_configureViewParameters
protected Optional<ViewParametersModel> _configureViewParameters(Configuration paramConfiguration, String viewParametersId, String plugin, String catalog) throws ConfigurationException
Parse global view parameters from the configuration- Parameters:
paramConfiguration
- the configurationviewParametersId
- the view parameters idplugin
- the plugincatalog
- the catalog- Returns:
- the view parameters
- Throws:
ConfigurationException
- if a configuration error occurred
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
-