Copy link to clipboard
Copied
Hi.
could you please help me to solve such a problem
I have publish service with structured collection set:
My goal is to publish all collection set even if user selects child collection (like it shows on the screenshot). Second variant is to show notification for user that he should select 'Collection set' before pressing publish (if he selected it Lightroom will publish all collections as i want). I'm working on second variant and cant figure out how to check if we publishing one collection instead of collection set.
The LrExportContext object passed by LR to your processRenderedPhotos() contains the field "publishedCollectionInfo", which provides information about the LrPublishedCollection being published. I'm not sure what it contains when the user has selected a collection set and click Published. But you could set a breakpoint in the debugger and see what it contains in that instance.
If the information in "publishedCollectionInfo" does allow you to distinguish between when the user has selected a colle
...Copy link to clipboard
Copied
The LrExportContext object passed by LR to your processRenderedPhotos() contains the field "publishedCollectionInfo", which provides information about the LrPublishedCollection being published. I'm not sure what it contains when the user has selected a collection set and click Published. But you could set a breakpoint in the debugger and see what it contains in that instance.
If the information in "publishedCollectionInfo" does allow you to distinguish between when the user has selected a collection versus a collection set, the service's processRenderedPhotos() function can check that, open a message dialog, and then raise an error to terminate the publishing operation.
If "publishedCollectionInfo" doesn't allow you to distinguish when the user has selected a collection, another approach would be to require the user to publish using a Library menu command, e.g. Library > Plug-in Extras > My Publish. This command call catalog:getActiveSources() to determine whether a collection or collection set has been selected, raising an error if a collection is selected. It would then set a global flag and call collection:publishNow() for each collection contained in the selected collection set. The service's processRenderedPhotos() function would check for the global flag -- if it's false, that means the user has clicked on Pubish directly, and you can raise an error.
Copy link to clipboard
Copied
Thank you!