Get all collected items within publish plugin

Hi,

I’m looking for a way to access all the collected files from the desktop publisher app.
Is there a way to do that within the context of the plugin (ie publish_file.py)?

1 Like

Hello, I believe the answer is no. As I understand it, the collector collects all publish items, but they’re passed individually to publish plugins. On the other hand, the Post Phase hook’s post_publish() method runs once after all of the publishes have taken place, so it takes the entire publish tree as an argument.

I’m going to flag this one to run past an engineer, in case there’s something I’m not seeing, but as far as I can tell, your best bet for accessing all collected items is the Post Phase hook.

1 Like

Hey! Just wanted to let you know that I got some corroboration on what I’d written last week from the engineering team. If you can give us some details on what your end goal is here, maybe we can suggest a better way to achieve it?

1 Like

Aaand one more update (with better news this time!):

You can actually get to the whole tree from any item.

PublishItem has a parent which itself is a PublishItem. So you can traverse up the tree until you hit the root (determined by querying the is_root property, and then from the root, you can get the immediate children, or all descendants.

Hope that helps!

3 Likes

Oh, cool! I’ll have to try that out.
I’m testing some ways to create a version entity that links to multiple different published files that share the same version number. As such I need to keep tabs on what’s already been published, etc.

3 Likes