HCL Commerce Version 9.1.4.0 or later

Using the Asset File Upload tool to upload digital assets

Use the Asset File Upload tool to upload a large number of digital assets to HCL Digital Experience.

Downloading the Asset File Upload tool

The Asset File Upload tool is located in the utilities docker container.

The sample data load configuration files for the tool are located in the <commerce>/sample/DataLoad/Content/DX directory. There are three configuration files:
  • wc-dataload.xml – the main data load configuration file.
  • wc-dataload-env.xml – the data load environment configuration file.
  • wc-loader-asset-upload.xml – the business object configuration file.

Considerations

When a file is uploaded to HCL Digital Experience, a custom URL is generated and associated with the uploaded file. The custom URL is generated based on the relative path of the file in the .zip file or the directory that is uploaded.

Setting up the Asset File Upload tool

Before you run the Asset File Upload tool, copy the three configuration files to your own directory. Update the main data load configuration file, wc-dataload.xml, to match your HCL Digital Experience environment.

Table 1. Asset File Upload tool properties
Property Description
DataSourceLocation Update the location of the digital assets in the DataSourceLocation element. You can specify a .zip file or a directory to upload:
  • Upload a .zip file – all files in the .zip file are uploaded one by one to HCL Digital Experience.
  • Upload a directory – all files in this directory, including all sub-directories, are uploaded one by one to HCL Digital Experience.
dxURL The URL for the HCL Digital Experience site. For example: https://207.201.197.104.googleusercontent.com
dxUserId The user ID to login to HCL Digital Experience.
dxPassword The password to login to HCL Digital Experience.

The password must be encrypted using wcs_encrypt.sh.

If you do not provide the password, or if the password cannot be decrypted, you are prompted to enter the password when you run the tool.

collectionName The collection name.

The collection must be located under the root of HCL Digital Experience. If the collection name specified is not found under the root, a new collection with the name is created under the root.

allowDirectoryAsLocation Set to true to upload all files under a directory.
numberOfThreads The tool can upload files with multi-threads. The default value is 1.

The maximum number of threads you can specify is 8.

customURLContextRoot The prefix that is to be added to the custom URL. It is optional.

If it is not specified, no prefix is added to the custom URL.

replaceInvalidCharacterWith The custom URL allows only the following characters: “. (dot), a-z, A-Z, 0-9, - (dash), _ (underscore), / (forward slash)”. If the relative path for the file contains any invalid characters, they are replaced by the character specified here.

It is recommended that you use underscore (_) as the replacement character.

If this property is not specified and the custom URL that is generated contains invalid characters, the association of the custom URL with the uploaded file fails. The file is uploaded, but the custom URL is not created.

supportedFileExtension A list of comma separated file extensions. Only the files with extensions in the list are uploaded.

If this property is not specified, all files in the zip file or under a directory are uploaded to the HCL Digital Experience.

For example, “jpg, png, pdf”.

HCL Commerce Version 9.1.7.0 or later

DX and Commerce bulk dataload of asset enhancement with replace and delete mode

If you want to load files to the DX with data load Replace mode:
  • Enhance the bulk load of images from directory or zip file into DX Media Library to support the replace mode.
  • When a user loads files to the DX with data load Replace mode, it will check for the existing custom URL. If it exists already, it will replace the existing file in the DX with the new uploaded file.
  • When a user loads files to the DX with data load Insert mode, it will check for an existing custom URL. If it already exists, the upload will fail due to the duplicated custom URL. So the Insert mode is only for the initial load.
  • When a user loads files to the DX with data load Delete mode, it will delete the file in the DX with the same custom URL.
Note: If you are facing DX login API issue, one additional parameter has to be updated. Add the following property in the wc-dataload.xml:
<_config:property name="portalLogin" value="true"/>
With this parameter, the upload tool will use the portal login API to get the auth cookie.

When DX fixes their code to make the original login API to work, this parameter is not needed.

After importing files, user should be able to import all the assets missing previously. It is possible to get below mentioned error: Assets imported to DAM successfully but log is displaying the error. This happens because it loads assets to live DX. Since the files are shared between the live and auth, a user gets an error. To avoid this, you will have to load to live environments only.