Sample: Loading Commerce Composer page SEO information in multiple languages
Before you begin
This sample requires a published store that is based on the Aurora starter store 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
By loading the information in this sample, you load SEO information in multiple languages for a sample Commerce Composer help page. Before you run this sample, ensure that create the sample Commerce Composer help page. To create the sample help page, run the Data Load utility sample for Loading Commerce Composer pages.
- utilities_root/samples/DataLoad/CommerceComposer/page/MultiLanguages
- WCDE_installdir\samples\DataLoad\CommerceComposer\page\MultiLanguages
If you are using this sample to help you load Commerce Composer page information that exists in another instance, you can use the Data Extract utility to generate the input files for loading your page data. You can use the Data Extract utility to extract the existing page data. Then, you can edit configuration files for this sample to load the files that are generated by the Data Extract utility. For a sample that demonstrates how to use the Data Extract utility to extract page data, see Sample: Extracting Commerce Composer pages. Since the Data Extract utility sample files extract the page SEO descriptive information for all languages in a single file, use the single file approach to load the extracted data.
Sample input file | Description |
---|---|
CSV
For more information about the type of data within the input file, see seopage input file |
The Data Load utility uses this sample input file to load custom search engine optimization (SEO) descriptive information in multiple languages for a content page. You can use the seopageDescLanguageOne.csv and seopageDescLanguageTwo.csv files to load language specific SEO information for a page in separate files. If you want to load SEO information in multiple languages within a single file, you can load the seopageDescWithTwoLanguages.csv file. The Data Load utility loads the SEO descriptive 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
- On a command line, go to the WCDE_installdir\bin directory.
- Open a command line in the . Change the directory to utilities_root/bin directory. For information about entering and leaving containers, see Running utilities from the Utility server Docker container.
- Enter the following command to run the sample data load order file for a Commerce Composer page and load the information for
this sample:
- To load the SEO descriptive information in multiple languages for a page in a single file, run
the following command:
- ./dataload.sh ../samples/DataLoad/CommerceComposer/page/MultiLanguages\wc-dataload-seopagedesc-one-step-lang.xml
- dataload ..\samples\DataLoad\CommerceComposer\page\MultiLanguages\wc-dataload-seopagedesc-one-step-lang.xml
- To load the SEO descriptive information in multiple languages for a page in separate files, run
the following command:
- ./dataload.sh ../samples/DataLoad/CommerceComposer/page/MultiLanguages/wc-dataload-seopagedesc-two-step-lang.xml
- dataload ..\samples\DataLoad\CommerceComposer\page\MultiLanguages\wc-dataload-seopagedesc-two-step-lang.xml
For more information about configuring and running the Data Load utility, see Configuring and running the Data Load utility.
- To load the SEO descriptive information in multiple languages for a page in a single file, run
the following command:
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 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.In Management Center, verify that users can view the French language SEO information in the Commerce Composer tool. Log in to Management Center in the French language and View the SEO properties for a content page. Select the page that you added the alternate language SEO description for, and ensure that the appropriate language description shows in the properties view for the page.
Removing the sample data from the HCL 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.