Class LrPublishService

This class provides access to a named publishing service and its member collections and collection sets. The service contains the collections of photos to be published, which are represented by separate collection objects. Photos that have been selected for publication are contained in LrPublishedCollection objects, and those collections can be nested in LrPublishedCollectionSet objects.

Access the functions and properties from the object. Retrieve the objects for all the publish services by calling LrCatalog:getPublishServices().

Summary

publishService:createPublishedCollection( name, parent, canReturnExisting )
Creates a new published collection in this publish service.
publishService:createPublishedCollectionSet( name, parent, canReturnExisting )
Creates a new collection set in this publish service.
publishService:createPublishedSmartCollection( name, searchDesc, parent, canReturnExisting )
Creates a new published smart collection in this publish service.
Retrieves the photo collection sets that are immediate children of this service.
Retrieves the photo collections that are immediate children of this service.
Retrieves the current name of the publish service.
Retrieves the unique identifier for the plug-in to which this service belongs.
Retrieves the current plug-in defined settings for the publish service.
Reports the type of this object.
(LrCatalog) The catalog object that contains this publish service.
(number) The local identifier of the publish service, unique within the catalog.

Functions

publishService:createPublishedCollection( name, parent, canReturnExisting )
Creates a new published collection in this publish service. This is the equivalent of creating a published collection in the Publish Services panel without including selected photos or creating virtual copies.

Must be called from within one of the catalog:with___WriteAccessDo gates.

First supported in version 3.0 of the Lightroom SDK.

Parameters

1. name
(string) The name of the new published collection.
2. parent
(optional, LrPublishedCollectionSet) The parent of the new collection, or nil to create at the top level of this publish service.
3. canReturnExisting
(optional, Boolean) True to return an existing published collection with this name, otherwise return nil if such a collection exists.

Return value

(LrPublishedCollection) On success, the new pulished collection object. If a collection with this name (case insensitive) already exists, nil (if optCanReturnExisting is false) or that collection object. If a collection set with this name (case insensitive) already exists, nil.
publishService:createPublishedCollectionSet( name, parent, canReturnExisting )
Creates a new collection set in this publish service.

Must be called from within one of the catalog:with___WriteAccessDo gates.

First supported in version 3.0 of the Lightroom SDK.

Parameters

1. name
(string) The name of the new collection set.
2. parent
(optional, LrPublishedCollectionSet) The parent of the new collection set, or nil to create at the top level of this publish service.
3. canReturnExisting
(optional, Boolean) True to return an existing published collection set with this name, otherwise return nil if such a collection set exists.

Return value

(LrPublishedCollectionSet) On success, the new published collection set object. If a collection set with this name (case insensitive) already exists, nil (if optCanReturnExisting is false) or that collection set object. If a collection with this name (case insensitive) already exists, nil.
publishService:createPublishedSmartCollection( name, searchDesc, parent, canReturnExisting )
Creates a new published smart collection in this publish service. This is the equivalent of creating a published smart collection in the Publish Services panel.

Must be called from within one of the catalog:with___WriteAccessDo gates.

First supported in version 3.0 of the Lightroom SDK.

Parameters

1. name
(string) The name of the new published smart collection.
2. searchDesc
(table) A search descriptor that defines what metadata fields to search, and how to match against a given value. See LrCatalog:findPhotos() for details. The default value for the "combine" field is "intersect".
3. parent
(optional, LrPublishedCollectionSet) The parent of the new collection, or nil to create at the top level of this publish service.
4. canReturnExisting
(optional, Boolean) True to return an existing published collection with this name, otherwise return nil if such a collection exists.

Return value

(LrPublishedCollection) On success, the new pulished collection object. If a collection with this name (case insensitive) already exists, nil (if optCanReturnExisting is false) or that collection object. If a collection set with this name (case insensitive) already exists, nil.
publishService:getChildCollectionSets()
Retrieves the photo collection sets that are immediate children of this service.

This function must be called from within an asynchronous task started using LrTasks.

First supported in version 3.0 of the Lightroom SDK.

Return value

(array of LrPublishedCollectionSet)The contained collection-set objects.
publishService:getChildCollections()
Retrieves the photo collections that are immediate children of this service. Does not recurse into collection sets.

This function must be called from within an asynchronous task started using LrTasks.

First supported in version 3.0 of the Lightroom SDK.

Return value

(array of LrPublishedCollection) The contained collection objects.
publishService:getName()
Retrieves the current name of the publish service.

This function must be called from within an asynchronous task started using LrTasks.

First supported in version 3.0 of the Lightroom SDK.

Return value

(string) The name.
publishService:getPluginId()
Retrieves the unique identifier for the plug-in to which this service belongs. Note that if the plug-in's LrExportServiceProvider definition is a table of tables, the plug-in id returned by this function will have a '.' followed by a number appended to it. The number corresponds to the export service provider to which this service belongs.

This function must be called from within an asynchronous task started using LrTasks.

First supported in version 3.0 of the Lightroom SDK.

Return value

(string) The plug-in ID.
publishService:getPublishSettings()
Retrieves the current plug-in defined settings for the publish service. This is the same block of data that can be edited via the user interface if your plug-in implements the viewForCollectionSettings hook. See LrPublishedCollection:setCollectionSettings()

This function must be called from within an asynchronous task started using LrTasks.

First supported in version 3.0 of the Lightroom SDK.

Return value

(table) The settings.
publishService:type()
Reports the type of this object.

First supported in version 3.0 of the Lightroom SDK.

Return value

(string) 'LrPublishService'.

Properties

publishService.catalog : (Read-Only)
(LrCatalog) The catalog object that contains this publish service.

First supported in version 3.0 of the Lightroom SDK.

See also: LrCatalog
publishService.localIdentifier : (Read-Only)
(number) The local identifier of the publish service, unique within the catalog.

First supported in version 3.0 of the Lightroom SDK.