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 Context
The Avalon contextprotected Scheduler
The 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 parametersvoid
contextualize
(Context context) This method returns the list of dependencies, sorted by extension point.getParameters
(String schedulableId) Get the schedulable parametersvoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.core.ui.StaticClientSideElement
_configureParameters
Methods inherited from class org.ametys.core.ui.StaticFileImportsClientSideElement
_configureImports, _configureRights, _configureRightsMode, configure, getId, getPluginName, getRights, getScripts, getScripts, hasRight, setPluginInfo, toString
Methods 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:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classStaticFileImportsClientSideElement
- Throws:
ServiceException
-
_configureClass
Description copied from class:StaticClientSideElement
Configure the js class name- Overrides:
_configureClass
in 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:StaticClientSideElement
Configure the initial parameters- Overrides:
configureInitialParameters
in 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:StaticFileImportsClientSideElement
Configure the script- Overrides:
_configureScript
in 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:StaticFileImportsClientSideElement
Configure the dependencies following the configuration- Overrides:
_configureDependencies
in 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:ClientSideElement
This method returns the list of dependencies, sorted by extension point.- Specified by:
getDependencies
in interfaceClientSideElement
- Overrides:
getDependencies
in 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
-