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:
AbstractStaticODFTreeIndicator,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
FieldsModifier and TypeFieldDescriptionprotected CurrentUserProviderThe current user providerThe dependencies, as an associprotected StringThe name of the feature that declared the elementprotected StringThe element idprotected StringThe name of the plugin that declared the elementprotected RightManagerThe rights managerThe right configured.protected StringThe righs mode to associate rights AND or ORprotected ClientSideElement.ScriptThe script configured -
Constructor Summary
Constructors -
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 scriptvoidconfigure(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 booleanDetermine following the right parameter if the user has right to access this featurevoidservice(ServiceManager smanager) voidsetPluginInfo(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:
servicein interfaceServiceable- Throws:
ServiceException
-
setPluginInfo
Description copied from interface:PluginAwareSets 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:
setPluginInfoin 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:
configurein 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: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- 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: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- 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: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- 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:ClientSideElementGet the plugin name where the control was declared- Specified by:
getPluginNamein interfaceClientSideElement- Returns:
- The plugin name. Can not be null.
-
getId
Description copied from interface:ClientSideElementGet the id of the element.- Specified by:
getIdin interfaceClientSideElement- Returns:
- the id. Can not be null.
-
getDependencies
Description copied from interface:ClientSideElementThis method returns the list of dependencies, sorted by extension point.- Specified by:
getDependenciesin interfaceClientSideElement- Returns:
- a map of dependencies ids by extension point.
-
toString
-