Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Bricolage: users

burn_another again and again

 

 

Bricolage users RSS feed   Index | Next | Previous | View Threaded


adam at RFXTechnologies

Oct 9, 2010, 3:20 PM

Post #1 of 7 (566 views)
Permalink
burn_another again and again

Quick Synopsis: How can I call burn_another on a story that uses a template that calls burn_another, without activating the second burn?

I am trying to make a template that adds links to the bottom of the story for the article that has a cover date before it and after it.

I also need to republish these related stories, in case the order has been changed around or this is a new story. To do this, first time around, I added this to the template.

% $burner->blaze_another( $previous_story );
% $burner->blaze_another( $next_story );

Those of you who have tried this before might know why this was a bad idea. The problem I ran into is that this burned the story before and after. When those stories were burned, it burned the story both before and after(which means that now I am burning the current story twice), which started a trend that caused to have to kill everything on the box after 30 minutes when it became unresponsive to all requests.

So, I added some logic:
<%perl>
if ($story->needs_publish()) {
$burner->blaze_another( $previous_story );
$burner->blaze_another( $next_story );
}
</%perl>

However, this only burns another when I am previewing a story that has been modified. On preview, this is perfect, but when I try to publish, the other stories are not burned because it would seem the first thing that happens when you publish a story is that it is marked as published. I have been fighting with this one for a while, and cannot figure out a way to achieve my desired results.

I am hoping that someone out there might have already cracked this nut, and will be willing to share their secrets.

Thanx,
Adam Wilson


david at kineticode

Oct 11, 2010, 9:01 PM

Post #2 of 7 (540 views)
Permalink
Re: burn_another again and again [In reply to]

Are you using Bricolage 2.0? It's method of keeping track of calls to burn_another() *should* avoid this issue, I think.

David


On Oct 9, 2010, at 6:20 PM, Adam Wilson wrote:

> Quick Synopsis: How can I call burn_another on a story that uses a template that calls burn_another, without activating the second burn?
>
> I am trying to make a template that adds links to the bottom of the story for the article that has a cover date before it and after it.
>
> I also need to republish these related stories, in case the order has been changed around or this is a new story. To do this, first time around, I added this to the template.
>
> % $burner->blaze_another( $previous_story );
> % $burner->blaze_another( $next_story );
>
> Those of you who have tried this before might know why this was a bad idea. The problem I ran into is that this burned the story before and after. When those stories were burned, it burned the story both before and after(which means that now I am burning the current story twice), which started a trend that caused to have to kill everything on the box after 30 minutes when it became unresponsive to all requests.
>
> So, I added some logic:
> <%perl>
> if ($story->needs_publish()) {
> $burner->blaze_another( $previous_story );
> $burner->blaze_another( $next_story );
> }
> </%perl>
>
> However, this only burns another when I am previewing a story that has been modified. On preview, this is perfect, but when I try to publish, the other stories are not burned because it would seem the first thing that happens when you publish a story is that it is marked as published. I have been fighting with this one for a while, and cannot figure out a way to achieve my desired results.
>
> I am hoping that someone out there might have already cracked this nut, and will be willing to share their secrets.
>
> Thanx,
> Adam Wilson
>
>


adam at RFXTechnologies

Oct 12, 2010, 6:54 AM

Post #3 of 7 (538 views)
Permalink
RE: burn_another again and again [In reply to]

We are on Bricolage 1.11, looking at upgrading to 2.0 in the near future. I will let you know how things go for me at that juncture.

I guess I am pretty much SOL 'til then?

-----Original Message-----
From: David E. Wheeler [mailto:david [at] kineticode]
Sent: Tuesday, October 12, 2010 12:02 AM
To: users [at] lists
Subject: Re: burn_another again and again

Are you using Bricolage 2.0? It's method of keeping track of calls to burn_another() *should* avoid this issue, I think.

David


On Oct 9, 2010, at 6:20 PM, Adam Wilson wrote:

> Quick Synopsis: How can I call burn_another on a story that uses a template that calls burn_another, without activating the second burn?
>
> I am trying to make a template that adds links to the bottom of the story for the article that has a cover date before it and after it.
>
> I also need to republish these related stories, in case the order has been changed around or this is a new story. To do this, first time around, I added this to the template.
>
> % $burner->blaze_another( $previous_story );
> % $burner->blaze_another( $next_story );
>
> Those of you who have tried this before might know why this was a bad idea. The problem I ran into is that this burned the story before and after. When those stories were burned, it burned the story both before and after(which means that now I am burning the current story twice), which started a trend that caused to have to kill everything on the box after 30 minutes when it became unresponsive to all requests.
>
> So, I added some logic:
> <%perl>
> if ($story->needs_publish()) {
> $burner->blaze_another( $previous_story );
> $burner->blaze_another( $next_story );
> }
> </%perl>
>
> However, this only burns another when I am previewing a story that has been modified. On preview, this is perfect, but when I try to publish, the other stories are not burned because it would seem the first thing that happens when you publish a story is that it is marked as published. I have been fighting with this one for a while, and cannot figure out a way to achieve my desired results.
>
> I am hoping that someone out there might have already cracked this nut, and will be willing to share their secrets.
>
> Thanx,
> Adam Wilson
>
>


david at kineticode

Oct 12, 2010, 2:31 PM

Post #4 of 7 (533 views)
Permalink
Re: burn_another again and again [In reply to]

On Oct 12, 2010, at 9:54 AM, Adam Wilson wrote:

> We are on Bricolage 1.11, looking at upgrading to 2.0 in the near future. I will let you know how things go for me at that juncture.
>
> I guess I am pretty much SOL 'til then?

You could stick something in $burner->notes I think, and then check for it and skip a burn for any UUIDs you've got in there.

Best,

David


adam at RFXTechnologies

Oct 14, 2010, 7:03 AM

Post #5 of 7 (521 views)
Permalink
RE: burn_another again and again [In reply to]

> On Oct 9, 2010, at 6:20 PM, Adam Wilson wrote:
>
> > Quick Synopsis: How can I call burn_another on a story that uses a
> template that calls burn_another, without activating the second burn?
> >
> > % $burner->blaze_another( $previous_story );
> > % $burner->blaze_another( $next_story );
>
> -----Original Message-----
> From: David E. Wheeler [mailto:david [at] kineticode]
>
> Are you using Bricolage 2.0? It's method of keeping track of calls to
> burn_another() *should* avoid this issue, I think.
>
> David
>

Is there a difference between blaze_another and burn_another? I looked in the API docs, but only see blaze_another. I am not trying to nit-pick, I am concerned there is a burn_another function that I am unaware of.

I have a test instance of the 2.0 running to prepare for our upgrade.
I just tried my template that uses blaze_another on a story, and the server came to a screeching halt that ultimately required a hard reboot to overcome.


bret at pectopah

Oct 14, 2010, 8:29 AM

Post #6 of 7 (520 views)
Permalink
RE: burn_another again and again [In reply to]

Hi Adam,

I think the method everybody means is publish_another(), which is what
gets called by blaze_another() when you're in publish mode.

Anyway, here's something to try, which works well on the IFEX and
Sportsnet sites to avoid circles of re-publishing.


1. Put all the republish logic in a utility template. I like to call
that template the "index_publisher."


2. In the index_publisher, make a list of stories that need updates,
then run through that list with something like this:

$burner->notes($target_story->get_id => 1);
if ($burner->get_mode == PUBLISH_MODE) {
$burner->publish_another($target_story);
Bric::App::Util::add_msg('"' . $target->get_title . '" published.');
} else {
$m->out('At this point, would publish "' . $target_story->get_title . '"');
}


3. In each story that needs to trigger a publish, call the trigger this
way:

</%cleanup>
if ($burner->notes($story->get_id)) {
Bric::App::Util::add_msg('"' . $story->get_title . '" avoided re-triggering the index publisher.');
} else {
$m->comp('/util/index_publisher.mc');
}
</%cleanup>


Hope this helps,

Bret



On Thu, 2010-10-14 at 14:03 +0000, Adam Wilson wrote:
> > On Oct 9, 2010, at 6:20 PM, Adam Wilson wrote:
> >
> > > Quick Synopsis: How can I call burn_another on a story that uses a
> > template that calls burn_another, without activating the second burn?
> > >
> > > % $burner->blaze_another( $previous_story );
> > > % $burner->blaze_another( $next_story );
> >
> > -----Original Message-----
> > From: David E. Wheeler [mailto:david [at] kineticode]
> >
> > Are you using Bricolage 2.0? It's method of keeping track of calls to
> > burn_another() *should* avoid this issue, I think.
> >
> > David
> >
>
> Is there a difference between blaze_another and burn_another? I looked in the API docs, but only see blaze_another. I am not trying to nit-pick, I am concerned there is a burn_another function that I am unaware of.
>
> I have a test instance of the 2.0 running to prepare for our upgrade.
> I just tried my template that uses blaze_another on a story, and the server came to a screeching halt that ultimately required a hard reboot to overcome.
>

--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret [at] pectopah
www.pectopah.com


david at kineticode

Oct 14, 2010, 8:36 AM

Post #7 of 7 (522 views)
Permalink
Re: burn_another again and again [In reply to]

On Oct 14, 2010, at 10:03 AM, Adam Wilson wrote:

> Is there a difference between blaze_another and burn_another? I looked in the API docs, but only see blaze_another. I am not trying to nit-pick, I am concerned there is a burn_another function that I am unaware of.

It's actually publish_another(), not burn_another(). I mis-typed (do that all the time).

blaze_another() simply calls publish_another() if the current burn is a publish burn, and preview_another() if the current burn is a preview burn.

> I have a test instance of the 2.0 running to prepare for our upgrade.
> I just tried my template that uses blaze_another on a story, and the server came to a screeching halt that ultimately required a hard reboot to overcome.

Yow! Something's wrong.

D

Bricolage users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.