The CoreMedia widgets are IBM Commerce Composer Widgets. You can use the CoreMedia Content Widget to add CoreMedia content fragments to your IBM WebSphere pages and the CoreMedia Asset Widget to add product images to product detail pages.
Note | |
---|---|
The Asset Widget is part of CoreMedia Advanced Asset Management which requires separate licensing. |
Prerequisites
In order to use the CoreMedia widgets to embed CoreMedia fragments, the Fragment Connector needs to be deployed before executing these steps.
Register the Widget definition and subscribe your Store to it
See the IBM documentation at https://www.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.data.doc/concepts/cmlbatchoverview.htm: for more details about dataload.
Stop the IBM WebSphere Commerce server in the IBM RAD environment.
Adapt the database settings in the Data Load environment configuration file (
SAMPLEDATA-ZIP\workspace\DataLoad\dataload\common\wc-dataload-env.xml
) from the CoreMedia LiveContext 2.0 WebSphere Commerce Project Sample Data Zip file to the settings of your WebSphere database.You can retrieve your database settings from the IBM RAD environment configuration file
WC/xml/config/wc-server.xml
, at the following XML element:<InstanceProperties> <Database> <DB>
For a DB2 database, the attribute
schema
inwc-dataload-env.xml
corresponds to the attributeDBNode
inwc-server-xml
.Find your store identifier in the IBM Management Center in Store Management. If you use the default IBM shop, the value is "Aurora".
Use the Data Load business object configuration files from the CoreMedia LiveContext 2.0 WebSphere Commerce Project Sample Data ZIP file for registering the widget definition (
workspace\DataLoad\dataload\common\[store_name]\Widget\wc-loader-registerWidgetdef.xml
) and for subscribing the widget definition (workspace\DataLoad\dataload\common\[store_name]\Widget\wc-loader-subscribeWidgetdef.xml
) wherestore_name
is the store identifier of your store ("AuroraESite", for instance).Use the CSV input files from the CoreMedia LiveContext 2.0 WebSphere Commerce Project Sample Data ZIP file for registering the widget definition (
workspace\DataLoad\dataload\common\[store_name]\Widget\registerWidgetdef.csv
) and for subscribing the widget definition (workspace\DataLoad\dataload\common\[store_name]\Widget\subscribeWidgetdef.csv
).Configure the Data Load order configuration file (
wc-dataload.xml
). The Data Load file has pointers to the environment settings file, the business object configuration file and the input file.<?xml version="1.0" encoding="UTF-8"?> <_config:DataLoadConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://www.ibm.com/xmlns/prod/commerce/foundation/config ../../../../xml/config/xsd/wc-dataload.xsd" xmlns:_config= "http://www.ibm.com/xmlns/prod/commerce/foundation/config"> <_config:DataLoadEnvironment configFile="wc-dataload-env.xml"/> <_config:LoadOrder commitCount="100" batchSize="1" dataLoadMode="Replace"> <_config:property name="firstTwoLinesAreHeader" value="true"/> <_config:property name="loadSEO" value="true"/> <!-- Configuration for the file to register a widget --> <_config:LoadItem name="RegisterWidgetDef" businessObjectConfigFile= "wc-loader-registerWidgetdef.xml"> <_config:DataSourceLocation location="registerWidgetdef.csv"/> </_config:LoadItem> <!-- Configuration for the file to subscribe a store to a widget --> <_config:LoadItem name="SubscribeWidgetDef" businessObjectConfigFile= "wc-loader-subscribeWidgetdef.xml"> <_config:DataSourceLocation location="subscribeWidgetdef.csv"/> </_config:LoadItem> </_config:LoadOrder> </_config:DataLoadConfiguration>
Example 3.4. wc-dataload.xml
Run the Data Load utility command syntax with the dataload.bat tool which is located in
workspace\bin
of the RAD environment. Give the absolute path to thewc-dataload.xml
file. The call might look as follows:..\bin\dataload.bat [path_to_your_dataload]\wc-dataload.xml
Load the custom access control policies for the CoreMedia Widget
Stop the IBM WebSphere Commerce server in the IBM RAD environment.
Copy the custom access control policies files
workspace/DataLoad/acp/common/CoreMediaContentDisplay.xml
andworkspace/DataLoad/acp/common/CoreMediaMicroSite.xml
to the access control policies directory which is located inxml\policies\xml
of the RAD environment.Run the ACP Load utility with the acpload.bat tool which is located in
workspace\bin
of the RAD environment. Give the absolute path to theacp-filename.xml
file. The call might look as follows:..\bin\acpload.bat [path_to_your_acp_dir]\acp-filename.xml
The acpload documentation can be found here: https://www.ibm.com/support/knowledgecenter/SSZLC2_7.0.0/com.ibm.commerce.admin.doc/refs/raxacpload.htm.
Note The acpload tool itself does not report any problems. So, check if the tool created 2 new XML files with the suffixes
_xmltrans.xml
and_idres.xml
in..\xml\policies\xml
for each policy file. Also look into..\logs\acpload.log
and..\logs\messages.txt
for errors.
Add the Widget UI to the Management Center app
Merge the content of the file
PageLayoutExtensionsLibrary.lzx
from theWEBDEV/workspace/LOBTools/WebContent/WEB-INF/src/lzx/commerce/pagelayout
folder into the corresponding filePageLayoutExtensionsLibrary.lzx
in the WCS workspace. It is only one line of XML code.Remove the file
PageLayoutExtensionsLibrary.lzx
from the Workspace archive and copy theLOBTools
folder content into theLOBTools
folder of the IBM RAD workspace.
Copy the Stores Folder and Apply JSP Customizations
Copy and merge the content of the Stores/
folder of the CoreMedia LiveContext 2.0 WebSphere Commerce Project Workspace archive into the IBM RAD
workspace folder Stores/
as described in Section 3.4.10, “Customizing IBM WebSphere Commerce JSPs”
Using Placeholder Resolution for Asset URLs
If you have licensed CoreMedia Advanced Asset Management you can use placeholders for the CMS host and the store ID in your image URLs. Section 8.7.4.2, “Placeholder Resolution for Asset URLs” describes further details and how you enable placeholder resolution.
Refresh and Rebuild the workspace in Eclipse (RAD)
Now you have to refresh and rebuild the IBM workspace in the IBM RAD environment.
Refresh the projects in the IBM RAD system so that the new files are recognized:
Select the
Stores
project and press F5Select the
WebSphereCommerceServerExtensionsLogic
project and press F5Select the
LOBTools
project and press F5
Rebuild the
LOBTools
:Rebuild the
LOBTools
in order to apply the changes to the management Center application.Right-click the
LOBTools
project and select from the context menu.
This steps might take some time.
Republish the WCS Server workspace in order to apply the changes to the shop web application. In the server view (bottom left corner) right click on the server instance and select
from the context menu.
You have updated the Management Center tools and the development workspace and the WCS server has been restarted.