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

Mailing List Archive: Bricolage: users

publishing related assets

 

 

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


zdravko.balorda at siix

Jan 16, 2012, 12:32 AM

Post #1 of 18 (1945 views)
Permalink
publishing related assets

Hi,
to publish related stories are there any other conditions to be met
beside config:

PUBLISH_RELATED_ASSETS = Yes

Somehow, related stories won't publish anymore. Or am I missing something?!

Regards, Zdravko


ps at phillipadsmith

Jan 16, 2012, 7:08 AM

Post #2 of 18 (1888 views)
Permalink
Re: publishing related assets [In reply to]

On 2012-01-16, at 2:32 AM, Zdravko Balorda wrote:

> Hi,
> to publish related stories are there any other conditions to be met
> beside config:
>
> PUBLISH_RELATED_ASSETS = Yes
>
> Somehow, related stories won't publish anymore. Or am I missing something?!


What do you mean by "related stories" exactly? I *think* that the PUBLISH_RELATED_ASSETS setting only publishing the single media or story asset that are _directly_ related to the story, not assets that are related through sub-elements. I could be wrong about this, but I believe that's the case.


--
Phillip Smith
http://phillipadsmith.com
http://twitter.com/phillipadsmith
http://linkedin.com/in/phillipadsmith

Save our in-boxes! http://emailcharter.org


zdravko.balorda at siix

Jan 17, 2012, 5:05 AM

Post #3 of 18 (1881 views)
Permalink
Re: publishing related assets [In reply to]

Phillip Smith wrote:
> On 2012-01-16, at 2:32 AM, Zdravko Balorda wrote:
>
>> Hi,
>> to publish related stories are there any other conditions to be met
>> beside config:
>>
>> PUBLISH_RELATED_ASSETS = Yes
>>
>> Somehow, related stories won't publish anymore. Or am I missing something?!
>
>
> What do you mean by "related stories" exactly? I *think* that the PUBLISH_RELATED_ASSETS setting only publishing the single media or story asset that are _directly_ related to the story, not assets that are related through sub-elements. I could be wrong about this, but I believe that's the case.
>

Phillip, I'd agree. Yet, it doesn't publish "related stories". Only a leading story.
No related media, either!
Should I check anything in the database?
Zdravko


zdravko.balorda at siix

Jan 17, 2012, 7:05 AM

Post #4 of 18 (1886 views)
Permalink
Re: publishing related assets [In reply to]

Phillip Smith wrote:
> On 2012-01-16, at 2:32 AM, Zdravko Balorda wrote:
>
>> Hi,
>> to publish related stories are there any other conditions to be met
>> beside config:
>>
>> PUBLISH_RELATED_ASSETS = Yes
>>
>> Somehow, related stories won't publish anymore. Or am I missing something?!
>
>
> What do you mean by "related stories" exactly? I *think* that the PUBLISH_RELATED_ASSETS setting only publishing the single media or story asset that are _directly_ related to the story, not assets that are related through sub-elements. I could be wrong about this, but I believe that's the case.
>

Phillip, I'd agree. Yet, it doesn't publish "related stories". Only a leading story.
No related media, either!
Should I check anything in the database?
Zdravko

Not even bric_soap would do:
bric_soap workflow publish story_9017 --with-related-media --with-related-stories

There should have been 2 stories and 1 media published, but only a story itself get's
published.


zdravko.balorda at siix

Jan 19, 2012, 1:48 AM

Post #5 of 18 (1884 views)
Permalink
Re: publishing related assets [In reply to]

Hi!
Any pointers on this subject?
Regards, Zdravko


Phillip Smith wrote:
> On 2012-01-16, at 2:32 AM, Zdravko Balorda wrote:
>
>> Hi,
>> to publish related stories are there any other conditions to be met
>> beside config:
>>
>> PUBLISH_RELATED_ASSETS = Yes
>>
>> Somehow, related stories won't publish anymore. Or am I missing something?!
>
>
> What do you mean by "related stories" exactly? I *think* that the PUBLISH_RELATED_ASSETS setting only publishing the single media or story asset that are _directly_ related to the story, not assets that are related through sub-elements. I could be wrong about this, but I believe that's the case.
>

Phillip, I'd agree. Yet, it doesn't publish "related stories". Only a leading story.
No related media, either!
Should I check anything in the database?
Zdravko

Not even bric_soap would do:
bric_soap workflow publish story_9017 --with-related-media --with-related-stories

There should have been 2 stories and 1 media published, but only a story itself get's
published.


ps at phillipadsmith

Jan 19, 2012, 8:57 AM

Post #6 of 18 (1883 views)
Permalink
Re: publishing related assets [In reply to]

Can you export the story via bric_soap and paste the output into an e-mail and send it to the list?

On 2012-01-19, at 3:48 AM, Zdravko Balorda wrote:

>
> Hi!
> Any pointers on this subject?
> Regards, Zdravko
>
>
> Phillip Smith wrote:
>> On 2012-01-16, at 2:32 AM, Zdravko Balorda wrote:
>>> Hi,
>>> to publish related stories are there any other conditions to be met
>>> beside config:
>>>
>>> PUBLISH_RELATED_ASSETS = Yes
>>>
>>> Somehow, related stories won't publish anymore. Or am I missing something?!
>> What do you mean by "related stories" exactly? I *think* that the PUBLISH_RELATED_ASSETS setting only publishing the single media or story asset that are _directly_ related to the story, not assets that are related through sub-elements. I could be wrong about this, but I believe that's the case.
>
> Phillip, I'd agree. Yet, it doesn't publish "related stories". Only a leading story.
> No related media, either!
> Should I check anything in the database?
> Zdravko
>
> Not even bric_soap would do:
> bric_soap workflow publish story_9017 --with-related-media --with-related-stories
>
> There should have been 2 stories and 1 media published, but only a story itself get's
> published.
>

--
Phillip Smith
http://phillipadsmith.com
http://twitter.com/phillipadsmith
http://linkedin.com/in/phillipadsmith

Save our in-boxes! http://emailcharter.org


zdravko.balorda at siix

Jan 19, 2012, 10:13 PM

Post #7 of 18 (1893 views)
Permalink
Re: publishing related assets [In reply to]

Phillip Smith wrote:
> Can you export the story via bric_soap and paste the output into an e-mail and send it to the list?
>

Here it is. Probably all you wanted are <containers>. Note that "linked_news" are of type
Related Story. When it's published related documents should appear in a Job queue
immedialtely, right? They don't. Not even when queued runs the job. The story itself is
the only job in the queue.

Regards, Zdravko
-------------------------------------------------------

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assets xmlns="http://bricolage.sourceforge.net/assets.xsd">
<story id="9257" uuid="66CFDBEC-D300-11E0-8949-B53D66B94067" element_type="news">
<site>Aphaia-SI</site>
<name>Urša Primožič</name>
<description></description>
<slug>ursa_primozic</slug>
<primary_uri>/sodelavci/ursa_primozic/</primary_uri>
<priority>3</priority>
<publish_status>1</publish_status>
<active>1</active>
<source>Internal</source>
<cover_date>2011-08-30T12:05:00Z</cover_date>
<publish_date>2012-01-17T13:02:00Z</publish_date>
<first_publish_date>2011-09-02T07:54:48Z</first_publish_date>
<categories>
<category primary="1">/sodelavci/</category>
</categories>
<output_channels>
<output_channel primary="1">PHP Aphaia-sl_SI.UTF8</output_channel>
</output_channels>
<contributors></contributors>
<elements>
<field type="text" order="0"></field>
<container displayed="1" order="1" element_type="related_media"
related_media_id="21710" />
<container displayed="1" order="2" element_type="linked_news" related_story_id="9255" />
<container displayed="1" order="3" element_type="linked_news" related_story_id="9256" />
<container displayed="1" order="4" element_type="see_alsoflag" />
</elements>
</story>
</assets>


leggn at denison

Jan 20, 2012, 4:55 AM

Post #8 of 18 (1877 views)
Permalink
Re: publishing related assets [In reply to]

Zdravko,

When you publish story 9257 with PUBLISH_RELATED_ASSETS = Yes, I would
expect assets 21710, 9255, and 9256 to be published as well. If that's
not the behavior you are seeing, can you confirm a few circumstances?

- Assets 21710, 9255, and 9256 are not checked out or "lost" (remember
your lost story from the other day?)
- Assets 21710, 9255, and 9256 are publishable on their own, i.e. they
don't fail when you try to publish each individually
- Assets 21710, 9255, and 9256 *are on a publish desk*
- There appears to be no error output in your bric_queued.log regarding
these assets

You may be affected by the following bug which would cause your related
assets' publish jobs to fail silently:
http://bricolage.lighthouseapp.com/projects/29601/tickets/277

-Nick


zdravko.balorda at siix

Jan 20, 2012, 5:39 AM

Post #9 of 18 (1887 views)
Permalink
Re: publishing related assets [In reply to]

Nick Legg III wrote:
> Zdravko,
>
> When you publish story 9257 with PUBLISH_RELATED_ASSETS = Yes, I would
> expect assets 21710, 9255, and 9256 to be published as well. If that's
> not the behavior you are seeing, can you confirm a few circumstances?

Nick, hi!
I saw this working in the past, too, not so long ago. :)

> - Assets 21710, 9255, and 9256 are not checked out or "lost" (remember
> your lost story from the other day?)

Everything is there.

> - Assets 21710, 9255, and 9256 are publishable on their own, i.e. they
> don't fail when you try to publish each individually

Yes, I can republish each one individually.

> - Assets 21710, 9255, and 9256 *are on a publish desk*

They are all moved to Shelve (archive desk).

> - There appears to be no error output in your bric_queued.log regarding
> these assets

error.log is clean.

It works exactly as if PUBLISH_RELATED_ASSETS = No but it's set to Yes.
For what's it worth: $burner->publish_another gets called from a template
and is working. Cover page is published. But this is not relevant.

> You may be affected by the following bug which would cause your related
> assets' publish jobs to fail silently:
> http://bricolage.lighthouseapp.com/projects/29601/tickets/277

I looked at this, but I can't really relate. Because it's just plain dead and
I don't have a clue what is wrong, yet.

Regards, Zdravko


david at justatheory

Jan 20, 2012, 9:15 AM

Post #10 of 18 (1879 views)
Permalink
Re: publishing related assets [In reply to]

On Jan 20, 2012, at 5:39 AM, Zdravko Balorda wrote:

> It works exactly as if PUBLISH_RELATED_ASSETS = No but it's set to Yes.
> For what's it worth: $burner->publish_another gets called from a template
> and is working. Cover page is published. But this is not relevant.

Did you recently change PUBLISH_RELATED_ASSETS to Yes and not restart Bricolage?

Best,

David


ps at phillipadsmith

Jan 20, 2012, 10:01 AM

Post #11 of 18 (1884 views)
Permalink
Re: publishing related assets [In reply to]

On 2012-01-20, at 11:15 AM, David E. Wheeler wrote:

> On Jan 20, 2012, at 5:39 AM, Zdravko Balorda wrote:
>
>> It works exactly as if PUBLISH_RELATED_ASSETS = No but it's set to Yes.
>> For what's it worth: $burner->publish_another gets called from a template
>> and is working. Cover page is published. But this is not relevant.
>
> Did you recently change PUBLISH_RELATED_ASSETS to Yes and not restart Bricolage?

Ha! That was the first question I was going to ask, but I forgot to ask it. :)

--
Phillip Smith
http://phillipadsmith.com
http://twitter.com/phillipadsmith
http://linkedin.com/in/phillipadsmith

Save our in-boxes! http://emailcharter.org


zdravko.balorda at siix

Jan 22, 2012, 10:23 PM

Post #12 of 18 (1882 views)
Permalink
Re: publishing related assets [In reply to]

Phillip Smith wrote:
> On 2012-01-20, at 11:15 AM, David E. Wheeler wrote:
>
>> On Jan 20, 2012, at 5:39 AM, Zdravko Balorda wrote:
>>
>>> It works exactly as if PUBLISH_RELATED_ASSETS = No but it's set to Yes.
>>> For what's it worth: $burner->publish_another gets called from a template
>>> and is working. Cover page is published. But this is not relevant.
>> Did you recently change PUBLISH_RELATED_ASSETS to Yes and not restart Bricolage?
>
> Ha! That was the first question I was going to ask, but I forgot to ask it. :)

:)
Well, I must say I can't recall ever changing ti from Yes. But, just in case,
I checked:

bric_soap workflow publish story_9255 --with-related-media --with-related-stories

this time twice: with PUBLISH_RELATED_ASSETS = Yes, and with no. (while restarting
bric_apache)

Both times only the leading story appeared in the job queue even though this story also
has two related stories and one related media.

Looking forward to hearing from you, Zdravko


david at kineticode

Jan 22, 2012, 10:49 PM

Post #13 of 18 (1881 views)
Permalink
Re: publishing related assets [In reply to]

On Jan 22, 2012, at 10:23 PM, Zdravko Balorda wrote:

> :)
> Well, I must say I can't recall ever changing ti from Yes. But, just in case,
> I checked:
>
> bric_soap workflow publish story_9255 --with-related-media --with-related-stories

Oh, did you mention before you were doing it via SOAP? I dont think the SOAP interface does anything with PUBLISH_RELATED_ASSETS. Though obviously it ought to.

What happens if you publish that story via the UI?

Best,

David


zdravko.balorda at siix

Jan 24, 2012, 2:52 AM

Post #14 of 18 (1863 views)
Permalink
Re: publishing related assets [In reply to]

David E. Wheeler wrote:
> On Jan 22, 2012, at 10:23 PM, Zdravko Balorda wrote:
>
>> :)
>> Well, I must say I can't recall ever changing ti from Yes. But, just in case,
>> I checked:
>>
>> bric_soap workflow publish story_9255 --with-related-media --with-related-stories
>
> Oh, did you mention before you were doing it via SOAP? I dont think the SOAP interface does anything with PUBLISH_RELATED_ASSETS. Though obviously it ought to.
>
> What happens if you publish that story via the UI?

UI, too. Please, here is what I have found in
/usr/local/bricolage/lib/Bric/App/Callback/Publish.pm

# Examine all the related objects.


if (PUBLISH_RELATED_ASSETS) {
foreach my $rel ($doc->get_related_objects) {
# Skip assets that don't need to be published.


next unless $rel->needs_publish;

According to this, related assets are published only if needs_publish is true.
Since stories don't need to be published, it silently skips them.
is this really expected behavior? Even for media files?

Regards, Zdravko


leggn at denison

Jan 24, 2012, 5:08 AM

Post #15 of 18 (1867 views)
Permalink
Re: publishing related assets [In reply to]

On Tue, Jan 24, 2012 at 5:52 AM, Zdravko Balorda
<zdravko.balorda [at] siix>wrote:

> /usr/local/bricolage/lib/Bric/App/Callback/Publish.pm
>
> # Examine all the related objects.
>
> if (PUBLISH_RELATED_ASSETS) {
> foreach my $rel ($doc->get_related_objects) {
> # Skip assets that don't need to be published.
>
> next unless $rel->needs_publish;
>
> According to this, related assets are published only if needs_publish is
> true.
> Since stories don't need to be published, it silently skips them.
> is this really expected behavior? Even for media files?
>

So if you modify one of your related stories and check it in, then
republish your "origin" story. I think you'll find that both stories are
published.

I think this is expected behavior. Bricolage tries to spare itself some
unnecessary work here. Suppose the following scenario:

> Story A contains a relation (link to) Story B. Story B has been published
> in the past and hasn't been updated since. Story B has no relation back to
> Story A so regardless of whether Story A's slug changes (or other
> circumstance) Story B still doesn't need to republish.
>

If you have a more complex relationship between your stories where one
story being published requires that all stories it links to (or that link
to it) also be republished (regardless of whether these related stories are
marked as *needs published*) then you'll have to handle that in your
template(s).

In our site, we want to republish both stories that *link to* Story A and
stories that are *linked from* Story A. Our solution triggers a number of
"unnecessary" republishes, but nicely handles cases where URIs change and
updates related and reverse-related assets. Our autohandler contains the
following code to accomplish this:

> <%cleanup>
> return if $burner->get_mode != PUBLISH_MODE ||
> $burner->notes('in_another');
> $burner->notes(in_another => 1);
> $burner->publish_another($_) for ref($story)->list({
> related_story_id => $story->get_id,
> exclude_id => $story->get_id,
> active => 1,
> unexpired => 1,
> published_version => 1,
> });
> $burner->notes(in_another => 0);
> </%cleanup>
>

-Nick


zdravko.balorda at siix

Jan 24, 2012, 5:29 AM

Post #16 of 18 (1870 views)
Permalink
Re: publishing related assets [In reply to]

Nick, yes, indeed. I've been trying to publish old stories...
It just works, nicely. Thanks.
Suddenly I feel much better. :)

Anyway, since user can't manipulate needs_publish, it seems better
to publish regardless and let the bric_queued figure the unnecessary
(repeated) publishes. Which it does excellently. Or can I somehow fire
needs_publish condition by myself?

Best regards, Zdravko

Nick Legg III wrote:
> On Tue, Jan 24, 2012 at 5:52 AM, Zdravko Balorda
> <zdravko.balorda [at] siix>wrote:
>
>> /usr/local/bricolage/lib/Bric/App/Callback/Publish.pm
>>
>> # Examine all the related objects.
>>
>> if (PUBLISH_RELATED_ASSETS) {
>> foreach my $rel ($doc->get_related_objects) {
>> # Skip assets that don't need to be published.
>>
>> next unless $rel->needs_publish;
>>
>> According to this, related assets are published only if needs_publish is
>> true.
>> Since stories don't need to be published, it silently skips them.
>> is this really expected behavior? Even for media files?
>>
>
> So if you modify one of your related stories and check it in, then
> republish your "origin" story. I think you'll find that both stories are
> published.
>
> I think this is expected behavior. Bricolage tries to spare itself some
> unnecessary work here. Suppose the following scenario:
>
>> Story A contains a relation (link to) Story B. Story B has been published
>> in the past and hasn't been updated since. Story B has no relation back to
>> Story A so regardless of whether Story A's slug changes (or other
>> circumstance) Story B still doesn't need to republish.
>>
>
> If you have a more complex relationship between your stories where one
> story being published requires that all stories it links to (or that link
> to it) also be republished (regardless of whether these related stories are
> marked as *needs published*) then you'll have to handle that in your
> template(s).
>
> In our site, we want to republish both stories that *link to* Story A and
> stories that are *linked from* Story A. Our solution triggers a number of
> "unnecessary" republishes, but nicely handles cases where URIs change and
> updates related and reverse-related assets. Our autohandler contains the
> following code to accomplish this:
>
>> <%cleanup>
>> return if $burner->get_mode != PUBLISH_MODE ||
>> $burner->notes('in_another');
>> $burner->notes(in_another => 1);
>> $burner->publish_another($_) for ref($story)->list({
>> related_story_id => $story->get_id,
>> exclude_id => $story->get_id,
>> active => 1,
>> unexpired => 1,
>> published_version => 1,
>> });
>> $burner->notes(in_another => 0);
>> </%cleanup>
>>
>
> -Nick
>


--
Zdravko Balorda
Med.Over.Net
Jurčkova 229, Ljubljana

Tel.: +386 (0)1 520 50 50

Obiščite sistem zdravstvenih nasvetov Med.Over.Net


leggn at denison

Jan 24, 2012, 5:47 AM

Post #17 of 18 (1865 views)
Permalink
Re: publishing related assets [In reply to]

On Tue, Jan 24, 2012 at 8:29 AM, Zdravko Balorda
<zdravko.balorda [at] siix>wrote:

> Or can I somehow fire needs_publish condition by myself?
>

Possibly. According to the API:

$asset->needs_publish() Compares current_version and published_version from
> asset table. If the same, needs_publish returns 0. If different, returns 1.


So if you manipulate current_version (probably a bad idea) or
published_version (probably a slightly less bad idea) on the story it might
"trick" needs_publish() into returning 1.

But I still recommend using publish_another() to accomplish your goal since
the above seems tenuous at best.

Regards,
Nick


david at justatheory

Jan 24, 2012, 8:50 AM

Post #18 of 18 (1863 views)
Permalink
Re: publishing related assets [In reply to]

On Jan 24, 2012, at 2:52 AM, Zdravko Balorda wrote:

> UI, too. Please, here is what I have found in
> /usr/local/bricolage/lib/Bric/App/Callback/Publish.pm
>
> # Examine all the related objects.
> if (PUBLISH_RELATED_ASSETS) {
> foreach my $rel ($doc->get_related_objects) {
> # Skip assets that don't need to be published.
> next unless $rel->needs_publish;
>
> According to this, related assets are published only if needs_publish is true.
> Since stories don't need to be published, it silently skips them.
> is this really expected behavior? Even for media files?

Yes. The assumption is, if you havent changed the story or media document, there is no reason to republish it.

Best,

David

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.