The data lookup feature allows users to populate attribute values from an external source, for example, a Product Information Management (PIM) or a Collections Management System (CMS).
The rest of this help page covers using a simple plug-in that looks up data from a tab-delimited text file located on your Asset Bank server. We are happy to provide consultancy to help you configure this – please note that this work would be chargeable i.e. it is not included in our standard support.
Creating the lookup file
The data lookup feature populates attributes with data pulled from a tab-delimited text file. The first column of the file is used to match against existing attributes, eg. the asset Title, and data from the following columns are pulled into the attributes for that asset. An example file looks like this:
Title Description Keywords
Lookup-title New-description New-keywords
Note that any columns where the header name does not match the label of an attribute are ignored.
Configuring the server settings
If you host Asset Bank with us please contact the Customer Support Team for assistance configuring the lookup file.
The lookup file should be uploaded to a sensible place on the server. It's worth considering whether this file should be accessed remotely, for example via FTP or SCP, so that it can be regularly updated.
Edit or create the [tomcat]/webapps/asset-bank/WEB-INF/classes/DataLookupFromTextFileSettings.properties file and point the textfile-path setting to the absolute path of the lookup file. For example:
Using the data lookup feature
There are two ways of implementing the data lookup in your Asset Bank. Either the data is pulled periodically or on a per-asset basis.
Periodic data lookup
The data lookup stores a "last run date/time" and every night checks for assets that have been modified in the remote system since the "last run date/time". The frequency of this is set in the Admin > System > Settings > Attribute Settings area, the options being daily, weekly or monthly.
The lookup can also be manually run in the Admin > System > Developer > Housekeeping Tools area of Asset Bank.
Per-asset data lookup
A data lookup button can be created as an attribute to be displayed on the asset details page, in the Admin > Attributes area.
The following settings are available when creating and editing the attribute:
- Label - Text to display on the button itself.
- Plugin class - The name of the class that performs the data lookup. To read from a tab-delimited text file, use the value com.bright.assetbank.attribute.plugin.DataLookupFromTextFilePlugin.
- Attributes for parameters (comma separated) - The IDs of attributes that are used to lookup rows in the text file. The ID of an attribute can be found by looking at the URL for editing the attribute on the Attributes page of the Admin section. The ID for an attribute follows the 'attributeId=' part of the URL.
For example, if you want to use the Title as the lookup value, then the setting is 3.
If you want to use the ID of the asset and the Original Filename then the setting is 2,6. In this case, both bits of information would need to be comma-separated within the first column of the .txt file (e.g. "10,image.png").
You can also add help text to be displayed next to the attribute to help your users understand its function.
If the 'Attributes for parameters' setting is 3 (the default title attribute) and an asset has the title "Lookup title", then clicking the data lookup button will result in the description changing to "New description" and the keywords to "New keywords".