Hi Zopistas I'm trying to create a notification / trigger function in Zope. Since there are typically a couple of ways to implement things in Zope, I'd like to hear some suggestions on how to accomplish the following: 1. Trigger an article to become displayed at or after a certain date and time. Like preloaded press releases that are then "released" for view at the given date. Or pages that are announced, or product details that are launched etc. 2. The Zope server should send an email notification to someone at a specific TIME, not when a certain submit button or website is viewed. The means that the server has to implement a not web interface based trigger (real-time). Something simple like will not work since it needs the particular page to be hit at the required second <dtml-if expr="(ZopeTime()).month()== 1 and (ZopeTime()).day()== 1 and (ZopeTime()).hour()== 0 and (ZopeTime()).minute()== 0 and (ZopeTime()).second()== 0"> <dtml-var Send_NewYear_Notification> Regards, Brendon --- Brendon Grunewald 70South: - Interactive and updated daily with the latest news and information on Antarctica and related topics. - Available on your PC, Mobile Phone and PDA. - The No.1 source for Antarcticles (tm)
Hi, Brendon Grunewald wrote:
1. Trigger an article to become displayed at or after a certain date and time. Like preloaded press releases that are then "released" for view at the given date. Or pages that are announced, or product details that are launched etc.
The CMF does this by casuing every piece of content to be cataloged, and only returning those pieces of content in a later catalog query which have an effective date past the viewing time.
2. The Zope server should send an email notification to someone at a specific TIME, not when a certain submit button or website is viewed. The means that the server has to implement a not web interface based trigger (real-time). Something simple like will not work since it needs the particular page to be hit at the required second <dtml-if expr="(ZopeTime()).month()== 1 and (ZopeTime()).day()== 1 and (ZopeTime()).hour()== 0 and (ZopeTime()).minute()== 0 and (ZopeTime()).second()== 0"> <dtml-var Send_NewYear_Notification>
Zope has no built-in scheduler. There is a product named Xron that evidently allows you to schedule events like this, or you can use UNIX cron and XML-RPC to "roll your own". HTH! -- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com "Killing hundreds of birds with thousands of stones"
Brendon Grunewald wrote:
Hi Zopistas
I'm trying to create a notification / trigger function in Zope. Since there are typically a couple of ways to implement things in Zope, I'd like to hear some suggestions on how to accomplish the following:
1. Trigger an article to become displayed at or after a certain date and time. Like preloaded press releases that are then "released" for view at the given date. Or pages that are announced, or product details that are launched etc.
We at ZC have been fielding a number of RFPs for content management recently. This is a common pattern. Chris gave the right answers in his note, so I'll just parrot what he said. :^) The CMF simulates this kind "release" by simply not allowing the item to be viewable until the effective date. It doesn't, though, really change the state of the item when it becomes effective. Note that what's really wanted here is a workflow event that somehow gets triggered based on clock ticks. You find all the content that matches the criteria and move the content to the next state. For now, the simplest thing to do is write a cron job that tickles a Python script every minute. The Python script then does a catalog request to find everything that has an effective date past "now" that hasn't been published, and changes the content to published. This presumes that all of your content is catalog-aware. If not, you have one heck of a find sweep ahead of you. Obviously, make sure that your Python script is pretty resilient with exception handlers. Also, make sure your cron job is pretty smart about detecting that the Python script didn't run to completion, and thus emails you something from stderr. Alternatively, try Xron as Chris suggested. It seems to be pretty old, so it might not work for recent releases of Zope. But Xron is the right kind of approach. Boy, I sure would like to see something like this become part of CMF or Zope in the future! --Paul
Alternatively, try Xron as Chris suggested. It seems to be pretty old, so it might not work for recent releases of Zope. But Xron is the right kind of approach.
There are patches published in the archives of zope@zope.org and zope-dev@zope.org that will bring it up to date. Search for "xron" in the subject.
Boy, I sure would like to see something like this become part of CMF or Zope in the future!
So would I! Surely you can make it more robust than I did. And keep it up to date with new releases of Zope. -- Loren Xron Stafford
participants (4)
-
Brendon Grunewald -
Chris McDonough -
Loren Stafford -
Paul Everitt