WebSphere Commerce Developer

Loading Commerce Composer assets for your store

Use the Data Load utility to enable your store to use the Commerce Composer layout templates and widgets that are available with WebSphere Commerce. When you complete updating your store pages to support the use of the Commerce Composer, business users can use these templates and widgets to design your store pages.

About this task

When you install and enable WebSphere Commerce, various Commerce Composer widgets and layout templates can be available for use in composing store pages. These assets are registered with the Commerce Composer framework during the enablement process. However, to use these Commerce Composer assets in your store, you must subscribe your store to these assets. By subscribing to these assets, the assets become available to business users in the Commerce Composer for your store. If you do not subscribe your store to any assets, business users cannot select any layout templates or widgets when they are creating a layout.

To subscribe your store to Commerce Composer assets, you must use the Data Load utility to load the subscription information. By default, the WebSphere Commerce Developer includes sample data load configuration files that you can use to load the subscription information. To use these configuration files, you must copy the CSV input files that are provided in the CommerceComposerStarterStoreSupport.zip compressed file that you previously extracted into the Data Load utility samples directory

Procedure

Define the Commerce Composer layout templates for your store.

As an example for defining templates for your store, the following steps copy the layout templates that are provided for the WebSphere Commerce Aurora starter store.

  1. Prepare the input and configuration files that the Data Load utility requires to load the layout template subscription information.
    1. In a file manager utility, go to the temporary directory where you extracted the CommerceComposerStarterStoreSupport.zip compressed file.
    2. In the dataload\layout_templates directory, copy the following files:
      registerWidgetdef.csv
      The Data Load utility uses this CSV input file to register a new widget or container for use in the Commerce Composer. For more information about the type of information in this file, see registerWidgetdef input file.
      slotDefinition.csv
      The Data Load utility uses this CSV input file to load information that the Commerce Composer requires to render the wireframe that represents the template in the user interface. For more information about the type of information in this file, see slotDefinition input file.
      subscribeWidgetdef.csv
      The Data Load utility uses this CSV input file to subscribe one or more stores to the widget or container. For more information about the type of information in this file, see subscribeWidgetdef input file.
      template.csv
      The Data Load utility uses this CSV input file to load layout templates into a store so that they can be used in the Commerce Composer. For more information about the type of information in this file, see template input file.
    3. Go to the WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer\template directory.
    4. Back up the registerWidgetdef.csv, slotDefinition.csv, subscribeWidgetdef.csv, and template.csv files that are within the template directory.
    5. Paste the copied files from the layout_templates directory into the template directory.
    6. Go to the WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer directory.
    7. Open the wc-dataload-env.xml file for editing. This file is the sample environment configuration file for the Data Load utility.
      Update the file to meet your environment settings:
      • In the _config:BusinessContext element, update the values for the storeIdentifier and catalogIdentifier attributes to match your environment settings.
      • In the _config:Database element, update the values to meet your WebSphere Commerce Developer.
      You do not need to change the default values for the remaining environment settings.
    You do not need to update the provided business object configuration files or the wc-dataload-template.xml load order configuration file for loading layout template information.
  2. Run the Data Load utility to load the layout template subscription information.
    1. Ensure that your WebSphere Commerce server is stopped before you run the Data Load utility.
    2. In a command-line utility, go to the WCDE_installdir\bin directory.
    3. Run the following command to load the input CSV files to load the subscription information:

      dataload ../components/foundation/samples/DataLoad/CommerceComposer/template/wc-dataload-template.xml

    4. Verify that the Data Load utility loaded successfully by checking the log file for the utility. Ensure that the following statement displays in the log file: "Load completed successfully with no errors.".
      The wc-dataload.log log file for the Data Load utility is generated in the WCDE_installdir\logs directory.
  3. Add the Aurora starter store archive into a temporary directory. To enable your store to use the Commerce Composer, you add files and code that is included in this archive into files and directories within your store directory structure.
    1. Go to the WCDE_installdir\starterstores\ConsumerDirect directory.
    2. Copy the Aurora.sar archive.
    3. Add the copied archive into a temporary directory outside of the WebSphere Commerce directory structure, for instance, tempAuroraDir.
    4. Extract the contents of the Aurora.sar archive into this temporary directory.
  4. Copy the Aurora starter store container JSP files and Commerce Composer widget directory structure into the directory structure for your store.
    The Commerce Composer widgets that are available with WebSphere Commerce requires these container JSP files and the directory structure to function and display correctly on store pages. For more information, see Commerce Composer widget architecture.
    1. Go to the tempAuroraDir\StoreAssetsDir directory, where tempAuroraDir is the temporary directory where you extracted the Aurora.sar archive.
    2. Copy the Container directory.
    3. Go to the directory for your store and add the copied directory.
      For example, your copied directory path can be workspace_dir\Stores\WebContent\store\Container, where store is the name of your store directory.
Subscribe your store to the Commerce Composer widgets that are provided by WebSphere Commerce.
  1. Prepare the input files that the Data Load utility requires to load the widget subscription information.
    1. Go to the temporary directory where you extracted the CommerceComposerStarterStoreSupport.zip compressed file.
    2. In the dataload\widgets directory, copy the following files:
      SubscribeWidgetdef.csv
      The Data Load utility uses the SubscribeWidgetdef.csv input file to subscribe your store to use the Commerce Composer widgets that are provided with WebSphere Commerce.
      wc-dataload-widget.xml
      The wc-dataload-widget.xml data load order configuration file defines the environment configuration file, business object configuration file, and input file that the Data Load utility uses to load the subscription information.
    3. Go to the WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer\widget directory.
    4. Back up the subscribeWidgetdef.csv, and wc-dataload-widget.xml files that are within the widget directory.
    5. Paste the copied files from the dataload\widgets directory into the widget directory.
    You do not need to update any of the provided business object configuration files or the further update the environment configuration file.
  2. Run the Data Load utility to load the widget subscription information.
    1. Ensure that your WebSphere Commerce server is stopped before you run the Data Load utility.
    2. In a command-line utility, go to the WCDE_installdir\bin directory.
    3. Run the following command to load the input CSV files to load the subscription information:

      dataload ../components/foundation/samples/DataLoad/CommerceComposer/widget/wc-dataload-widget.xml

    4. Verify that the Data Load utility loaded successfully by checking the log file for the utility. Ensure that the following statement displays in the log file: "Load completed successfully with no errors.".
Define the default page layouts for each store page group of your store.

As an example for defining default layouts for your store, the following steps copy the default layouts that are provided for the Aurora starter store.

By subscribing to these layouts, when you create a store page, the new page uses the appropriate default layout to define the content and display of the page. After you complete adding support for your store, you can create and assign new default layouts for each page group.

  1. Prepare the input files that the Data Load utility requires to load the default layout information.
    1. Go to the temporary directory where you extracted the CommerceComposerStarterStoreSupport.zip compressed file.
    2. In the dataload\layout_default directory, copy the following files:
      layout.csv
      The Data Load utility uses this CSV input file to load layouts and default layouts into a store. For more information about the type of information in this file, see layout input file.
      layoutWidgetRelationship.csv
      The Data Load utility uses this CSV input file to add a container and widgets to a layout, default layout, or template. For more information about the type of information in this file, see layoutWidgetRelationship input file
      widgetnvp.csv
      The Data Load utility uses this CSV input file to set the properties of widgets that are added to a specific layout or template, including a default layout. For more information about the type of information in this file, see widgetnvp input file.
      wc-dataload-layout.xml
      The wc-dataload-layout.xml data load order configuration file defines the environment configuration file, business object configuration file, and input file that the Data Load utility uses to load the default layout information.
    3. Go to the WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer\layout directory.
    4. Back up the layout.csv, layoutWidgetRelationship.csv, widgetnvp.csv, and wc-dataload-layout.xml files that are within the layout directory.
    5. Paste the copied files from the dataload\layout_default directory into the layout directory.
    You do not need to update any of the provided business object configuration files or the further update the environment configuration file.
  2. Run the Data Load utility to load the default layout information.
    1. Ensure that your WebSphere Commerce server is stopped before you run the Data Load utility.
    2. In a command-line utility, go to the WCDE_installdir\bin directory.
    3. Run the following command to load the input CSV files to load the subscription information:

      dataload ../components/foundation/samples/DataLoad/CommerceComposer/layout/wc-dataload-layout.xml

    4. Verify that the Data Load utility loaded successfully by checking the log file for the utility. Ensure that the following statement displays in the log file: "Load completed successfully with no errors.".
Verify that the Commerce Composer assets are available for your store.
  1. Open the Commerce Composer tool.
  2. Select your store from the Store list.
  3. Create a layout for your store. Do not assign your layout to a page. You must update your store pages before you can view the layout on a page in your store.
    When you are creating your test layout, review the list of Commerce Composer layout templates and widgets that are available for you to use for your layout. If the list of templates and widgets includes all of the assets that you subscribed your store to, you successfully loaded the Commerce Composer assets for your store.