Adobe 65007312 Programming Guide - Page 38

Initialization and termination functions for services, Publish Service

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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204

C
HAPTER
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.
N
OTE
:
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:
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
.
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.