List Info

Thread: Expiring full categories using bric_soap??




Expiring full categories using bric_soap??
user name
2007-09-12 08:14:54
Hello all,

Does anyone by chance have an example script that will
expire all of
the content under a category or URI in one pass.

We're getting rid of a lot of old content going back to
2003.
i.e http://domain.com/musi
c/videos <-- expire every article under this URL



Grateful for any feedback.

Thanks

-- 
Chauncey Thorn
Sr. Applications Developer / Systems Administrator
VIBE/VIXEN
VIBE MEDIA GROUP
cthornvibe.com

Re: Expiring full categories using bric_soap??
user name
2007-09-12 09:23:31
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.
>
> We're getting rid of a lot of old content going back to
2003.
> i.e http://domain.com/musi
c/videos <-- expire every article under this URL

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

Re: Expiring full categories using bric_soap??
user name
2007-09-12 09:30:05
Apology...
I asked this same question Jan 12, 2007.  In a different
way.
       Topic: "expire content based on uri using
bric_soap"

Sorry...

However, if someone has a better solution please let me
know.

Thanks and again sorry!


On 9/12/07, Chauncey Thorn <chauncey.thorngmail.com> wrote:
> Hello all,
>
> Does anyone by chance have an example script that will
expire all of
> the content under a category or URI in one pass.
>
> We're getting rid of a lot of old content going back to
2003.
> i.e http://domain.com/musi
c/videos <-- expire every article under this URL
>
>
>
> Grateful for any feedback.
>
> Thanks
>
> --
> Chauncey Thorn
> Sr. Applications Developer / Systems Administrator
> VIBE/VIXEN
> VIBE MEDIA GROUP
> cthornvibe.com
>

Re: Expiring full categories using bric_soap??
user name
2007-09-12 09:39:31
On Wed, 12 Sep 2007, Chauncey Thorn wrote:
> I asked this same question Jan 12, 2007.  In a
different way.
>       Topic: "expire content based on uri using
bric_soap"

I thought it seemed familiar. 

Re: Expiring full categories using bric_soap??
user name
2007-09-12 09:56:12
Thanks for the additional cmds..

Got it working...
step 3 was what I wasn't doing...

Keep up the good work.

On 9/12/07, Scott Lanning <lanningswho.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.
> >
> > We're getting rid of a lot of old content going
back to 2003.
> > i.e http://domain.com/musi
c/videos <-- expire every article under this URL
>
> 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
>

Re: Expiring full categories using bric_soap??
user name
2007-09-13 16:32:15
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 <phillipcommunitybandwidth.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 <lanningswho.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
>
>
>

[1-6]

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