Phillip,
I pretty much followed these instructions..
I will try and post a script soon.
But this works....
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I think the idea would be to
1) export all those docs and media
2) set <expire_date> in all of them to the past
3) update all the docs/media
4) publish all of them
5) (probably) delete all of them
So, without testing...
You might have to add --timeout=12345 if you have big media
files
or complicated stories.
You might have to set BRICOLAGE_SERVER, BRICOLAGE_USERNAME,
BRICOLAGE_PASSWORD.
1)
CAT=/your/category
for i in `bric_soap story --search
primary_uri="$CAT" list_ids`;
do bric_soap story export $i > $i.xml; done
for i in `bric_soap media --search uri="$CAT"
list_ids`;
do bric_soap media export $i > $i.xml; done
2)
for f in *.xml; do
perl -i -ne'print unless /<expire_date/' $f;
perl -i
-ne'$_.="<expire_date>2005-01-01T00:00:00Z</ex
pire_date>"
if /<cover_date/;print' $f;
done
3)
for f in story_*.xml; do bric_soap story update $f; done
for f in media_*.xml; do bric_soap media update $f; done
4)
for i in `bric_soap story --search
primary_uri="$CAT" list_ids`;
do bric_soap workflow publish $i; done
for i in `bric_soap media --search uri="$CAT"
list_ids`;
do bric_soap workflow publish $i; done
5)
for i in `bric_soap story --search
primary_uri="$CAT" list_ids`;
do bric_soap story delete $i; done
for i in `bric_soap media --search uri="$CAT"
list_ids`;
do bric_soap media delete $i; done
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On 9/13/07, Phillip Smith <phillip communitybandwidth.ca>
wrote:
>
> On 12-Sep-07, at 7:56 AM, Chauncey Thorn wrote:
>
> >
> > Got it working...
> > step 3 was what I wasn't doing...
> >
> > Keep up the good work.
> >
> > On 9/12/07, Scott Lanning <lannings who.int> wrote:
> >> On Wed, 12 Sep 2007, Chauncey Thorn wrote:
> >>> Does anyone by chance have an example
script that will expire all of
> >>> the content under a category or URI in one
pass.
>
> Have an example script to share?
>
> --
> Phillip Smith,
> Simplifier of Technology
> Community Bandwidth
>
>
>
|