Sample: Loading Commerce Composer pages
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
To create a Commerce Composer page, you must use the Data Load utility to load information about the page and register the page within the WebSphere Commerce database. With the Data Load utility, you can also load information that associates a page with a page group. You must associate a page with a page group before a Management Center user can manage the page with the Commerce Composer tool.
The following sample loads information about two Commerce Composer pages and associates a page with a page group. The sample loads a sample help page and home page, SEO information for both pages, and associates the home page with a page group. The sample also loads information to assign a specific layout to the sample home page.
- WC_installdir/components/foundation/samples/DataLoad/CommerceComposer/page
- WC_installdir\components\foundation\samples\DataLoad\CommerceComposer\page
- WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer\page
Sample input file | Description |
---|---|
CSV
XML
For more information about the type of data within the input file, see page input file |
This sample input file loads page information that creates sample content pages. Management Center users can manage the pages with the Commerce Composer tool. The Data Load utility loads the information in the input file into the PLPAGE 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.PageMediator Business object configuration file
|
CSV
XML
For more information about the type of data within the input file, see layoutAssignment input file |
The Data Load utility uses this sample input file to load information that assigns layouts to one or more pages. The Data Load utility loads the information in the input file into the EMSPOT, DMACTIVITY, DMELEMENT, DMELEMENTNVP, DMTRIGLSTN, and PLLOCATION 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.LayoutAssignmentMediator Business object configuration file
|
CSV
XML
For more information about the type of data within the input file, see seopage input file |
This sample input file loads custom search engine optimization (SEO) properties for a content page. The Data Load utility loads the information in the input file into the SEOURL, SEOURLKEYWORD, SEOPAGEDEF, SEOPAGEDEFDESC, SEOPAGEDEFOVR, SEOREDIRECT 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.SeoPageMediator Business object configuration file
This sample loads SEO information for a page in a single language. For more information about loading sample SEO information in multiple languages, see Sample: Loading Commerce Composer page SEO information in multiple languages. |
CSV
XML
For more information about the type of data within the input file, see seopage input file |
This sample input file loads custom search engine optimization (SEO) descriptive information for a content page. The Data Load utility loads the information in the input file into the SEOURL, SEOURLKEYWORD, SEOPAGEDEF, SEOPAGEDEFDESC, SEOPAGEDEFOVR, SEOREDIRECT 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.SeoPageDescMediator 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 page
and load the information for this sample:
- ./dataload.sh ../components/foundation/samples/DataLoad/CommerceComposer/page/wc-dataload-page.xml
- dataload.bat ..\components\foundation\samples\DataLoad\CommerceComposer\page\wc-dataload-page.xml
- dataload ..\components\foundation\samples\DataLoad\CommerceComposer\page\wc-dataload-page.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 PLPAGE where ADMINNAME like 'Sample%';
select * from EMSPOT where NAME = 'Content_' || (select CAST (CAST(PLPAGE_ID AS CHAR(50)) AS VARCHAR(50))
from PLPAGE where ADMINNAME = 'SampleHomePage');
select * from DMACTIVITY where DMACTIVITY_ID in (select DMACTIVITY_ID
from PLLOCATION where PAGELAYOUT_ID in ( select PAGELAYOUT_ID
from PAGELAYOUT where NAME like 'Sample%'));
select * from DMELEMENT where DMACTIVITY_ID IN (select DMACTIVITY_ID
from PLLOCATION where PAGELAYOUT_ID in ( select PAGELAYOUT_ID
from PAGELAYOUT where NAME like 'Sample%' ));
select * from DMELEMENTNVP where DMELEMENT_ID in (select DMELEMENT_ID
from DMELEMENT where DMACTIVITY_ID IN (select DMACTIVITY_ID
from PLLOCATION where PAGELAYOUT_ID in ( select PAGELAYOUT_ID
from PAGELAYOUT where NAME like 'Sample%' )));
select * from PLLOCATION where PAGELAYOUT_ID in ( select PAGELAYOUT_ID
from pagelayout where NAME like 'Sample%' ) order by DMACTIVITY_ID;
select * from DMTRIGLSTN where DMELEMENT_ID in (select DMELEMENT_ID
from DMELEMENT where DMACTIVITY_ID IN (select DMACTIVITY_ID
from PLLOCATION where PAGELAYOUT_ID in ( select PAGELAYOUT_ID
from PAGELAYOUT where NAME like 'Sample%' )));
select * from SEOPAGEDEF where PAGENAME in ('Content_' || (select CAST (CAST(plpage_id AS CHAR(50)) AS
VARCHAR(50))
from plpage where adminname = 'SampleHomePage'), 'Content_' || (select CAST (CAST(plpage_id AS CHAR(50))
AS VARCHAR(50))
from PLPAGE where ADMINNAME = 'SampleHelpPage'));
select * from SEOPAGEDEFDESC where SEOPAGEDEF_ID in ( select SEOPAGEDEF_ID
from SEOPAGEDEF where PAGENAME in ('Content_' || (select CAST (CAST(PLPAGE_ID AS CHAR(50)) AS VARCHAR(50))
from plpage where adminname = 'SampleHomePage'), 'Content_' || (select CAST (CAST(PLPAGE_ID AS CHAR(50)) AS
VARCHAR(50))
from PLPAGE where ADMINNAME = 'SampleHelpPage')));
select * from SEOPAGEDEFOVR where SEOPAGEDEF_ID in ( select SEOPAGEDEF_ID
from SEOPAGEDEF where PAGENAME in ('Content_' || (select CAST (CAST(PLPAGE_ID AS CHAR(50)) AS VARCHAR(50))
from plpage where adminname = 'SampleHomePage'), 'Content_' || (select CAST (CAST(PLPAGE_ID AS CHAR(50))
AS VARCHAR(50))
from PLPAGE where ADMINNAME = 'SampleHelpPage')));
select * from SEOREDIRECT;
select * from SEOURL where TOKENNAME='StaticPagesToken' and TOKENVALUE in ( select CAST(PLPAGE_ID AS CHAR(50))
from PLPAGE where ADMINNAME like 'Sample%');
select * from SEOURLKEYWORD where SEOURL_ID in ( select SEOURL_ID
from SEOURL where TOKENNAME='StaticPagesToken' and TOKENVALUE in ( select CAST(PLPAGE_ID AS CHAR(50))
from PLPAGE where ADMINNAME like 'Sample%') );
Ensure
that the data within the sample input files exists within the appropriate database tables.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.
- Go to the following directory
- WC_installdir/components/foundation/samples/DataLoad/CommerceComposer/page
- WC_installdir\components\foundation\samples\DataLoad\CommerceComposer\page
- WCDE_installdir\components\foundation\samples\DataLoad\CommerceComposer\page
- Open the Cleanup.sql for editing. Replace the contents of this file with
the following
SQL.
delete from seourl where SEOURL_ID in (select SEOURL_ID from SEOURLKEYWORD where URLKEYWORD = 'sampleHelp'); delete from seopagedef where pagename = 'Content_' || (select CAST(plpage_id AS VARCHAR(50)) from plpage where adminname = 'SampleHelpPage'); delete from seopagedef where pagename = 'Content_' || (select CAST(plpage_id AS VARCHAR(50)) from plpage where adminname = 'SampleHomePage'); delete from plpage where adminName in ('SampleHelpPage', 'SampleHomePage');
- Save and close the file.
- From a command prompt, connect to the database with your user ID and password. Run the following
command to remove the data from your database
- ij -f ..\components\foundation\samples\DataLoad\CommerceComposer\page\Cleanup.sql
- db2 -tvf ../components/foundation/samples/DataLoad/CommerceComposer/page/Cleanup.sql
- db2 -tvf ..\components\foundation\samples\DataLoad\CommerceComposer\page\Cleanup.sql
- sqlplus user_name/password@ database_name@ ../components/foundation/samples/DataLoad/CommerceComposer/page/Cleanup.sql
- sqlplus user_name/password@ database_name@ ..\components\foundation\samples\DataLoad\CommerceComposer\page\Cleanup.sql