[Zope-CMF] Re: Effective use of effective_date and expiration_date

2006-08-29 Thread Philipp von Weitershausen
Raphael Ritz wrote:
 Tres Seaver schrieb:
 [..]

 Yep -- this is how the typical site uses those dates.  However, some
 folks want actual workflow transitions to happen ASAP after each date
 passes.  In that case, you need to write a periodic task which searches
 for objects which are in the between state (e.g., their expiration
 date has passed but they are still active), and cause the workflow
 tool to tickle the transition machinery.  E.g., as a Python Script::

   # untested
   for brain in context.portal_catalog.searchResults(
 review_state=published,
 expiration_date={'query': ZopeTime(),
  'operator': 'max'}):
   obj = brain.getObject()
   wf_tool.doActionFor(ob, 'expire')


 
 Yep. And just reinforcing the obvious:
 Trigger the script Tres mentioned on a regular basis
 yourself, either using a cron job or Zope's ClockServer
 from Chris (included in Zope 2.10 now?)
 
 http://plope.com/software/ClockServer/

Yup, included.

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: Effective use of effective_date and expiration_date

2006-08-28 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jens Vagelpohl wrote:
 
 On 29 Aug 2006, at 01:36, Dmitry S. Makovey wrote:
 

 Sorry for crossposting it from Plone mailing list but I need some
 pointers ASAP :(

 I'm sure this topic came up before but I'm hard pressed right now and
 google returns nothing useful.

 What I need is to activate transitions on effective_date and
 expiration_date. Quick screw-around with automatic/WorkflowMethod
 transitions yeilded zero positive results (unless I'm doing it
 wrong). Anybody seen anything like this done before?

Automatic transitions can't fire by themselves in a request driven
world:  instead, they fire after any user-driven transition, assuming
that their guards pass, and keep firing until they quiesce.

 Not sure what you mean by transitions, the CMF (and I'm sure it's the
 same in Plone) use the effective/expiration dates to filter out items
 that are not effective yet or have expired when doing catalog searches.
 Since most views do rely on catalog searches this suppresses items quite
 effectively.

Yep -- this is how the typical site uses those dates.  However, some
folks want actual workflow transitions to happen ASAP after each date
passes.  In that case, you need to write a periodic task which searches
for objects which are in the between state (e.g., their expiration
date has passed but they are still active), and cause the workflow
tool to tickle the transition machinery.  E.g., as a Python Script::

  # untested
  for brain in context.portal_catalog.searchResults(
review_state=published,
expiration_date={'query': ZopeTime(),
 'operator': 'max'}):
  obj = brain.getObject()
  wf_tool.doActionFor(ob, 'expire')



Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE85gq+gerLs4ltQ4RAmGSAJ9c54Jdj2JmODD49vJM7YJBfas2zwCfSkCT
fRm0QyhWROSVwIKamV6v3Ik=
=eFba
-END PGP SIGNATURE-

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests