Adobe 65007312 Programming Guide - Page 74

Defining a metadata tagset, inserts a dividing line in the Metadata panel before the first

Page 74 highlights

CHAPTER 4: Working with Metadata Adding custom metadata tagsets 74 The metadata-tagset provider can appear in the same plug-in with export-service and export-filter providers, and with simple Metadata Providers. The metadata-tagset provider is a Lua file that returns a tagset definition. You can use the LrMetadataTagsetFactory entry to specify more than one such file in a single plug-in. For example: LrMetadataTagsetFactory = { 'Tagset1.lua', 'Tagset2.lua', 'Tagset3.lua' }, Defining a metadata tagset Each tagset definition file must return a table listing the fields that should appear in the Metadata panel when that tagset is selected. The file can return an array of such tables to define multiple tagsets. The table contains these entries: id title items string string table Required. An identifier for this tagset that is unique within this plug-in. The name must conform to the same naming conventions as Lua variables; that is, it must start with a letter, followed by letters or numbers. Case is significant. Required. The localizable display name of the tagset, which appears in the popup menu for the Metadata panel. Required. An array of metadata fields that appear in this tagset, in order of appearance. Each entry in the items array identifies a field to be included in the Metadata menu. It can be a simple string specifying the field name, or an array that specifies the field name and additional information about that field: fieldname label string string The first element in the array is the unique identifying name of the field, or one of the special values described below. Optional. When the field name is the special value 'com.adobe.label', this is the localizable string to use as the section label. Certain special values are defined for field names. See the API Reference documentation for metadata plug-in-defined functions, and the metadata sample plug-in. X You can include all visible metadata from a plug-in by specifying the field name with the wild-card character "*"; for example, "com.mycompany.uploader.*". The visible fields are included in the sequence in which they are defined in the definition script. The fields for each plug-in are preceded by a dividing line and the plug-in's name. If you refer to a plug-in that is missing or that defines no visible metadata, it is not an error; the block and separator for that plug-in are simply not displayed. X You can include all visible metadata from a plug-in by specifying the special field name "com.adobe.allPluginMetadata". This is the field name used by the built-in "All Plug-in Metadata" preset. X The special name 'com.adobe.separator' inserts a dividing line in the Metadata panel before the first field from this plug-in.

  • 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 tagsets
74
The metadata-tagset provider can appear in the same plug-in with export-service and export-filter
providers, and with simple Metadata Providers.
The metadata-tagset provider is a Lua file that returns a tagset definition. You can use the
LrMetadataTagsetFactory
entry to specify more than one such file in a single plug-in. For example:
LrMetadataTagsetFactory = { 'Tagset1.lua', 'Tagset2.lua', 'Tagset3.lua' },
Defining a metadata tagset
Each tagset definition file must return a table listing the fields that should appear in the Metadata panel
when that tagset is selected. The file can return an array of such tables to define multiple tagsets.
The table contains these entries:
Each entry in the
items
array identifies a field to be included in the Metadata menu. It can be a simple
string specifying the field name, or an array that specifies the field name and additional information about
that field:
Certain special values are defined for field names. See the API Reference documentation for metadata
plug-in-defined functions, and the metadata sample plug-in.
X
You can include all visible metadata from a plug-in by specifying the field name with the wild-card
character "
*
"; for example, "
com.mycompany.uploader.*
". The visible fields are included in the
sequence in which they are defined in the definition script. The fields for each plug-in are preceded by
a dividing line and the plug-in’s name.
If you refer to a plug-in that is missing or that defines no visible metadata, it is not an error; the block
and separator for that plug-in are simply not displayed.
X
You can include all visible metadata from a plug-in by specifying the special field name
"
com.adobe.allPluginMetadata
". This is the field name used by the built-in "All Plug-in Metadata"
preset.
X
The special name '
com.adobe.separator
' inserts a dividing line in the Metadata panel before the first
field from this plug-in.
id
string
Required. An identifier for this tagset that is unique within this plug-in. The
name must conform to the same naming conventions as Lua variables; that is,
it must start with a letter, followed by letters or numbers. Case is significant.
title
string
Required. The localizable display name of the tagset, which appears in the
popup menu for the Metadata panel.
items
table
Required. An array of metadata fields that appear in this tagset, in order of
appearance.
fieldname
string
The first element in the array is the unique identifying name of the field,
or one of the special values described below.
label
string
Optional. When the field name is the special value '
com.adobe.label
',
this is the localizable string to use as the section label.