I just wanted to get a little heads up from content repository savvy people for a change that I'm making in the PL/SQL API. I am
changing the sheduled PL/SQL proc cr_scheduled_release_exec to invoke
content_item.set_live_revision so that the publish_date of the live
revision is set to sysdate. I also made the unpublishing part of the proc
unset the live revision.
I guess as Lars pointed out for consistency cr_scheduled_release_exec
should invoke content_item.unset_live_revision when unpublishing items.
The reason I didn't make this change is that unset_live_revision sets
publish status to "production" whereas it needs to be set to "expired" in
this case. It's not clear to me what the thinking behind the set/unset
live revision PL/SQL procs were, and at this point I don't feel confident
making large changes in the API. The change I am proposing is the bare
minimum needed to make scheduled publishing work properly for Greenpeace
Germany.
Here is the CVS diff (need to make analogous change for PG):
Index: content-schedule.sql
===================================================================
RCS file:
/usr2/cvsroot/planet/packages/acs-content-repository/sql/oracle/content-schedule.sql,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.22.1
diff -u -r1.1.1.1 -r1.1.1.1.22.1
--- content-schedule.sql 2002/04/05 16:14:38 1.1.1.1
+++ content-schedule.sql 2004/05/04 14:30:45 1.1.1.1.22.1
@@ -4,7 +4,7 @@
-- Copyright (C) 1999-2000 ArsDigita Corporation
-- Author: Karl Goldstein (mailto:karlg@arsdigita.com)
--- $Id: content-schedule.sql,v 1.1.1.1 2002/04/05 16:14:38 bruno Exp $
+-- $Id: content-schedule.sql,v 1.1.1.1.22.1 2004/05/04 14:30:45 peter
Exp $
-- This is free software distributed under the terms of the GNU Public
-- License. Full text of the license is available from the GNU Project:
@@ -34,7 +34,7 @@
cursor start_cur is
select
- p.item_id, live_revision
+ i.latest_revision
from
cr_release_periods p, cr_items i
where
@@ -44,7 +44,7 @@
cursor end_cur is
select
- p.item_id, live_revision
+ p.item_id
from
cr_release_periods p, cr_items i
where
@@ -66,13 +66,12 @@
for item_rec in start_cur loop
- -- update publish status
- update cr_items
- set publish_status = 'live'
- where
- item_id = item_rec.item_id;
+ content_item.set_live_revision(
+ revision_id => item_rec.latest_revision,
+ publish_status => 'live'
+ );
- items_released := items_released + 1;
+ items_released := items_released + 1;
end loop;
@@ -80,7 +79,8 @@
-- update publish status
update cr_items
- set publish_status = 'expired'
+ set publish_status = 'expired',
+ live_revision = null
where
item_id = item_rec.item_id;