close

Filter

loading table of contents...

Connector for HCL Commerce Manual / Version 2010

Table Of Contents

5.3 Tenant specific Configuration

Per default only one HCL Management Center system can be configured per Content Application Engine. If you want to connect to different HCL Management Center hosts per site for example (dev, staging), you need to duplicate all URL configuration properties the hostname is part of via Spring. Since this would multiply the amount of your configuration properties, LiveContext 2 provides a mechanism to replace placeholder tokens within your configured URLs etc. with values defined in the current StoreContext at runtime.

For example within the component-lc-ecommerce-ibm.properties the following is defined:

livecontext.ibm.wcs.url=http://${livecontext.ibm.wcs.host}
livecontext.ibm.wcs.rest.path=/wcs/resources
livecontext.ibm.wcs.rest.url=${livecontext.ibm.wcs.url}${livecontext.ibm.wcs.rest.path}

Instead of the global host configuration you want to connect different HCL Management Center environments per site:

livecontext.ibm.wcs.url=http://{livecontext.ibm.wcs.host}
livecontext.ibm.wcs.rest.path=/wcs/resources
livecontext.ibm.wcs.rest.url=${livecontext.ibm.wcs.url}${livecontext.ibm.wcs.rest.path}

You need to add the following to your site specific store configuration:

 <util:map id="auroraStoreConfigDev">
  ...
  <entry key="livecontext.ibm.wcs.host" value="myhost"/>
</util:map>

After doing that the URL token will be replaced with the values of you current store configuration at runtime: livecontext.ibm.wcs.rest.url >> http://myhost/wcs/resources

The configuration keys must exactly match with the token defined in your URL configuration. If you add custom properties make sure to use the replacement mechanism CommercePropertyHelper:

public String getCustomWcsUrl() {
  return CommercePropertyHelper.replaceTokens(customWcsUrl, StoreContextHelper.getCurrentContext());
}

Search Results

Table Of Contents