Package org.ametys.core.ui
Class StaticFileImportsClientSideElement
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.StaticFileImportsClientSideElement
- All Implemented Interfaces:
ClientSideElement
,LogEnabled
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
ChooseHierarchicalContentFileImportsClientSideElement
,StaticClientSideElement
,WorkflowStepsClientSideElement
public class StaticFileImportsClientSideElement
extends AbstractLogEnabled
implements ClientSideElement, Configurable, PluginAware, Serviceable
This implementation creates an element from a static configuration
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerThe dependencies, as an associprotected String
The name of the feature that declared the elementprotected String
The element idprotected String
The name of the plugin that declared the elementprotected RightManager
The rights managerThe right configured.protected String
The righs mode to associate rights AND or ORprotected ClientSideElement.Script
The script configured -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_configureDependencies
(Configuration configuration) Configure the dependencies following the configurationprotected List<ClientSideElement.ScriptFile>
_configureImports
(Configuration configuration) Configure the import part_configureRights
(Configuration configuration) Configure the right following the configurationprotected String
_configureRightsMode
(Configuration configuration) Configure the mode to associate rights AND or ORprotected ClientSideElement.Script
_configureScript
(Configuration configuration) Configure the scriptvoid
configure
(Configuration configuration) This method returns the list of dependencies, sorted by extension point.getId()
Get the id of the element.Get the plugin name where the control was declaredThis method return the right that will be needed on client side.getScripts
(boolean ignoreRights, Map<String, Object> contextParameters) This method return the scripts that will be used on client side.final List<ClientSideElement.Script>
getScripts
(Map<String, Object> contextParameters) This method return the scripts that will be used on client side.protected boolean
Determine following the right parameter if the user has right to access this featurevoid
service
(ServiceManager smanager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.toString()
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_currentUserProvider
The current user provider -
_rightManager
The rights manager -
_id
The element id -
_script
The script configured -
_rights
The right configured. Can be null -
_rightsMode
The righs mode to associate rights AND or OR -
_dependencies
The dependencies, as an associ -
_pluginName
The name of the plugin that declared the element -
_featureName
The name of the feature that declared the element
-
-
Constructor Details
-
StaticFileImportsClientSideElement
public StaticFileImportsClientSideElement()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_configureScript
protected ClientSideElement.Script _configureScript(Configuration configuration) throws ConfigurationException Configure the script- Parameters:
configuration
- the global configuration- Returns:
- The script created
- Throws:
ConfigurationException
- The configuration is incorrect
-
_configureImports
protected List<ClientSideElement.ScriptFile> _configureImports(Configuration configuration) throws ConfigurationException Configure the import part- Parameters:
configuration
- The imports configuration- Returns:
- The set of the complete url of imported file
- Throws:
ConfigurationException
- If an error occurs
-
_configureRights
protected Map<String,String> _configureRights(Configuration configuration) throws ConfigurationException Configure the right following the configuration- Parameters:
configuration
- The root configuration- Returns:
- The right name or null.
- Throws:
ConfigurationException
- if a right element is present but empty
-
_configureRightsMode
Configure the mode to associate rights AND or OR- Parameters:
configuration
- The configuration of rights mode.- Returns:
- AND or OR (default value)
- Throws:
ConfigurationException
- The configuration is incorrect
-
_configureDependencies
protected Map<String,List<String>> _configureDependencies(Configuration configuration) throws ConfigurationException Configure the dependencies following the configuration- Parameters:
configuration
- The root configuration- Returns:
- The list of dependencies, by extension point.
- Throws:
ConfigurationException
- if a dependency element is present but empty
-
hasRight
Determine following the right parameter if the user has right to access this feature- Parameters:
rights
- The rights (name, context) to check. Can be empty.- Returns:
- true if the user has the right or if there is not right and false otherwise
-
getScripts
Description copied from interface:ClientSideElement
This method return the scripts that will be used on client side. This class will be parametrized by initial and current parameters.- Specified by:
getScripts
in interfaceClientSideElement
- Parameters:
contextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The list of scripts or an empty list.
-
getScripts
public List<ClientSideElement.Script> getScripts(boolean ignoreRights, Map<String, Object> contextParameters) Description copied from interface:ClientSideElement
This method return the scripts that will be used on client side. This class will be parametrized by initial and current parameters.- Specified by:
getScripts
in interfaceClientSideElement
- 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
Description copied from interface:ClientSideElement
This method return the right that will be needed on client side. This class will be parametrized by initial and current parameters.- Specified by:
getRights
in interfaceClientSideElement
- Parameters:
contextParameters
- Contextuals parameters transmitted by the environment.- Returns:
- The rights in a Map of (rightId, context). Can be empty.
-
getPluginName
Description copied from interface:ClientSideElement
Get the plugin name where the control was declared- Specified by:
getPluginName
in interfaceClientSideElement
- Returns:
- The plugin name. Can not be null.
-
getId
Description copied from interface:ClientSideElement
Get the id of the element.- Specified by:
getId
in interfaceClientSideElement
- Returns:
- the id. Can not be null.
-
getDependencies
Description copied from interface:ClientSideElement
This method returns the list of dependencies, sorted by extension point.- Specified by:
getDependencies
in interfaceClientSideElement
- Returns:
- a map of dependencies ids by extension point.
-
toString
-