Skip to content

Instantly share code, notes, and snippets.

@douglascrp
douglascrp / triggerLdapSync.js
Last active August 30, 2017 12:00 — forked from AFaust/printAlfrescoLog.js
How to trigger Alfresco LDAP sync with JavaScript
var ctxt, scheduler;
// get Spring context and Quartz scheduler
ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
scheduler = ctxt.getBean('schedulerFactory', Packages.org.quartz.Scheduler);
// fire (unless explicitly defined in Job detail Spring bean, scheduler group is always DEFAULT)
scheduler.triggerJob('ldapPeopleJobDetail', 'DEFAULT');