Note | |
---|---|
This feature can only be used in the e-Commerce blueprint. |
In the IBM WebSphere Commerce system you can use a placeholder in image URLs which is resolved through a database lookup in the STORECONF table. See the IBM documentation for more details at https://www.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.developer.doc/refs/rwccmsresolvecontenttag.htm?lang=en .
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 IBM 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 the
STORECONF table.
If you use one extended sites catalog for mutliple 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 WCS instance for preview and live delivery.
In order to identify the CAE (preview or live) from which the image should be delivered,
the Blueprint workspace comes with a predefined Apache configuration.
Depending on the shop URL, for example, shop-helios.blueprint-box.vagrant
versus
shop-preview-helios.blueprint-box.vagrant
the Apache server adds a request header
X-FragmentHost
which contains the value preview or live.
For more information about Apache configuration see chapter Section 3.5.4, “Developing with Apache (optional for e-Commerce)”.
If you want to activate [cmsHost]
resolution for a shared IBM WCS preview/live environment, perform the
following steps:
Register and map the
FragmentHostFilter
servlet toworkspace/Stores/WebContent/WEB-INF/web.xml
of the IBM WCS to extract theX-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> ...
Register the
CoreMediaResolveContentURLCmdImpl
in the IBM WCS. 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 IBM 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 theImageFilter
servlet toworkspace/LOBTools/WebContent/WEB-INF/web.xml
of the IBM WCS.... <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> ...