Custom Scheduled Job on the Alfresco Admin Page

cancel
Showing results for 
Search instead for 
Did you mean: 
pedwards99
Partner

Custom Scheduled Job on the Alfresco Admin Page

Hi All,

Does anyone out there know how to get a custom scheduled job to appear on the Admin Console?

I've followed the instructions in the documentation (Scheduled Jobs | Alfresco Documentation ) to implement my new job and its all working as expected.

I was hoping that it would just appear on the admin console with all the other jobs (i.e. http://server:8080/alfresco/s/enterprise/admin/admin-scheduledjobs) but apparently this is not the case.

Any ideas?

Thanks

Paul

4 Replies
afaust
Master

Re: Custom Scheduled Job on the Alfresco Admin Page

You need to register the job similarly to the default jobs, with the default scheduler factory bean ("schedulerFactory") of Alfresco instead of a custom one (which I see people in the community do from time to time). I'm a bit surprised about the documentation though, since that deviates from what I have been doing all these years and which was working fine. You can take a look at one of my projects for an example.

pedwards99
Partner

Re: Custom Scheduled Job on the Alfresco Admin Page

Thanks Axel, I'll give that a go

Paul

iso9999
Member II

Re: Custom Scheduled Job on the Alfresco Admin Page

I saw your code, but I didn't understand where should I exactly define in the bean definition ?

 

this is my code :

	<bean id="bean.com.Job.actions.ScheduledJobExecuter" class="com.Job.actions.ScheduledJobExecuter">
		<property name="serviceRegistry" ref="ServiceRegistry" />
		<property name="nodeService" ref="NodeService" />
		<property name="searchService" ref="SearchService" />
	</bean>

	<bean id="xxxSchedulerAccessorJob"	class="org.springframework.scheduling.quartz.SchedulerAccessorBean">
		<property name="scheduler" ref="schedulerFactory" />
		<property name="triggers">
			<list>
				<ref bean="xxxJobScheduledACSTrigger" />
			</list>
		</property>
	</bean>

	<bean id="xxxJobScheduledACSTrigger"  class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
		<property name="cronExpression" value="${xxx.scheduledjob.cronexpression}" />
		<property name="startDelay" value="${xxx.scheduledjob.cronstartdelay}" />
		<property name="jobDetail">
			<bean class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
				<property name="jobClass" value="com.Job.scheduledjob.jobs.ScheduledJob" />
				<property name="jobDataAsMap">
					<map>
						<entry key="dataScheduledJobExecuter" value-ref="bean.com.Job.actions.ScheduledJobExecuter" />
						<entry key="jobLockService" value-ref="jobLockService" />
					</map>
				</property>
			</bean>
		</property>
	</bean>

 

iso9999
Member II

Re: Custom Scheduled Job on the Alfresco Admin Page

I saw your code, but I didn't understand where should I exactly define in the bean definition ?

 

this is my code :

	<bean id="bean.com.Job.actions.ScheduledJobExecuter" class="com.Job.actions.ScheduledJobExecuter">
		<property name="serviceRegistry" ref="ServiceRegistry" />
		<property name="nodeService" ref="NodeService" />
		<property name="searchService" ref="SearchService" />
	</bean>

	<bean id="xxxSchedulerAccessorJob"	class="org.springframework.scheduling.quartz.SchedulerAccessorBean">
		<property name="scheduler" ref="schedulerFactory" />
		<property name="triggers">
			<list>
				<ref bean="xxxJobScheduledACSTrigger" />
			</list>
		</property>
	</bean>

	<bean id="xxxJobScheduledACSTrigger"  class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
		<property name="cronExpression" value="${xxx.scheduledjob.cronexpression}" />
		<property name="startDelay" value="${xxx.scheduledjob.cronstartdelay}" />
		<property name="jobDetail">
			<bean class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
				<property name="jobClass" value="com.Job.scheduledjob.jobs.ScheduledJob" />
				<property name="jobDataAsMap">
					<map>
						<entry key="dataScheduledJobExecuter" value-ref="bean.com.Job.actions.ScheduledJobExecuter" />
						<entry key="jobLockService" value-ref="jobLockService" />
					</map>
				</property>
			</bean>
		</property>
	</bean>