Feature Pack 7 or later

Load a Commerce Composer page as the Shopping Cart page

In this lesson, you load a Commerce Composer page, which you use within the Commerce Composer tool as a new Shopping Cart page.You can use the Data Load utility to load information into the database to register your new page. With the Data Load utility, you can also load information to associate your new page with the layout that you previously loaded. Before your page can be managed with the Commerce Composer tool, you must associate the page with a page layout type (PageGroup) within the Commerce Composer framework.

Procedure

  1. In a File Manager, go to the DataLoad directory within your new widget project.
    For example, if your new widget project is at the top level in your workspace the filepath to the com directory, can be workspace_dir\NewWidgetProject\Dataload.
  2. Create a folder. Name the folder page.
  3. Go to the directory NewWidgetProject\DataLoad\page.
    Create two input CSV files within the directory:
    • page.csv
    • layoutAssignment.csv
  4. Open your new page.csv input CSV file for editing.
    The file is used to create a content page in the Commerce Composer tool. Within the page.csv file, specify the following columns and values:
    PageGroup
    The page group, or type, for the layouts that the page is assigned with. The value must match the value that you set for the PageGroup within the layout.csv file previously. For the tutorial, set the value to be Content
    PageAdminName
    The name of the store page that displays within the Commerce Composer tool. The name helps business users identify the page, for example, SampleShoppingCartDetailPage
    Deletable
    A flag that indicates whether business users can delete the page from the store with the Commerce Composer tool. You can set the following values for the column:
    TRUE
    Business users can delete the page.
    FALSE
    Business users cannot delete the page.
    For the tutorial, set the value to be FALSE.
    AdminEditable
    A flag that indicates whether business users can edit the page AdminName within the Commerce Composer tool. You can set the following values for the column:
    TRUE
    Business users can edit the AdminName.
    FALSE
    Business users cannot edit the AdminName.
    For the tutorial, set the value to be FALSE.
    UrlConfigurable
    A flag that indicates whether business users can configure the URL within the Commerce Composer tool. You can set the following values for the column:
    TRUE
    Business users can configure the URL within the Commerce Composer tool.
    FALSE
    Business users cannot configure the URL within the Commerce Composer tool.
    For the tutorial, set the value to be FALSE.
    Your page.csv input CSV file can resemble the following file:
    Sample page.csv input file.
    For more information about completing your page.csv input CSV file, see page input file.
  5. Open your new layoutAssignment.csv input CSV file for editing.
    The file is used to assign layouts to one or more category pages, catalog entry pages, or content pages. Within the layoutAssignment.csv file, specify the following columns and values:
    LayoutName
    The external reference name for the layout. For the tutorial, set the value to be SampleShoppingCartDetailPageLayout.
    PageGroup
    The page group (type) to which the layout belongs. The value must be the same as the value that you defined within the layout.csv. For the tutorial, set the value to be Content.
    PageAdminName
    The identifier of the content page to which you assign the layout. Set a value for the column when the value for the PageGroup is set to be SampleShoppingCartDetailPage. Otherwise, leave the value for the column empty.
    Identifier
    The identifier of the category or catalog entry to which you want to assign the layout. Set a value for the column when the value for the PageGroup is set to be Category or CatalogEntry. Otherwise, leave the value for the column empty. For the tutorial, a value is not set.
    Delete
    A flag that indicates whether to delete the row for the layout assignment from the database. Specify 1 to delete the row.
    Your layoutAssignment.csv input CSV file can resemble the following file:
    Sample layoutAssignment.csv input file.
    For more information about completing your layoutAssignment.csv input CSV file, see layoutAssignment input file.
  6. Add business object configuration files for loading your new input files. Business object configuration files define how to load data into the database. In the file, the implementation classes that specify the Data Reader, Business Object Builder, and Business Object Mediator components are included. By default, sample business object configuration files are provided for loading widget, template, and layout information with the Data Load utility.
    You can copy and use the sample business object configuration files to load your new input CSV files.
    1. Go to the WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer directory.
    2. Copy the following business object configuration files:
      • wc-loader-page.xml
      • wc-loader-layoutAssignment.xml
    3. Go to the workspace_dir\NewWidgetProject\Dataload directory.
    4. Paste your copied files into the directory.
  7. Create a data load order configuration file for the Data Load utility to use to load your page and layout assignment information. The load order configuration file controls the order that the Data Load utility loads data. The file includes pointers to the data load environment configuration file, business object configuration file, and input CSV files.
    1. Go to the workspace_dir\NewWidgetProject\Dataload\page directory.
    2. Right-click within the folder. Select New > File. Name the file wc-dataload-page.xml.
    3. Open the wc-dataload-page.xml file for editing.
    4. Add the following code within the 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 ../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="charset" value="UTF-8" />
          <_config:property name="loadSEO" value="true" />
          
          <!-- Loading content page -->
          <_config:LoadItem name="Page" businessObjectConfigFile="../wc-loader-page.xml">
            <_config:DataSourceLocation location="page.csv" />
          </_config:LoadItem>
          
          <!-- Loading layout assignment -->
          <_config:LoadItem name="LayoutAssignment" businessObjectConfigFile="../wc-loader-layoutAssignment.xml">
            <_config:DataSourceLocation location="layoutAssignment.csv" />
          </_config:LoadItem>
        </_config:LoadOrder>
      </_config:DataLoadConfiguration>
    5. Save and close the file.
  8. Run the Data Load utility to load your layout, page, and layout assignment information.
    1. Stop the WebSphere Commerce Test Server.
    2. In a command-line utility, go to the WCDE_installdir\bin directory.
    3. Run the following commands:
      dataload.bat workspace_dir\NewWidgetProject\DataLoad\layout\wc-dataload-layout.xml
      dataload.bat workspace_dir\NewWidgetProject\DataLoad\page\wc-dataload-page.xml
    4. Verifying the results of the data load.