Adobe 65007312 Programming Guide - Page 35

Creating Export and Publish Services, Defining an export service

Page 35 highlights

3 Creating Export and Publish Services Plug-ins can customize Lightroom's export and publish behavior. You can: X Create an Export Filter that modifies a photo after Lightroom performs the initial rendering, but before it is passed to it final export destination. X Alter the rendering process, or define post-processing actions for rendered photos. X Send rendered images to locations other than files on the local computer. X Customize the Export and Publishing Manager dialogs by adding or removing sections. Creating an export or publish service Lightroom offers two customizable mechanisms for transferring photos to an external location: export and publish. X Export is a one-time operation: the user selects some photos, the photos are rendered once and transferred to their destination. Lightroom maintains no further record of the export (although some plug-ins do retain such a record via custom metadata). By default, Lightroom provides export services for a user-selected location on the local hard drive and CD/DVD drive. Plug-ins can define export services to extend this support to other destinations (typically web services or devices). See "Defining an export service" on page 35. X Publish is similar to export, but represents an ongoing relationship between Lightroom and the destination. You publish a collection (or many collections) of photos to a location when you want them to stay up to date as you change the photos. To publish, the user establishes a connection to a destination (typically, but not necessarily, a web service) in the Publishing Manager dialog. By default, Lightroom provides publish service support for user-selected locations on the local hard drive and Flickr. As with export services, plug-ins can define publish services to extend this support to other destinations. See "Defining a publish service" on page 39. Though they are presented differently, there is a lot in common between these two mechanisms and they share much of the same API. Export services are the simpler of the two, so we'll start by describing this API, then describe additional functionality that is specific to publish services. Defining an export service To define the functionality of your export service, write a Lua script that returns a table; each predefined entry in the table describes a specific type of customization. You then declare the name of your service and associate it with the defining script, in the same way you declare any plug-in. To declare an Export Service Provider, add the following block to your Info.lua file: LrExportServiceProvider = { title = "Service Name", -- this string appears as the Export destination file = "MyExportServiceProvider.lua", -- the service definition script builtInPresetsDir = "myPresets", -- an optional subfolder for presets }, 35

  • 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

35
3
Creating Export and Publish Services
Plug-ins can customize Lightroom's export and publish behavior. You can:
X
Create an Export Filter that modifies a photo after Lightroom performs the initial rendering, but before
it is passed to it final export destination.
X
Alter the rendering process, or define post-processing actions for rendered photos.
X
Send rendered images to locations other than files on the local computer.
X
Customize the Export and Publishing Manager dialogs by adding or removing sections.
Creating an export or publish service
Lightroom offers two customizable mechanisms for transferring photos to an external location:
export
and
publish
.
X
Export
is a one-time operation: the user selects some photos, the photos are rendered once and
transferred to their destination. Lightroom maintains no further record of the export (although some
plug-ins do retain such a record via custom metadata). By default, Lightroom provides export services
for a user-selected location on the local hard drive and CD/DVD drive. Plug-ins can define export
services to extend this support to other destinations (typically web services or devices). See
“Defining
an export service” on page 35
.
X
Publish
is similar to export, but represents an ongoing relationship between Lightroom and the
destination. You publish a collection (or many collections) of photos to a location when you want
them to stay up to date as you change the photos. To publish, the user establishes a connection to a
destination (typically, but not necessarily, a web service) in the Publishing Manager dialog. By default,
Lightroom provides publish service support for user-selected locations on the local hard drive and
Flickr. As with export services, plug-ins can define publish services to extend this support to other
destinations. See
“Defining a publish service” on page 39
.
Though they are presented differently, there is a lot in common between these two mechanisms and they
share much of the same API. Export services are the simpler of the two, so we’ll start by describing this API,
then describe additional functionality that is specific to publish services.
Defining an export service
To define the functionality of your export service, write a Lua script that returns a table; each predefined
entry in the table describes a specific type of customization. You then declare the name of your service and
associate it with the defining script, in the same way you declare any plug-in.
To declare an Export Service Provider, add the following block to your
Info.lua
file:
LrExportServiceProvider = {
title = "Service Name",
-- this string appears as the Export destination
file = "MyExportServiceProvider.lua",
-- the service definition script
builtInPresetsDir = "myPresets", -- an optional subfolder for presets
},