close

Filter

loading table of contents...

Blueprint Developer Manual / Version 2210

Table Of Contents

6.6.4.2 Placeholder Resolution for Asset URLs

Note

Connector for HCL Commerce specific feature

In the HCL Commerce system you can use a placeholder in image URLs which is resolved through a database lookup in theSTORECONFtable. See the HCL documentation for more details at https://help.hcltechsw.com/commerce/8.0.0/developer/refs/rwccmsresolvecontenttag.html .

For example:

http://[cmsHost]:<CAEPort>/blueprint/servlet/catalogimage/product/
    [storeId]/<Locale>/<Mapping>/<PartNumber>.jpg

The placeholders in the example above are [cmsHost] and [storeId].

To resolve [cmsHost] - see the HCL documentation for ResolveContentURLCmdImpl for more information. If you want to connect preview and live CAE to one Management Center you can define different values for wc.resolveContentURL.cmsHost and wc.resolveContentURL.cmsPreviewHost in theSTORECONFtable.

If you use one extended sites catalog for multiple shops you can specify a [storeId] placeholder in your image URLs, which are dynamically resolved at runtime.

In a development setup you may share one HCL Commerce instance for preview and live delivery.

In order to identify the CAE (preview or live) from which the image should be delivered, depending on the shop URL, for example, shop-helios.docker.localhost versus shop-preview-helios.docker.localhost a proxy server can add a request header X-FragmentHost which contains the value preview or live.

If you want to activate [cmsHost] resolution for a shared HCL Commerce preview/live environment, perform the following steps:

  1. Register and map the FragmentHostFilter servlet to workspace/Stores/WebContent/WEB-INF/web.xml of the HCL Commerce to extract the X-FragmentHost header information from the request.

    ...
    <filter>
      <filter-name>FragmentHostFilter</filter-name>
      <filter-class>com.coremedia.livecontext.servlet.FragmentHostFilter</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>FragmentHostFilter</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>
    ...
  2. Register the CoreMediaResolveContentURLCmdImpl in the HCL Commerce. This command resolves [cmsHost] placeholder in image URLs depending on a preview or live switch for the current request. It resolves [storeId] placeholder as well. To register the command perform the following SQL statement:

    insert into cmdreg (storeent_id, interfacename, classname)
          values (0,'com.ibm.commerce.content.commands.ResolveContentURLCmd',
            'com.coremedia.commerce.content.commands.CoreMediaResolveContentURLCmdImpl');

    Refer to the HCL documentation for more details about registering custom command implementations in the command registry

    To resolve [storeId] in Management Center, you have to register and map the ImageFilter servlet to workspace/LOBTools/WebContent/WEB-INF/web.xml of the HCL Commerce.

    ...
    <filter>
      <filter-name>ImageFilter</filter-name>
      <filter-class>com.coremedia.livecontext.servlet.ImageFilter</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>ImageFilter</filter-name>
      <url-pattern>/LoadImage</url-pattern>
    </filter-mapping>
    ...

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.