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

Mailing List Archive: Bricolage: users

Custom code on media publish

 

 

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


leggn at denison

Oct 22, 2010, 1:07 PM

Post #1 of 10 (929 views)
Permalink
Custom code on media publish

Hi,

I wonder if anyone has any ideas for me... my problem is this:

Suppose we have a published media asset and a story that relates to it.
A user checks out that media asset and uploads a new version with a
different file name, so the media's slug changes. The user publishes
the updated media and the old version is expired. The link in the story
is now broken - the story hasn't been re-burned since the slug of the
related media changed.

I want to write a template or some perl to utilize the Bric API so I can
search out any stories relating to the current media asset and trigger
them to be republished. That's easy to do, but is there a supported way
to run such code without hacking the publish() method in Burner.pm to
call my custom script?

Thanks,
Nick


mattrolf at me

Oct 22, 2010, 3:27 PM

Post #2 of 10 (906 views)
Permalink
Re: Custom code on media publish [In reply to]

Why don't you just upload the media file with the same name so the slug doesn't change?

-Matt

On Oct 22, 2010, at 4:07 PM, Nick Legg wrote:

> Hi,
>
> I wonder if anyone has any ideas for me... my problem is this:
>
> Suppose we have a published media asset and a story that relates to it. A user checks out that media asset and uploads a new version with a different file name, so the media's slug changes. The user publishes the updated media and the old version is expired. The link in the story is now broken - the story hasn't been re-burned since the slug of the related media changed.
>
> I want to write a template or some perl to utilize the Bric API so I can search out any stories relating to the current media asset and trigger them to be republished. That's easy to do, but is there a supported way to run such code without hacking the publish() method in Burner.pm to call my custom script?
>
> Thanks,
> Nick


adam at RFXTechnologies

Oct 22, 2010, 4:52 PM

Post #3 of 10 (904 views)
Permalink
RE: Custom code on media publish [In reply to]

Matt,
I would love to live on your planet, where you can tell users to do something and they listen.

Adam

> -----Original Message-----
> From: Matthew Rolf [mailto:mattrolf [at] me]
> Sent: Friday, October 22, 2010 6:27 PM
> To: users [at] lists
> Subject: Re: Custom code on media publish
>
> Why don't you just upload the media file with the same name so the slug
> doesn't change?
>
> -Matt
>
> On Oct 22, 2010, at 4:07 PM, Nick Legg wrote:
>
> > Hi,
> >
> > I wonder if anyone has any ideas for me... my problem is this:
> >
> > Suppose we have a published media asset and a story that relates to
> it. A user checks out that media asset and uploads a new version with
> a different file name, so the media's slug changes. The user publishes
> the updated media and the old version is expired. The link in the
> story is now broken - the story hasn't been re-burned since the slug of
> the related media changed.
> >
> > I want to write a template or some perl to utilize the Bric API so I
> can search out any stories relating to the current media asset and
> trigger them to be republished. That's easy to do, but is there a
> supported way to run such code without hacking the publish() method in
> Burner.pm to call my custom script?
> >
> > Thanks,
> > Nick


david at kineticode

Oct 23, 2010, 4:20 PM

Post #4 of 10 (900 views)
Permalink
Re: Custom code on media publish [In reply to]

On Oct 22, 2010, at 4:52 PM, Adam Wilson wrote:

> I would love to live on your planet, where you can tell users to do something and they listen.

Life would be so much better without users.

David


david at kineticode

Oct 23, 2010, 4:21 PM

Post #5 of 10 (898 views)
Permalink
Re: Custom code on media publish [In reply to]

On Oct 22, 2010, at 1:07 PM, Nick Legg wrote:

> Hi,
>
> I wonder if anyone has any ideas for me... my problem is this:
>
> Suppose we have a published media asset and a story that relates to it. A user checks out that media asset and uploads a new version with a different file name, so the media's slug changes. The user publishes the updated media and the old version is expired. The link in the story is now broken - the story hasn't been re-burned since the slug of the related media changed.
>
> I want to write a template or some perl to utilize the Bric API so I can search out any stories relating to the current media asset and trigger them to be republished. That's easy to do, but is there a supported way to run such code without hacking the publish() method in Burner.pm to call my custom script?

I think Paul Orrock has a patch that adds burner support for media. Paul, is that somewhere in your fork? I don't see a branch for it…

http://github.com/paulorrock/bricolage/branches

Best,

David


paulo at digitalcraftsmen

Oct 25, 2010, 9:59 AM

Post #6 of 10 (892 views)
Permalink
Re: Custom code on media publish [In reply to]

On 24/10/2010 00:21, David E. Wheeler wrote:
> On Oct 22, 2010, at 1:07 PM, Nick Legg wrote:
>
>> Hi,
>>
>> I wonder if anyone has any ideas for me... my problem is this:
>>
>> Suppose we have a published media asset and a story that relates to it. A user checks out that media asset and uploads a new version with a different file name, so the media's slug changes. The user publishes the updated media and the old version is expired. The link in the story is now broken - the story hasn't been re-burned since the slug of the related media changed.
>>
>> I want to write a template or some perl to utilize the Bric API so I can search out any stories relating to the current media asset and trigger them to be republished. That's easy to do, but is there a supported way to run such code without hacking the publish() method in Burner.pm to call my custom script?
>
> I think Paul Orrock has a patch that adds burner support for media. Paul, is that somewhere in your fork? I don't see a branch for it…
>

It never made it into the fork, since too much code has changed between
the version I wrote it for (1.10.1) and version 2 to make it a simple
insertion. I'll dig out the patch and review it and see what I can come
up with.

Are you using Mason or a PHP burner ?

regards,

Paul


leggn at denison

Oct 25, 2010, 10:11 AM

Post #7 of 10 (892 views)
Permalink
Re: Custom code on media publish [In reply to]

On 10/25/2010 12:59 PM, Paul Orrock wrote:
> On 24/10/2010 00:21, David E. Wheeler wrote:
>> On Oct 22, 2010, at 1:07 PM, Nick Legg wrote:
>>
>>> Hi,
>>>
>>> I wonder if anyone has any ideas for me... my problem is this:
>>>
>>> Suppose we have a published media asset and a story that relates to
>>> it. A user checks out that media asset and uploads a new version
>>> with a different file name, so the media's slug changes. The user
>>> publishes the updated media and the old version is expired. The
>>> link in the story is now broken - the story hasn't been re-burned
>>> since the slug of the related media changed.
>>>
>>> I want to write a template or some perl to utilize the Bric API so I
>>> can search out any stories relating to the current media asset and
>>> trigger them to be republished. That's easy to do, but is there a
>>> supported way to run such code without hacking the publish() method
>>> in Burner.pm to call my custom script?
>>
>> I think Paul Orrock has a patch that adds burner support for media.
>> Paul, is that somewhere in your fork? I don't see a branch for it…
>>
>
> It never made it into the fork, since too much code has changed
> between the version I wrote it for (1.10.1) and version 2 to make it a
> simple insertion. I'll dig out the patch and review it and see what I
> can come up with.
>
> Are you using Mason or a PHP burner ?
>
> regards,
>
> Paul

Hi Paul,

I'm using Mason on Bric 1.10.9.

Thanks,
Nick


david at kineticode

Oct 25, 2010, 11:02 AM

Post #8 of 10 (894 views)
Permalink
Re: Custom code on media publish [In reply to]

On Oct 25, 2010, at 9:59 AM, Paul Orrock wrote:

> It never made it into the fork, since too much code has changed between the version I wrote it for (1.10.1) and version 2 to make it a simple insertion. I'll dig out the patch and review it and see what I can come up with.

I think it'd be a welcome addition to 2.2.0.

David


mattrolf at me

Oct 28, 2010, 11:15 AM

Post #9 of 10 (865 views)
Permalink
Re: Custom code on media publish [In reply to]

On Oct 22, 2010, at 7:52 PM, Adam Wilson wrote:

> Matt,
> I would love to live on your planet, where you can tell users to do something and they listen.

Honestly, I don't think it's that big a deal. But I like where Nick is going with this.

You could maybe argue that the behavior Nick is looking for should be a default setting out of the box.

-Matt


phillip at communitybandwidth

Oct 29, 2010, 7:03 AM

Post #10 of 10 (864 views)
Permalink
Re: Custom code on media publish [In reply to]

On 2010-10-28, at 2:15 PM, Matthew Rolf wrote:

> On Oct 22, 2010, at 7:52 PM, Adam Wilson wrote:
>
>> Matt,
>> I would love to live on your planet, where you can tell users to do something and they listen.
>
> Honestly, I don't think it's that big a deal. But I like where Nick is going with this.
>
> You could maybe argue that the behavior Nick is looking for should be a default setting out of the box.

+1

--
Phillip Smith // Simplifier of Technology // COMMUNITY BANDWIDTH

VOICE: Toronto: 416 921 4608 // New York: 646 810 8642 // Oxford: 1865 989328
WEB: www.communitybandwidth.ca // www.phillipadsmith.com
SOCIAL: phillipadsmith on Skype, Twitter, LinkedIn, and all that jazz.

NOTES: This email is: [ ] bloggable [X] ask first [ ] private

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.