Package org.ametys.core.ui
Class AddTaskClientSideElement
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.ui.StaticFileImportsClientSideElement
org.ametys.core.ui.StaticClientSideElement
org.ametys.core.ui.AddTaskClientSideElement
- All Implemented Interfaces:
ClientSideElement,LogEnabled,PluginAware,Configurable,Contextualizable,Serviceable
- Direct Known Subclasses:
AddReportTaskClientSideElement,ApogeeGlobalSynchronizationClientSideElement,ExportClientSiteElement,GlobalSynchronizationClientSideElement,SelectionAwareAddTaskClientSideElement
This implementation creates an element for adding a new task
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.core.ui.ClientSideElement
ClientSideElement.Script, ClientSideElement.ScriptFile -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextThe Avalon contextprotected SchedulerThe Ametys schedulerFields inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_currentUserProvider, _dependencies, _featureName, _id, _pluginName, _rightManager, _rights, _rightsMode, _script -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String_configureClass(Configuration configuration) Configure the js class name_configureDependencies(Configuration configuration) Configure the dependencies following the configurationprotected ClientSideElement.Script_configureScript(Configuration configuration) Configure the scriptadd(String label, String description, String fireProcess, String cron, String schedulableId, Map<String, Object> params) Schedule a taskconfigureInitialParameters(Configuration configuration) Configure the initial parametersvoidcontextualize(Context context) This method returns the list of dependencies, sorted by extension point.getParameters(String schedulableId) Get the schedulable parametersvoidservice(ServiceManager smanager) Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureParametersMethods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureImports, _configureRights, _configureRightsMode, configure, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toStringMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
_context
The Avalon context -
_scheduler
The Ametys scheduler
-
-
Constructor Details
-
AddTaskClientSideElement
public AddTaskClientSideElement()
-
-
Method Details
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classStaticFileImportsClientSideElement- Throws:
ServiceException
-
_configureClass
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
-
configureInitialParameters
protected Map<String,Object> configureInitialParameters(Configuration configuration) throws ConfigurationException Description copied from class:StaticClientSideElementConfigure the initial parameters- Overrides:
configureInitialParametersin classStaticClientSideElement- Parameters:
configuration- the global configuration- Returns:
- The initial parameters read
- Throws:
ConfigurationException- The configuration is incorrect
-
_configureScript
protected ClientSideElement.Script _configureScript(Configuration configuration) throws ConfigurationException Description copied from class:StaticFileImportsClientSideElementConfigure the script- Overrides:
_configureScriptin classStaticClientSideElement- Parameters:
configuration- the global configuration- Returns:
- The script created
- Throws:
ConfigurationException- The configuration is incorrect
-
_configureDependencies
protected Map<String,List<String>> _configureDependencies(Configuration configuration) throws ConfigurationException Description copied from class:StaticFileImportsClientSideElementConfigure the dependencies following the configuration- Overrides:
_configureDependenciesin classStaticFileImportsClientSideElement- Parameters:
configuration- The root configuration- Returns:
- The list of dependencies, by extension point.
- Throws:
ConfigurationException- if a dependency element is present but empty
-
getDependencies
Description copied from interface:ClientSideElementThis method returns the list of dependencies, sorted by extension point.- Specified by:
getDependenciesin interfaceClientSideElement- Overrides:
getDependenciesin classStaticFileImportsClientSideElement- Returns:
- a map of dependencies ids by extension point.
-
add
public Map<String,Object> add(String label, String description, String fireProcess, String cron, String schedulableId, Map<String, Object> params) throws SchedulerExceptionSchedule a task- Parameters:
label- the task labeldescription- the task descriptionfireProcess- the fire processcron- the cronschedulableId- the id of the schedulableparams- the schedulable parameters- Returns:
- a json
- Throws:
SchedulerException- if an error occurs when scheduling the task
-
getParameters
Get the schedulable parameters- Parameters:
schedulableId- the id of the schedulable- Returns:
- the parameters as json
- Throws:
Exception- if an error occurs
-