There is a new component in the ECM platform: a scheduler that can trigger core events at designated times.

The times specification is the same as the one used by the Unix cron program, and therefore quite flexible, see
http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html

The component is named org.nuxeo.ecm.platform.scheduler.core and lives at
http://svn.nuxeo.org/nuxeo/org.nuxeo.ecm.platform.scheduler/trunk/core

A unit test shows how to do the configuration (see test/resources/ test-nxscheduler.xml), basically you have to use an extension point and say for instance:
   <schedule id="testing">
      <username>Administrator</username>
      <password>Administrator</password>
      <eventId>testEvent</eventId>
      <eventCategory>default</eventCategory>
      <!-- every second -->
      <cronExpression>*/1 * * * * ?</cronExpression>
  </schedule>

There is also a core listener example that shows how to reconnect to a CoreSession and from there get the document root. This is possible because the scheduler recreates a UserSession before sending the regular core event. This depends on a trunk version of org.nuxeo.ecm.core.repository (to get a proper service registration of the CoreSession).

Florent

--
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87



_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to