[Zope-PTK] Publishing and expiration of content

Kevin Dangoor kid@kendermedia.com
Mon, 17 Jan 2000 13:13:59 -0500


----- Original Message -----
From: "Paul Everitt" <paul@digicool.com>
To: "Kevin Dangoor" <kid@kendermedia.com>
Cc: <zope-ptk@zope.org>
Sent: Monday, January 17, 2000 8:31 AM
Subject: Re: [Zope-PTK] Publishing and expiration of content


> Kevin Dangoor wrote:
> >     One thing that is probably worth considering is the automatic
publishing
> > and expiration of content. Automatic release of news stories at a
specific
> > time is a feature of KM|Net News that I use all the time. I don't know
if
> > anyone else thinks this type of feature would be useful. (If not, I can
> > always just make my own portal class that has those features).
>
> I think this is a natural fit.  Kevin, do you think this should be
> pushed down into the common PTK architecture?  We certainly get asked
> about it all the time on the consulting side.

I think there are many uses for this type of thing. If every type of PTK
document/whatever had this sort of thing, that would be useful. (For
example, you could set up a survey to start at a particular time and end at
a particular time...)

> Can you explain, both from the user's perspective and under the hood,
> how it works in KM|Net News?

The implementation in KM|Net News is really trivial. I only implemented a
"release" time, not expiration. Basically, there is a property called
"release" (type Date). The form used to submit an article does not list the
release, but the reviewer's form does. The reviewer just enters when the
article should be released. The article is actually visible at its URL
before the release time. This has been handy along the way, but I could see
many people preferring that the article is not visible until its release
time.

The code the produces the article listing (like what you see on the front
page of byproducts.com) basically just picks up all of the articles marked
as being "top" articles from the Catalog. Then, inside the <dtml-in> there
is:

<dtml-if "release.isPast()">
...list the article...
</dtml-if>

If release was in the index, you could certainly make that a condition of
the Catalog query.

> Also, if you could please read the bullet in the "PTK Architecture"
> section that talks about reviewing, and see if this model could be
> extended to include automatic publishing.  Meaning, the idea of
> status-matched-to-role could be extending to automatic publishing as
> well.  Thus, a piece of content might be visible to a Reviewer on one
> date but not a Member or a Guest until a later date.

As you can see from the above, my implementation is quite simple. It may be
possible to create a permission that is "View Unreleased/expired Documents"
so that the administrators can easily choose which people can view content
that has not yet been released or has expired. Without a scheduler, I'm not
sure if there's really any other way to make things automatically come and
go on the site. Even with a scheduler, this may still be the best way to go.

BTW, I use essentially the same technique for giveaways and specials on
byproducts.com. There are hooks so that the event will automatically start
and end at a specific time.

Kevin