Setting Up media import from an image bank
As from 2022.6.0, it will be possible to import bought media licenses from an image bank, directly to the DAM. This is allowed by the plugin : PACKAGED_ImgBank.
In order to use it, first we have to set the plugin parameters correctly according to our image bank account and our import wishes : periodic import, one-time import, only videos, alll media types, media property mapping, etc…
Then we can launch the import process.
PACKAGED_ImgBank needs features from WXM_RESTAPI which have been brought with 2022.6.0, therefore it can not be used on versions below 2022.6.0.
1/ Instructions : Setting the plugin parameters
destination_library => Destination media library for the imported media
destination_asset_status => Id of the target status for the imported media
source_image_bank => JSON Array describing the access tokens which have to be used for the authentication part during the media data retrieval. We can set multiple access tokens, each access token must have a “type” which is the image bank to which it is related. Example of value for the parameter :
[
{
"type": "shutterstock",
"token": "XXXXxxxxXXXX"
},
{
"type": "shutterstock",
"token": "WONT_WORK"
},
{
"type": "getty",
"token": "testing"
}
]
mediadata_mapping => JSON Object describing a mapping for the retrieved data from the image bank. The new assets created in the dam, will recieve information from the image bank according to the mapping config. Example of value for the parameter :
{
"description": "description",
"contributor": {
"id": "photograph.externalid",
"display_name": "photograph.name"
},
"keywords": "ai_concepts"
}
As we can see, there is complex mapping and simple mapping.
In the left part of the JSON Object we are using the property names used by the image bank.
In this case, shutterstock’s media’s description, contributor and keywords are retrieved and written on the new asset.
In the right part of the JSON Object we are using the property names of the target properties on the destination media library.
In this case the asset will be created with asset.description, with asset.photograph and with asset.ai_concepts already set, and comming from the image bank.
The retrieval of boolean values or date values from the image bank is not supported by this first version of the plugin
If the asset prop set in the config is a child or a cmlr, we have to search or create a new metadata instance and attach it to the asset.
For a simple mapping, the search/creation is done by the name property of the metadata structure. In our case, for each image bank keyword retrieved which is not already present in our database under ai_concepts’s structure : assetiaconcept (search by name) we will create a new instance by setting the name (only) found/received from the image bank as media data.
If an instance with the same name is already present in our data base, we will not create it, but only return the id of the existing instance.
For a complex mapping, we will first do the search/create by the id mapped prop if it is used in the left part of the config, if not, we will do the search/create by the code mapped prop if it is used in the left part of the config, if not we will do the search/create by the name mapped prop if it is used in the left part of the config. And if neither of the three props are decribed in the left part of a complex mapping, then we will do nothing, and a warning will be raised (log).
In our case, we will create a new instance of photograph (assetauthor) if the search by assetauthor.externalid returns nothing. Assetauthor.externalid is used for the search, because it is the destination of the id value from the image bank.
imgBank_name_wearing_prop => Property which will bear the source information about the imported media on the newly created asset.
This parameter is mandatory and the property described by this parameter should be existing on the asset destination structure
synchronisation_frequency => JSON Object describing the synchronization frequency which should be applied if the import is a periodic task. Example of value for the parameter :
{
"frequency":"daily",
"fetchingHour":"23:00:00"
}
The frequency value has to be : daily or weekly or monthly. This value will define the periodicity for the import task.