loading table of contents...

3.4.11. Deploying the CoreMedia Widgets

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]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.

  1. Stop the IBM WebSphere Commerce server in the IBM RAD environment.

  2. 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 in wc-dataload-env.xml corresponds to the attribute DBNode in wc-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".

  3. 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) where store_name is the store identifier of your store ("AuroraESite", for instance).

  4. 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).

  5. 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


  6. 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 the wc-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
  1. Stop the IBM WebSphere Commerce server in the IBM RAD environment.

  2. Copy the custom access control policies files workspace/DataLoad/acp/common/CoreMediaContentDisplay.xml and workspace/DataLoad/acp/common/CoreMediaMicroSite.xml to the access control policies directory which is located in xml\policies\xml of the RAD environment.

  3. 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 the acp-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]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
  1. Merge the content of the file PageLayoutExtensionsLibrary.lzx from the WEBDEV/workspace/LOBTools/WebContent/WEB-INF/src/lzx/commerce/pagelayout folder into the corresponding file PageLayoutExtensionsLibrary.lzx in the WCS workspace. It is only one line of XML code.

  2. Remove the file PageLayoutExtensionsLibrary.lzx from the Workspace archive and copy the LOBTools folder content into the LOBTools 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.

  1. Refresh the projects in the IBM RAD system so that the new files are recognized:

    1. Select the Stores project and press F5

    2. Select the WebSphereCommerceServerExtensionsLogic project and press F5

    3. Select the LOBTools project and press F5

  2. Rebuild the LOBTools:

    1. Rebuild the LOBTools in order to apply the changes to the management Center application.

    2. Right-click the LOBTools project and select Build OpenLazlo Project from the context menu.

    This steps might take some time.

  3. 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 Publish from the context menu.

You have updated the Management Center tools and the development workspace and the WCS server has been restarted.