Class CronScheduledQueryBasedTemplateActionDefinition
java.lang.Object
org.alfresco.repo.action.scheduled.AbstractScheduledAction
org.alfresco.repo.action.scheduled.CronScheduledQueryBasedTemplateActionDefinition
- All Implemented Interfaces:
ScheduledActionDefinition,org.springframework.beans.factory.InitializingBean
A scheduled action for which the trigger is defined in the standard cron format and the nodes to which the action should be run is defined from the nodes selected by query.
- Author:
- Andy Hind
-
Nested Class Summary
Nested classes/interfaces inherited from class org.alfresco.repo.action.scheduled.AbstractScheduledAction
AbstractScheduledAction.CompensatingActionMode, AbstractScheduledAction.JobDefinition, AbstractScheduledAction.Pair<FIRST,SECOND>, AbstractScheduledAction.TransactionMode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister with the scheduler.Generate the actual action for the given node from the action template.Get the cron expression.Get the job group.Get the job namegetNodes()Get the list of nodes against which this action should run.Get the query language.Get the template from which to build the query.org.quartz.SchedulerGet the scheduler.Get the search service.Get the list of stores.Get the template action model factory.Get the template service.org.quartz.TriggerGet the trigger definition for this job.Get the name of the trigger group.Get the trigger namevoidsetCronExpression(String cronExpression) Set the cron expression - see the wiki for examples.voidsetJobGroup(String jobGroup) Set the job group.voidsetJobName(String jobName) Set the job name.voidsetQueryLanguage(String queryLanguage) Set the query languagevoidsetQueryTemplate(String queryTemplate) Set the template for the query.voidsetScheduler(org.quartz.Scheduler scheduler) Set the scheduler.voidsetSearchService(SearchService searchService) Set the search service.voidSet alist of stores to use.voidsetTemplateActionModelFactory(TemplateActionModelFactory templateActionModelFactory) Set the template action model factory.voidsetTemplateService(TemplateService templateService) Set the template service.voidsetTriggerGroup(String triggerGroup) Set the trigger group.voidsetTriggerName(String triggerName) Set the trigger name.Methods inherited from class org.alfresco.repo.action.scheduled.AbstractScheduledAction
getActionService, getCompensatingActionModeEnum, getRunAsUser, getTemplateActionDefinition, getTransactionModeEnum, getTransactionService, register, setActionService, setCompensatingActionMode, setRunAsUser, setTemplateActionDefinition, setTransactionMode, setTransactionService
-
Constructor Details
-
CronScheduledQueryBasedTemplateActionDefinition
public CronScheduledQueryBasedTemplateActionDefinition()Default constructore
-
-
Method Details
-
getSearchService
Get the search service.- Returns:
- - the serach service.
-
setSearchService
Set the search service.- Parameters:
searchService- SearchService
-
getTemplateService
Get the template service.- Returns:
- - the template service.
-
setTemplateService
Set the template service.- Parameters:
templateService- TemplateService
-
getScheduler
public org.quartz.Scheduler getScheduler()Get the scheduler.- Returns:
- - the scheduler.
-
setScheduler
public void setScheduler(org.quartz.Scheduler scheduler) Set the scheduler.- Parameters:
scheduler- Scheduler
-
getTemplateActionModelFactory
Get the template action model factory.- Returns:
- - the template action model factory.
-
setTemplateActionModelFactory
Set the template action model factory.- Parameters:
templateActionModelFactory- TemplateActionModelFactory
-
getTrigger
public org.quartz.Trigger getTrigger()Description copied from class:AbstractScheduledActionGet the trigger definition for this job. Used to register with the injected scheduler.- Specified by:
getTriggerin classAbstractScheduledAction- Returns:
- - the trigger definition for this scheduled action.
-
getNodes
Description copied from class:AbstractScheduledActionGet the list of nodes against which this action should run.- Specified by:
getNodesin classAbstractScheduledAction- Returns:
- - the list of node refs for which to run this action.
-
getAction
Description copied from class:AbstractScheduledActionGenerate the actual action for the given node from the action template.- Specified by:
getActionin classAbstractScheduledAction- Parameters:
nodeRef- NodeRef- Returns:
- - the action to execute.
-
setQueryLanguage
Set the query language- Parameters:
queryLanguage- String
-
getQueryLanguage
Get the query language.- Returns:
- - the query language.
-
setStores
Set alist of stores to use.- Parameters:
stores- - the list of stores.
-
getStores
Get the list of stores.- Returns:
- - the list of stores.
-
setQueryTemplate
Set the template for the query.- Parameters:
queryTemplate- String
-
getQueryTemplate
Get the template from which to build the query.- Returns:
- - the template for the query.
-
setCronExpression
Set the cron expression - see the wiki for examples.- Parameters:
cronExpression- String
-
getCronExpression
Get the cron expression.- Returns:
- - the cron expression.
-
setJobName
Set the job name.- Parameters:
jobName- String
-
getJobName
Get the job name- Returns:
- - the job name.
-
setJobGroup
Set the job group.- Parameters:
jobGroup- String
-
getJobGroup
Get the job group.- Returns:
- - the job group.
-
setTriggerName
Set the trigger name.- Parameters:
triggerName- String
-
getTriggerName
Get the trigger name- Returns:
- - the trigger name.
-
setTriggerGroup
Set the trigger group.- Parameters:
triggerGroup- String
-
getTriggerGroup
Get the name of the trigger group.- Returns:
- - the trigger group.
-
afterPropertiesSet
Register with the scheduler.- Throws:
Exception
-