Alfresco provide one great feature which allows you to schedule particular operation so that it will be executed repeatedly after defined time intervals. Many times this kind of requirement comes which where this feature come in handy for instance if we want to archive the old contents which are older or send report mail to moderators on daily basis from repository.
By following these steps you could create such action in alfresco share.
Create xml file called “custom-action-context.xml” (You could give any name which follows this pattern *-context.xml)
Add following scheduler definitions under file created in step1
This bean “runScriptAction” specify all parameters related to action which is to be executed at regular interval.
parameterTemplatesà Indicate script which will be executed during job run.
Second bean “runScript” is the actual bean which will be invoked first during job run which in turn invoke first bean. If you note carefully there is a parameter called “cronExpression” which specify time interval for each job run. For more details on cron expression you can refer this wiki link.
Upload the script into alfresco as specified location within bean.
In this case location is “Data Dictionary>scripts” as specified in “runScript” bean definition.
Restart alfresco server and notice your job execution through logs or user interface.
Summary: This is very powerful and handy tool which can be used to done some scheduled activities. In this case it is used to remove newFolder aspect which I am adding to each of new folder. It is my custom aspect.