Adobe 65007312 Programming Guide - Page 72
The user-visible custom fields from plug-ins are shown after all of
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 72 highlights
CHAPTER 4: Working with Metadata Adding custom metadata 72 title = LOC "$$$/Sample/Fields/ModelRelease/NotSure=Not Sure", }, { value = 'yes', title = LOC "$$$/Sample/Fields/ModelRelease/Yes=Yes", }, { value = 'no', title = LOC "$$$/Sample/Fields/ModelRelease/No=No", }, -- optional: allowPluginToSetOtherValues = true, }, }, }, schemaVersion = 1, -- must be a number, preferably a positive integer updateFromEarlierSchemaVersion = function( catalog, previousSchemaVersion, progressScope ) -- When the plug-in is first installed, previousSchemaVersion is nil. -- As of Lightroom version 3.0, a progress-scope variable is available; you can -- use it to signal progress for your upgrader function. -- Note: This function is called from within a catalog:withPrivateWriteAccessDo -- block. You should not call any of the with___Do functions yourself. catalog:assertHasPrivateWriteAccess( "SampleMetadataDefinition.updateFromEarlierSchemaVersion" ) local myPluginId = 'com.adobe.lightroom.metadata.sample' if previousSchemaVersion == 1 then local photosToMigrate = catalog:findPhotosWithProperty( myPluginId,'siteId') -- optional: can add property version number here for i, photo in ipairs( photosToMigrate ) do local oldSiteId = photo:getPropertyForPlugin( myPluginId, 'siteId' ) -- add property version here if used above local newSiteId = "new:" .. oldSiteId -- replace this with whatever data transformation you need to do photo:setPropertyForPlugin( _PLUGIN, 'siteId', newSiteId ) end elseif previousSchemaVersion == 2 then -- and so on... end end, } This is how these fields appear in the Metadata panel, when the user has chosen a metadata tagset that contains them, or one of the default metadata tagsets "All" or "All Plug-in Metadata" (see "Adding custom metadata tagsets" on page 73). The user-visible custom fields from plug-ins are shown after all of the built-in metadata fields.