Adobe 65007312 Programming Guide - Page 38
Initialization and termination functions for services, Publish Service
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 38 highlights
CHAPTER 3: Creating Export and Publish Services Defining an export service 38 Initialization and termination functions for services You can provide functions to be called when a post-process action or export destination defined by your plug-in is selected or deselected in the Export or Publishing Manager dialog. To do so, the service definition script for your Export Filter Provider or Export Service Provider should return these table entries, which contain the function definitions: startDialog = function( propertyTable ) ... end, endDialog = function( propertyTable, why ) ... end, X The startDialog function is called when the user chooses a post-process action or export destination provided by this plug-in in the Export dialog, or when the destination is already selected when the dialog is invoked, remembered from the previous export operation. X The endDialog function is called when the user deselects the action or export destination in the Export dialog, or dismisses the Export dialog. NOTE: Similar entries can be supplied by a Plug-in Info Provider, although the definitions are slightly different. Functions defined in a Plug-in Info Provider are executed only when the plug-in is selected in the Plug-in Manager dialog, never from the Export dialog. See "Initialization and termination functions for the Plug-in Manager" on page 31. The propertyTable parameter for both functions is a table which contains the most recent settings for your export plug-in, including both settings that you have defined and Lightroom-defined export settings (see "Remembering user choices" on page 57). When your plug-in is being used as a publish service provider, the property table contains additional values that tell you about the publishing status; see "Publish Service properties" on page 67. When your plug-in is deactivated, Lightroom calls your endDialog function with why set to one of the following string values: changedServiceProvider A different Export Service Provider was chosen as the export or publish destination. Your plug-in is no longer active. ok The user clicked the "Export" or "Save" button. The Export or Publishing Manager dialog has closed. X For an export service, Lightroom begins exporting images through your plug-in. Do not attempt to start uploading photos at this point; use the processRenderedPhotos callback function to do that. See "Customizing the Export and Publishing Manager dialogs" on page 52. X For a publish service, Lightroom creates a new publish service in the Publish Services panel that can be used later to publish images through your plug-in. cancel The user clicked the "Cancel" button and the Export or Publishing Manager dialog has closed without initiating the operation. These are blocking calls. If you need to start a long-running task (such as network access), create a task using the LrTasks namespace. See "Defining function contexts and tasks" on page 20.