Adobe 65007312 Programming Guide - Page 69

Defining metadata fields, The function takes three parameters

Page 69 highlights

CHAPTER 4: Working with Metadata Adding custom metadata 69 Defining metadata fields The script for your Metadata Provider defines specific metadata fields. The metadata definition script returns a table that describes the fields to be added to Lightroom's metadata schema. It contains the following fields: metadataFieldsForPhotos table schemaVersion number updateFromEarlierSchemaVersion function noAutoUpdate Boolean Required. Defines new data fields to be stored for each photo. The table is an array of field definitions. Each entry in the metadataFieldsForPhotos array describes a single field which can be associated with photos in the catalog. Each field can hold only one value per photo. See "Metadata field entries" on page 70. Required. Allows for versioning of the property definition schema. Typically this number starts at 1 and you increment it whenever you release a new version of the schema or need to run the update function. Optional. Allows your plug-in to update data when a new schema version is in place. The function takes three parameters; catalog, previousSchemaVersion, and progressScope. When the plug-in is first installed, previousSchemaVersion is nil. See example below. Optional. When false (the default), Lightroom attempts to automatically update metadata from old field definitions to new. If you prefer to handle this in your own plug-in (using the updateFromEarlierSchemaVersion callback), set this to true.

  • 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
4: Working with Metadata
Adding custom metadata
69
Defining metadata fields
The script for your Metadata Provider defines specific metadata fields. The metadata definition script
returns a table that describes the fields to be added to Lightroom's metadata schema. It contains the
following fields:
metadataFieldsForPhotos
table
Required. Defines new data fields to be stored for
each photo.
The table is an array of field definitions. Each entry
in the
metadataFieldsForPhotos
array describes a
single field which can be associated with photos in
the catalog. Each field can hold only one value per
photo.
See
“Metadata field entries” on page 70
.
schemaVersion
number
Required. Allows for versioning of the property
definition schema. Typically this number starts at 1
and you increment it whenever you release a new
version of the schema or need to run the update
function.
updateFromEarlierSchemaVersion
function
Optional. Allows your plug-in to update data when
a new schema version is in place.
The function takes three parameters;
catalog
,
previousSchemaVersion
, and
progressScope
.
When the plug-in is first installed,
previousSchemaVersion
is nil.
See example below.
noAutoUpdate
Boolean
Optional. When false (the default), Lightroom
attempts to automatically update metadata from
old field definitions to new. If you prefer to handle
this in your own plug-in (using the
updateFromEarlierSchemaVersion
callback), set
this to true.