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
- 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.
- Create a folder. Name the folder
page
. - Go to the directory NewWidgetProject\DataLoad\page.
Create two input CSV files within the directory:
- page.csv
- layoutAssignment.csv
- 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.
- 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.
- 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 more information about completing your page.csv input CSV file, see page input file. - 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.
For more information about completing your layoutAssignment.csv input CSV file, see layoutAssignment input file. - 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.
- Go to the WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer directory.
- Copy the following business object configuration files:
- wc-loader-page.xml
- wc-loader-layoutAssignment.xml
- Go to the workspace_dir\NewWidgetProject\Dataload directory.
- Paste your copied files into the directory.
- 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.
- Go to the workspace_dir\NewWidgetProject\Dataload\page directory.
- Right-click within the folder. Select New > File. Name the file wc-dataload-page.xml.
- Open the wc-dataload-page.xml file for editing.
- 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>
- Save and close the file.
- Run the Data Load utility to load your layout, page, and
layout assignment information.
- Stop the WebSphere Commerce Test Server.
- In a command-line utility, go to the WCDE_installdir\bin directory.
- 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
- Verifying the results of the data load.