List Info

Thread: Workflow Script to set expiration date




Workflow Script to set expiration date
country flaguser name
New Zealand
2007-03-18 23:41:28
I am using Plone to publish classified ads, which I want to expire automatically 31 days after publishing.  I would like to write a workflow script that sets the object expiration date to current + 31, and don't know how to go about that (ie what the python syntax etc would be).  Could someone please point me in the right direction?

Many thanks,
Barry

ps I do know how to add/edit a workflow script as it is in the book.

Send instant messages to your online friends http://au.messenger.yahoo.com
Re: Workflow Script to set expiration date
country flaguser name
Germany
2007-03-19 00:02:45

--On 18. März 2007 21:41:28 -0700 Barry Page
<barry_pageyahoo.co.nz> 
wrote:

> I am using Plone to publish classified ads, which I
want to expire
> automatically 31 days after publishing.  I would like
to write a workflow
> script that sets the object expiration date to current
+ 31, and don't
> know how to go about that (ie what the python syntax
etc would be).
> Could someone please point me in the right direction?

Read this:

<http://plone.org/documentati
on/tutorial/creating-workflows-in-plone/introduction>


As documented: the current object is available through the
'state_change'
parameter passed to each workflow script. Setting the
expiration date is 
trivial:

 someobject.setExpirationDate(DateTime() + 31)

-aj


-- 
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070
Tübingen - Germany
Web: www.zopyx.com - Email: infozopyx.com - Phone +49 -
7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A
381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham,
UK
------------------------------------------------------------
------------
E-Publishing, Python, Zope & Plone development,
Consulting

------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plone-Users mailing list
Plone-Userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users


Re: Workflow Script to set expiration date
country flaguser name
Germany
2007-03-19 00:08:56

--On 19. März 2007 06:02:45 +0100 Andreas Jung
<listszopyx.com> wrote:

>
>
> --On 18. März 2007 21:41:28 -0700 Barry Page
<barry_pageyahoo.co.nz>
> wrote:
>
>> I am using Plone to publish classified ads, which I
want to expire
>> automatically 31 days after publishing.  I would
like to write a workflow
>> script that sets the object expiration date to
current + 31, and don't
>> know how to go about that (ie what the python
syntax etc would be).
>> Could someone please point me in the right
direction?
>
> Read this:
>
> <http://plone.org/documentation/tutorial/
creating-workflows-in-plone/intr
> oduction>
>
> As documented: the current object is available through
the 'state_change'
> parameter passed to each workflow script. Setting the
expiration date is
> trivial:
>
>  someobject.setExpirationDate(DateTime() + 31)
>

In addition: read the posting "Automated smpt message
in plone" posted on 
this list some hours ago.

-aj

------------------------------------------------------------
-------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the
chance to share your
opinions on IT & business topics through brief
surveys-and earn cash
http://www.techsay.com/default.
php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plone-Users mailing list
Plone-Userslists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )