Migrating search engine optimization for WebSphere Commerce Version 7 Feature Pack 3 or later
You can migrate your store to the new search
engine optimization feature for WebSphere Commerce Version 7 Feature
Pack 3 or later. This feature creates shorter and easier to understand
URLs to improve searches for your store. You must perform some additional
configuration tasks to ensure that your store supports search engine
optimization.
Before you begin
- Install WebSphere Commerce Version 7 Feature Pack 3 Management Center.
- If you want to use the title meta description feature of SEO, ensure that your store uses WebSphere Commerce search with the search-based navigation option enabled. You can enable this option in the Store Management tool in Management Center.
Procedure
Enabling SEO-friendly URLs for your category and catalog entry items.
- Define your URL patterns for all pages that you want SEO-friendly
URLs. See Constructing SEO-friendly URLs by using pattern files.
As a starting point, you can take the pattern files from the latest
starter store archive and modify the pattern files to suit. The pattern
files are in the following store archive:
- WC_installdir\instances\instancename\starterstores\ConsumerDirect\Madisons-FEP.sar
- WCDE_installdir\starterstores\ConsumerDirect\Madisons-FEP.sar
- WC_installdir\instances\instancename\starterstores\ConsumerDirect\Aurora.sar
- WCDE_installdir\starterstores\ConsumerDirect\Aurora.sar
- Extract the pattern files that you want to use:
seourlpatterns.xml
for all static pagesNote: It is mandatory to addseourlpatterns.xml
file in your configuration. You must addseourlpatterns.xml
file regardless of whether you use the static pages in your store.seourlpatterns-category.xml
for categoriesseourlpatterns-product.xml
for productsseourlpatterns-search.xml
for search landing pages
- Place the pattern files in this directory:
- WC_eardir/Stores.war/WEB-INF/xml/seo/stores/storedirectory
- WCDE_eardir/workspace/Stores/WebContent/WEB-INF/xml/seo/stores/storedirectory
- Optional: If your store uses an extended
sites store model, place the files in the directory for both your
extended sites store storedirectory and your storefront
asset store directory:
- WC_eardir/Stores.war/WEB-INF/xml/seo/stores/storefrontassetstoredirectory
- WCDE_eardir/workspace/Stores/WebContent/WEB-INF/xml/seo/stores/storefrontassetstoredirectory
After the pattern files are in place, the SEO feature is enabled in your store. This feature enables the search engine optimization tab in Management Center for catalog entries and categories. - Remove the
.reload
file from your store directory to prevent your pattern files from reloading during migration and deployment. Navigate to the following directory and remove the.reload
file:Stores/WebContent/WEB-INF/xml/stores/seo/stores/storedirectory
The.reload
file is a development configuration. Remove this file when the SEO files to production since it causes the files to be read from the file system periodically. -
Run the seourlkeywordgen utility. When you are
installing the search engine optimization feature for the first time, WebSphere Commerce needs SEO
keywords for the product and category pages of the store. WebSphere Commerce uses these keywords to
create shorter SEO friendly URLs. The
seourlkeywordgen
utility creates these SEO keywords based on the object names. - Define token usage types for the new URL patterns:
insert into seotokenusgtype values (-10000,'Language','LanguageToken',0,0,1); insert into seotokenusgtype values (-10001,'Store','StoreToken:CatalogToken',0,0,1); insert into seotokenusgtype values (-10002,'CatalogEntry','ProductToken',0,0,1); insert into seotokenusgtype values (-10003,'CatalogGroup','CategoryToken',0,0,1); insert into seotokenusgtype values (-10004,'Search','SearchTermToken',0,0,1);
Note: Token usage types can be defined at different store levels:- Default store (applicable to all stores)
- Storefront asset store (applicable to itself and all extended sites that are related to it with view relationship)
- Extended site (applicable to only itself)
- Stand-alone store (applicable to itself)
- Create the url keyword that represents both the store id
and catalog id
insert into seourl (seourl_id, tokenname, tokenvalue) values (-1000, 'StoreToken:CatalogToken', 'storeId:catalogId'); -- keyword the keyword that represents the store id and catalog id in URLs, i.e. madisons insert into seourlkeyword (seourlkeyword_id, seourl_id, storeent_id, language_id, urlkeyword, status) values(-1000, -1000, 0, -1, 'keyword', 1);
Enable SEO friendly URLs for your static pages:
- Create token usage types for your static pages, such as
the home and contact us pages.
insert into seotokenusgtype values (-10005,'Home','HomeToken',10001,1,1); insert into seotokenusgtype values (-10006,'Help','ContactToken',10001,1,1); insert into seotokenusgtype values (-10007,'Sitemap','SitemapToken',10001,1,1); insert into seotokenusgtype values (-10008,'Privacy','PrivacyToken',10001,1,1);
Note: Static pages in an extended site store must inherit the relationships from its asset store. Therefore, set the SEOTOKENUSGTYPE.STOREENT_ID to the 'assetstore_storeent_id'. - Refresh the SEOConfigurationRegistry after any changes as the token usages for all stores are cached.
- Create the tokens for your static pages:
insert into seourl (seourl_id, tokenname, tokenvalue) values (-1001, 'PrivacyToken', 'PrivacyToken'); insert into seourlkeyword (seourlkeyword_id, seourl_id, storeent_id, language_id, urlkeyword, status) values(-1001, -1001, 10001, -1, 'privacy-policy', 1); insert into seourl (seourl_id, tokenname, tokenvalue) values (-1002, 'ContactToken', 'ContactToken'); insert into seourlkeyword (seourlkeyword_id, seourl_id, storeent_id, language_id, urlkeyword, status) values(-1002, -1002, 10001, -1, 'help-contact-us', 1); insert into seourl (seourl_id, tokenname, tokenvalue) values (-1003, 'SitemapToken', 'SitemapToken'); insert into seourlkeyword (seourlkeyword_id, seourl_id, storeent_id, language_id, urlkeyword, status) values(-1003, -1003, 10001, -1, 'sitemap', 1); insert into seourl (seourl_id, tokenname, tokenvalue) values (-1004, 'HomeToken', 'HomeToken'); insert into seourlkeyword (seourlkeyword_id, seourl_id, storeent_id, language_id, urlkeyword, status) values(-1004, -1004, 10001, -1, 'home', 1);
- Optional: Add the Search Engine Optimization
tab to the Store Management tool for your store. If you do not add
the tab to the Store Management tool, business users are not able
to change the Search Engine Optimization URLs for static pages with
Management Center.
- Locate the StoreFlexFlowPropertiesView.def file:
If this file does not display in your file system, the store migration process might not be complete. By default, the StoreFlexFlowPropertiesView.def file does not exist. The file generates when the store functions and store style is migrated from WebSphere Commerce Accelerator. For more information about the migration, see Overview of migrating store functions and store style from WebSphere Commerce Accelerator to Management Center Version 7 Feature Pack 2.
- WC_eardir\LOBTools.war\config\commerce\store\propertiesViews\storedirectory\StoreFlexFlowPropertiesView.def
- WCDE_installdirworkspace\LOBTools\WebContent\config\commerce\store\propertiesViews\storedirectory\StoreFlexFlowPropertiesView.def
And add the following code after the previous section:<PropertyTabPane name="generalTab" text="${stoStoreResources.generalTabTitle}"> <PropertyPane baseDefinitionName="stoStorePropertiesPane"/> </PropertyTabPane>
<PropertyTabPane name="searchEngineOptimizationTab" text="${stoStoreResources.seoTabTitle}"> <EnablementCondition conditionId="seoEnabledCondition" enablementValue="true" objectPath="StoreSEO" propertyName="isEnabled"/> <PropertyPane baseDefinitionName="stoSearchEngineOptimizationPane"/> </PropertyTabPane>
-
Search for the
ObjectProperties
tag.<ObjectProperties definitionName="stoStoreProperties
Add the following code to the objectProperties tag that corresponds to your storeId:
componentObjectNames="selectedStaticPage"
The result resembles the following code:<ObjectProperties definitionName="stoStoreProperties_10001" componentObjectNames="selectedStaticPage">
- Locate the StoreFlexFlowPropertiesView.def file:
- Restart the WebSphere Commerce server.
-
Modify your JSP files that use the
wcf:url
tag. If you modify these files it creates links for products, categories, and static pages to use the patterns that you defined in step 2. An extra patternName attribute must be added to the affectedwcf:url
tags.For example.<wcf:url patternName="CategoryURL" var="categorydisplayURL" value="CategoryDisplay"> (patternName="CategoryURL" is highlighted) <wcf:param name="categoryId" value="10002" /> <wcf:param name="storeId" value="10001" /> <wcf:param name="langId" value="-1" /> </wcf:url>
Enable title and meta description data for SEO:
- Enable the SEO title and meta description information.
- Restart the WebSphere Commerce Server.