Sample: Loading Commerce Composer layout templates
Before you begin
This sample requires a published store that is based on the Aurora starter store that is provided with WebSphere Commerce Feature Pack 7 and the Commerce Composer tool. Ensure that the following tasks are complete:- Review the Commerce Composer data load best practices. Follow these best practices when you load Commerce Composer assets with the Data Load utility.
About this sample
A layout template is a reusable starting point that can be used when you are creating a layout. A layout template is a wireframe that includes a specific arrangement of slots. When a user creates a layout in the Commerce Composer tool, widgets are assigned to these slots.
- Sample any page, five slots, right sidebar
- Sample any page, single slot
- Sample department
- Sample home page
- WC_installdir/components/foundation/samples/DataLoad/CommerceComposer/template
- WC_installdir\components\foundation\samples\DataLoad\CommerceComposer\template
- WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer\template
Sample input file | Description |
---|---|
CSV
XML
For more information about the data that is included in this file, see registerWidgetdef input file |
The Data Load utility uses this input file to register a template container for use in creating the template. The Data Load utility loads the information within the input file into the PLWIDGETDEF, and PLWIDGETDEFDESC database tables. The Data Load utility uses the following business object mediator and business object configuration file to load the data within this input file: Business object mediator com.ibm.commerce.pagelayout.dataload.mediator.registerWidgetdefMediator Sample
business object configuration file for loading this information:
|
CSV
XML
For more information about the data that is included in this file, see slotDefinition input file |
This sample input file loads information to
define the slots within a container for a template. Each slot is defined
with x and y coordinates. The Data Load utility loads the information within the input file into the PLWIDGETSLOT database table. The Data Load utility uses the following business object mediator and business object configuration file to load the data within this input file: Business object mediator com.ibm.commerce.pagelayout.dataload.mediator.WidgetSlotsMediator Business
object configuration file
|
CSV
XML
For more information about the data that is included in this file, see subscribeWidgetdef input file |
This sample input file loads information to
subscribe a template container to a store. The Data Load utility loads the information within the input file into the PLSTOREWIDGET database table. The Data Load utility uses the following business object mediator and business object configuration file to load the data within this input file: Business object mediator com.ibm.commerce.pagelayout.dataload.mediator.SubscribeWidgetDefinitionMediator Business
object configuration file
|
CSV
XML
For more information about the data that is included in this file, see template input file |
This sample input file loads information that
defines the template. The Data Load utility loads the information within the input file into the PAGELAYOUT database table. The Data Load utility uses the following business object mediator and business object configuration file to load the data within this input file: Business object mediator com.ibm.commerce.pagelayout.dataload.mediator.WidgetMediator Business
object configuration file
|
Procedure
- Open a command-line utility and go to the appropriate directory:
- WC_installdir/bin
- WC_installdir\bin
- WCDE_installdir\bin
- Enter the following command to run the sample data load order
file for a Commerce Composer layout
template and load the information for this sample:
- ./dataload.sh ../components/foundation/samples/DataLoad/CommerceComposer/template/wc-dataload-template.xml
- dataload.bat ..\components\foundation\samples\DataLoad\CommerceComposer\template\wc-dataload-template.xml
- dataload ..\components\foundation\samples\DataLoad\CommerceComposer\template\wc-dataload-template.xml
For more information about configuring and running the Data Load utility, see Configuring and running the Data Load utility.
Verifying results
Verify that the Commerce Composer tool page information is loaded by reviewing the data load summary report. For more information about the location and contents of this summary report, see Verifying the results of the data load.
select * from PLWIDGET where PAGELAYOUT_ID in (select PAGELAYOUT_ID from PAGELAYOUT where name like 'Sample%');
select * from PLWIDGETDEF where IDENTIFIER like 'Sample%';
select * from PLWIDGETDEFDESC where PLWIDGETDEF_ID in (select PLWIDGETDEF_ID from PLWIDGETDEF where IDENTIFIER like
'Sample%');
select * from PLSTOREWIDGET where PLWIDGETDEF_ID in (select PLWIDGETDEF_ID from PLWIDGETDEF where IDENTIFIER like
'Sample%');
select * from PAGELAYOUT where name like 'Sample%';
select * from PLWIDGETREL where PLWIDGET_ID_CHILD in (select PLWIDGET_ID
from PLWIDGET where PAGELAYOUT_ID in (select PAGELAYOUT_ID from PAGELAYOUT where name like 'Sample%'));
select * from PLWIDGETSLOT where PAGELAYOUT_ID in (select PAGELAYOUT_ID from PAGELAYOUT where name like 'Sample%');
Ensure
that the data within the sample input files exists within the appropriate database tables.In Management Center, verify that users can use the layout template in the Commerce Composer tool by Creating a layout for a page. When you are creating the layout, select a template to use for your layout. Ensure that the templates you loaded are in the New Layout Template Selection window. The following image shows the new layout templates within the New Layout Template Selection window.
Removing the sample data from the WebSphere Commerce database
To remove the sample data from
your database, run the sample again but with the value for the delete
column for all entries within the files set to 1
.
By setting the value for this column to 1
, the Data
Load utility deletes the data that is identified in the CSV file from
your database.
- WC_installdir/components/foundation/samples/DataLoad/CommerceComposer/template
- WC_installdir\components\foundation\samples\DataLoad\CommerceComposer\template
- WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer\template
- ij -f ..\components\foundation\samples\DataLoad\CommerceComposer\template\Cleanup.sql
- db2 -tvf ../components/foundation/samples/DataLoad/CommerceComposer/template/Cleanup.sql
- db2 -tvf ..\components\foundation\samples\DataLoad\CommerceComposer\template\Cleanup.sql
- sqlplus user_name/password@ database_name@ ../components/foundation/samples/DataLoad/CommerceComposer/template/Cleanup.sql
- sqlplus user_name/password@ database_name@ ..\components\foundation\samples\DataLoad\CommerceComposer\template\Cleanup.sql