Using Asset Download

The Asset Download component enables users to download assets from URLs and link them to supplier products by performing bulk updates or executing business actions on these products. By using the downloadAssetContent public API JavaScript method, users can perform any number of additional operations, such as downloading assets to non-supplier products, or executing an action on asset objects to replace their content.

Multiple assets can be downloaded onto multiple products in single actions, including, but not limited to: bulk updates; as part of a workflow; as part of an import; or executed based on events via an event processor. This functionality can also be used for non-image assets, such as owners manuals, MSDS sheets, and so forth.

The following examples describe a small selection of use cases and possible setups for using the Asset Download component.

Run a Bulk Update on a Product Collection

This example shows how assets can be downloaded and linked to products by performing a bulk update on a collection of T-Shirt products in the Web UI. This example will download images and link them to the products using the Primary Product Image asset reference type. Setups must be performed both in STEP Workbench and the Web UI to enable the solution. The same type of operation could also be used for scheduled bulk updates, which could be run overnight to enrich a larger number of products with images.

Workbench Configurations

  1. The required settings under Users & Groups > System Settings > Web UI Settings must first be configured so the system will know where to store the downloaded assets. For more information on these settings, refer to the 'System Settings' subsection of the Configuring Asset Download - Additional Configurations topic here.
  2. Additionally, the product(s) that will be linked to assets must first be linked to a supplier product folder of a specified classification object type, using a specified vendor classification to product link. Both of these settings are also configured under Web UI Settings.
  1. The Create Assets from URL bulk update will be configured, then saved as a bulk update configuration. In this example, the configuration is named 'Asset Download_PrimaryProdImage.'

For more information on how to configure a 'Create Assets from URL' bulk update operation, refer to the Configuring Asset Download - Business Rules and Bulk Updates topic here. For more information on how to create a bulk update configuration, refer to the Bulk Updates documentation here.

  1. In System Setup, activate the Asset URL Key if it is not already activated. Refer to the Activating and Deactivating Keys topic in the Unique Keys documentation here for more information.

Web UI Setup and Actions

  1. In the Web UI, for our example, there are multiple products stored in a Suppliers classification structure (1, below) within a Products folder (2). The product named 'Women's Pink T-Shirt 3-Pack' (3) is selected, and contains a URL to an asset in the 'Product URL Attribute' field (4).

Note: This attribute is the user-created product URL attribute that is valid on products, not the Asset URL Attribute, valid on assets, that is automatically created when Asset Download is installed. It does not matter if this attribute is populated in the workbench or in the Web UI.

  1. The 'Women's Pink T-Shirt 3-Pack' product is also included as part of a collection named 'Womens 3-Pack T-Shirts.' The screenshot in the next step shows the Collection Detail screen for this collection, with all objects selected.
  1. To perform the bulk update, click the Bulk update action button, then choose the 'Asset Download_Primary ProdImage' bulk update configuration. For information on how to add an action button to a Node List Properties screen, refer to the Action Button Configuration on a Node List topic in the Web User Interfaces documentation here.

  1. After the bulk update action process completes, the assets pointed to by the URL in the 'Product URL Attribute' attribute value field are linked to the products. In the below screenshot, the product is selected, and the linked image (pink3pack) displays as the Primary Product Image on the Node Details Screen.

  1. The image (2, below) is also stored in the Assets folder (1) in the same supplier classification hierarchy as the Products folder (3), which contains the linked product (4). The URL that the image was downloaded from is stored on the image in the Asset URL Attribute field (5) as a read-only value.

On Import of Products

Another example of where a Create Assets from URL business action can be executed is when products are imported into STEP. The below screenshot shows a sample screen from the Inbound Integration Endpoint Wizard, where a business rule named 'Download Asset From URL' has been specified to execute for each valid object on import.

This method could, for example, be used as an alternative to the Asset Importer tool (detailed in the Asset Importer documentation here). By importing a spreadsheet containing supplier products and the attribute values for each asset URL, not only can the products be created, but the assets can also be created, linked to the products, and linked into the assets folder that exists alongside the product folder in the supplier classification hierarchy (both being located inside the same supplier root folder).

For more information on adding business rules to inbound integration endpoints and using business rules on import, refer to the IIEP - Configure STEP Importer Processing Engine section of the Inbound Integration Endpoints documentation here and the Import Manager - Select Business Rules section of the Import Manager documentation here.

Asset Content Replacement – Public JavaScript API Method

This example shows a basic Execute JavaScript business action that uses the downloadAssetContent public API JavaScript method along with the Asset Download Home bind, which is located under the Assets category for Execute JavaScript business actions.

  1. In this example, the business rule is named 'JavaScript Download Asset From URL' and the valid object types are image assets—Product Image, Icon, and Illustration.

  1. Two binds are used: Asset Download Home and Current Object. The sample JavaScript (not fully pictured in the screenshot below) contains the asset URL within the script:
assetDownloadHome.downloadAssetContent(node, new java.net.URL("http://products-galore/images/womens_tshirts/pink3pack.png"));

  1. The asset to be replaced is the Primary Product Image linked to the Women's Pink T-Shirt 3-Pack. Instead of a color image of three pink shirts, a black and white image of shirts is currently linked to the product instead. Since this is the wrong image, it needs to be replaced.

  1. Navigate to the asset itself, where an Initiate Business Action button has been placed at the bottom of the page. This button has been configured to run the 'JavaScript Download Asset From URL' business rule. For information on how to add an action button to a Web UI screen, refer to the Action Button Configuration on a Node List topic in the Web User Interfaces documentation here.

  1. Click the 'Initiate Business Action' button to run the JavaScript Download Asset From URL business action. The image is downloaded from the URL specified in the JavaScript and has replaced the content of the asset. Now, the correct image of the pink t-shirts is displayed.