This stock art tool updates the stock art in the org by looking up the datatable stored in the Stock Image Datatable and converts them into Catalog items.
It converts them using the following critera:
If the Type of the row in the datatable is “Stock”, then there must exist an asset in one of the child folders of the Stock Image Folder that has a name that matches the File_Name of the row, without the file extension (e.g. “army-aviator-wings.png” matches the asset named “army-aviator-wings”).
If the Type of the row in the datatable is “Pattern”, then there must exist an asset as a child of Pattern Folder that has a name that matches the File_Name of the row (same file name requirements as above).
IF there is a matching image asset to the row, a catalog item named after Readable_Name does not exist, and the row is marked as Enabled=TRUE, THEN a catalog item will be created. The catalog item will be named Readable_Name tagged with the Type and Category.
IF the catalog item already exists and has Enabled=TRUE, THEN the existing catalog item will be updated to ensure that Type and Category tags exist (these tags ensure that the image will pull to the front end).
IF the catalog item already exists and has Enabled=FALSE, THEN the existing catalog item will be updated to remove all tags (the lack of tags will prevent the images from pulling to the front end).
IF there is no matching catalog item and Enabled=FALSE, then nothing will be done for the row.
It is important to note that changing the format of the datatable will require a re-write of the code. The existing code to run these automated updates to the catalog will break.