Professional Documents
Culture Documents
1 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
Simplifying URLs
Use the following methods to simplify store URLs.
The standard context root of the store URL is long and contains identifiers that are irrelevant to shoppers. Shortening the length of the context root it to a single word
such as store or shop shortens the URL:
Context root URL
Full
http://localhost/webapp/wcs/stores/servlet/Product2_10001_10001_10029_-1_10007_10001_10001_ProductDisplayErrorView
Short
http://localhost/shop/Product2_10001_10001_10029_-1_10007_10001_10001_ProductDisplayErrorView
For more information, see Shortening the context root of a store URL.
Use keywords for categories and products to create a URL that is easy for shoppers and search robots to read and understand:
Original URL: URL with full context root and old query string
http:/mystore
/shop/Product2_10001_10001_10029_-1_10007_10001_10001_ProductDisplayErrorView
http://mystore/shop/side-tables/two-drawer-side-table
For more information about SEO-friendly URL construction, see SEO-friendly URL construction overview.
Task flow: Setting up WebSphere Commerce SEO on a starter store (Feature Pack 3)
7/8/2013 11:59 AM
2 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
You can set up a Madisons or Elite starter store in the development environment to try out WebSphere Commerce search engine optimization (SEO) features. When you
complete this task flow, you can view SEO-friendly URLs in the storefront. In Management Center, you can use SEO features for catalog and marketing managers, including
adjusting the page title, using URL keywords, and adding meta description for your URLs.
Before you begin
Ensure that you have completed the following installation and enablement tasks:
Install WebSphere Commerce Version 7 Feature Pack 3. This feature pack installs all software required to add WebSphere Commerce SEO features to your store.
Enable starter store enhancements. Use the script to enable the software assets for the new SEO features.
About this task
For an overview of the features included in WebSphere Commerce SEO feature packs, see SEO for Version 7 Feature Pack 3 or later.
Procedure
Pattern
shop/(.*)$
Ignore case
checked
Action type
Rewrite
Rewrite URL
webapp/wcs/stores/servlet/{R:1}
checked
7/8/2013 11:59 AM
3 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
What to do next
Once
1.
2.
3.
the rewrite rule is updated in the web server, update the WebSphere Commerce server configuration file to provide the context root rewrite rule value:
Open the WebSphere Commerce configuration file.
Search for the SEOConfiguration section.
Within the SEOConfiguration section, enter the following code:
<context-root-rewrite value="/shop" />
For example:
<SEOConfiguration defaultUrl="" dynamicUrl="true" enable="true">
<context-root-rewrite value="/shop" />
</SEOConfiguration>
Results
You successfully configured and tested SEO-friendly URLs.
Pattern definitions
The following is a sample pattern definition for a privacy policy page URL:
<!-- Privacy URL like this: http://localhost/shop/en/madisons/privacy-policy-registration (canonical)
This Pattern is replacement for PrivacyPolicy mapping present in SEOURLMapper.xml in previous SEO implementations (Before FEP3) -->
a <seourl:seoUrlPatternDef name="PrivacyRegistrationURL">
b <seourl:seoUrlPattern viewName="PrivacyView">/LanguageToken/StoreToken:CatalogToken/PrivacyRegistrationToken</seourl:seoUrlPattern>
c <seourl:urlToParamMapping>
<seourl:mapping name="langId" value="?LanguageToken?"/>
<seourl:mapping name="storeId" value="?StoreToken?"/>
<seourl:mapping name="catalogId" value="?CatalogToken?"/>
<seourl:mapping name="fromPage" value="registration"/>
</seourl:urlToParamMapping>
d <seourl:paramToUrlMapping>
<seourl:mapping name="LanguageToken" value="?langId?" defaultValue="-1"/>
<seourl:mapping name="StoreToken" value="?storeId?"/>
<seourl:mapping name="CatalogToken" value="?catalogId?"/>
<seourl:mapping name="PrivacyRegistrationToken" value="Privacy-Policy-Registration"/>
</seourl:paramToUrlMapping>
e <seourl:usageDef>
<seourl:usage device="browser">
<seourl:target>Privacy</seourl:target>
</seourl:usage>
</seourl:usageDef>
</seourl:seoUrlPatternDef>
a. SEO URL pattern definition name
The name of the pattern. This is the name that is used while constructing the SEO URLs in JSP pages by using wcf:url tag library.
b. Struts to pattern mapping
Defines the pattern of the URL. The viewName attribute defines the struts action mapping which will be used when the SEO URL is deconstructed. After the SEO
7/8/2013 11:59 AM
4 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
URL is deconstructed and matched against the pattern, the request is forwarded to the corresponding viewName attribute.
c. SEO URL to parameter mapping
Used during deconstruction of the SEO URL. After the URL is matched against the pattern, the values associated with the keywords in the URL are attached to the
corresponding parameter names defined in this mapping, based on the mapping between the tokenName and the keyword.
For example, if en/madisons/Privacy-Policy-Registration is matched against the above pattern /LanguageToken/StoreToken:CatalogToken
/PrivacyRegistrationToken, the value of keyword "en" is associated with parameter langId. The Madisons keyword is associated with StoreToken:CatalogToken and
its value (for example: 10001:10002) is assigned to storeID and catalogId (storeId = 10001 and catalgoId = 10002) after splitting.
d. SEO URL parameter to URL mapping
Used during construction of the SEO URL in JSP pages by using the wcf:url tag library. Based on the token name and tokenValue, the keywords are looked up in
the database and substituted for the token names in the URL pattern.
e. Pattern usage
In this example, the usage is for a privacy static page which is displayed under the Store Management tool in Management Center.
Fixed tokens
An SEO pattern file can contain two sections: A token is an elementary symbol in a URL pattern. Each token has a specific usage and is associated with a keyword and a
value. During SEO-friendly URL construction, the tokens in a URL pattern are replaced by their respective keywords. During URL deconstruction, the keywords are looked
up for their respective token names to match a particular URL pattern and also find the values to be associated to the parameters of the deconstructed dynamic URL. There
are two types of tokens: dynamic and fixed. Dynamic tokens are defined in the SEOTOKENUSGTYPE table, and the fixed tokens are defined in the pattern file.
<seourl:tokenDef>
1 <seourl:token name="PageViewToken">
<seourl:tokenValue value="image"/>
<seourl:tokenValue value="detailed"/>
</seourl:token>
2 <seourl:token name="PrivacyRegistrationToken">
<seourl:tokenValue value="Privacy-Policy-Registration"/>
</seourl:token>
3 <seourl:token name="TopCategoryBooleanToken">
<seourl:tokenValue value="Y"/>
<seourl:tokenValue value="N"/>
</seourl:token>
4 <seourl:token name="BeginIndexToken">
<seourl:tokenValue value="[[0-9]*]"/>
</seourl:token>
5 <seourl:token name="CatEntryIDToken">
<seourl:tokenValue value="[[0-9]*]"/>
</seourl:token>
6 <seourl:token name="ContentOnlyToken">
<seourl:tokenValue value="1"/>
<seourl:tokenValue value="0"/>
</seourl:token>
</seourl:tokenDef>
1. PageViewToken
Can have only two values, image or detailed.
2. PrivacyRegistrationToken
Can have only a value of Privacy-Policy-Registration.
3. TopCategoryBooleanToken
Can have a value of Y or N.
4. BeginIndexToken
Can have numerical values. Enclose the expression in a set of brackets []. The expression [[0-9]*] indicates that the valid value for BeginIndexToken can be any
numerical value. To use an integer, do not use the *.
5. CatEntryIDToken
Can have numerical values. Enclose the expression in a set of brackets []. The expression [[0-9]*] indicates that the valid value for CatEntryIDToken can be any
numerical value. To use an integer, do not use the *.
6. ContentOnlyToken
Can have a value of 1 or 0.
A value of 1 means include header, footer, left and right navigation bar, along with content.
A value of 0 means do not include the header, footer, and left navigation bar. Display the content present at the middle of the page
Dynamic tokens
The SEOTOKENUSGTYPE table bridges the gap between the Management Center user interface, which saves the URL keywords, and the pattern definition files that are
defined in the storefront. The primary gap between Management Center and the storefront is the token names that are used in the pattern definition files. The Management
Center user interface uses the token names to save the URL keywords for catalog entries, category, and static store pages. To distinguish among the various tokens that are
used in the pattern definition, the concept of usage is introduced. The token Usage Type table supplies the Management Center user interface with the token names used in
the pattern definition files. The usage maps a token name to the entities for which the keywords are defined against the set token name. Some of the usages are predefined
in this table and are mapped to the default entities for which the URL keywords are allowed to be defined.
These following predefined usages are found in the table mapping:
Store
Language
Product
Item
Category
7/8/2013 11:59 AM
5 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
Privacy
Sitemap
Usage is defined for entities such as catalog entries and categories and for static content in the store, such as privacy pages or site map pages.
The token usages are defined at the store level. Similar to the view store relationship, you can define token usages at the site level and are applicable to all the stores. You
can add more usages to the default usage list. You can also override the token names for these usages for a specific store or for the site.
The store tokens are cached in the SEOConfigurationRegistry instead of the dynamic cache because the tokens are infrequently updated. Always define store tokens at the
site level (zero store-level) because store tokens are always used to resolve the storeId.
The predefined store usage uses StoreToken as the token name. If any complex tokens are defined for the store usage for a specific store, they must contain the
StoreToken. For example, a store might consider merging the store, language, and catalog Id values into the token for the store usage and takes the following form:
StoreToken:LanguageToken:CatalogToken. When the configuration registry caches the token, it looks for the StoreToken string in the token name. The value at the
corresponding position in the token value is treated as the storeId. This behavior is the primary reason for hardcoding the token name for the predefined store token.
The default token for the language usage is LanguageToken. Because the keywords for the language token are taken from the language registry, you do not have to define
them.
By default LanguageTokens are taken from the language registry. The lang code is the keyword. For example, in English, the urlKeyword is en and languageId is -1.
But this default behavior can be overridden by defining separate urlKeywords (other than the default language code) for any language, in SEO URL Pattern files.
<!-- Override keywords for language tokens. By default language tokens will be read from Language registry.
Ex: for langId = -1, the language token will be 'en'. Use the below node to override the default keywords -->
<seourl:languageKeywordDef>
<seourl:LanguageKeyword languageId="-7" urlKeyword="zh-CN"/>
<seourl:LanguageKeyword languageId="-8" urlKeyword="zh-TW"/>
</seourl:languageKeywordDef>
The language code for Simplified Chinese and Traditional Chinese is zh. To override the language code define URL keywords in SEOURLPattern files.
Pattern
LanguageToken/StoreToken:CatalogToken
Category LanguageToken/StoreToken:CatalogToken/CategoryToken
...CategoryDisplay?langId=-1&storeId=10001&catalogId=10002&categoryId=10003
Product
LanguageToken/StoreToken:CatalogToken/CategoryToken
/ProductToken
...ProductDisplay?langId=-1&storeId=10001&catalogId=10002&categoryId=10003&
productId=10004
Contact
Us
LanguageToken/StoreToken:CatalogToken/ContactToken
...HelpContactUsView?langId=-1&storeId=10001&catalogId=10002
7/8/2013 11:59 AM
6 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
The values for each parameter is extracted from looking in the SEOURL and SEOURLKEYWORD tables and language registry contents:
a. For the language, langId = LanguageToken which is -1
b. For the store, storeId = StoreToken which is 10001
c. For the catalog, catalogId = CatalogToken which is 10002
d. For the category, categoryId = CategoryToken which is 10003
Keyword
Token Name
madisons
StoreToken:CatalogToken
Token Value
10001 (storeId value):10002 (catalogId value)
coffee-makers
CategoryToken
en
LanguageToken
-1 (langId value)
6. With the information found in the SEOURLKEYWORD table, the non SEO-friendly URL is constructed in the formatting found in the pattern file
(LanguageToken/StoreToken:CatalogToken/CategoryToken):
http://myhost.com/webapp/wcs/stores/servlet/CategoryDisplay?langId=-1&storeId=10001&catalogId=10002&catagoryId=10003
WebSphere Commerce server executes the view with the specified parameters and sends the result to the browser.
Description
seoUrlPatternDef name="CategoryURL"
LanguageToken/StoreToken:CatalogToken/CategoryToken the pattern that determines how the URL will be built
langId
7/8/2013 11:59 AM
7 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
storeId
catalogId
categoryId
This example assumes that the pattern file contains a pattern definition, and that the following sample values exist in their respective tables for creating the coffee
makers subcategory URL:
Parameter Name
TokenName
TokenValue
categoryId
CategoryToken
10024
storeId:catalogId
StoreToken:CatalogToken 10001:10002
madisons
langId
LanguageToken
en
-1
Keyword
coffee-makers
TokenValue
StoreToken:CatalogToken '10001:'
The token is associated with a URLKEYWORD in the SEOURLKEYWORD table, in this example, 'aurora'. Notice that there is no CatalogToken value in the TokenValue
column. By default, if you do not specify a default catalog in the Catalogs tool, the master catalog is the default catalog.
If your store contains sales catalogs and the catalogs do not have token entries in the SEOURL and SEOURLKEYWORD tables, then an SEO URL cannot be constructed for
your sales categories. But, if you set the sales catalog as your default catalog, then the preconfigured StoreToken: token entry is used and an SEO URL is constructed with
the associated URLKEYWORD, in this case 'aurora'.
For example:
1. In the Catalogs tool, you create a sales category in a sales catalog.
2. In the Search Engine Optimization tab of the sales category, you specify a URL keyword sales-apparel.
3. Set the sales catalog as your default catalog.
The resulting SEO URL that is constructed would be http://www.myhost.com/shop/en/aurora/sales-apparel
However, if you set up tokens in the SEOURL and SEOURLKEYWORD tables for the sales catalog, then the new URLKEYWORD entry is used instead. To set up tokens for
your sales catalog, you must Enable SEO with sales catalogs.
For example, if you enable SEO with a sales catalog and set the URLKEYWORD to 'teststore', then the constructed SEO URL would be http://www.myhost.com/shop/en
/teststore/sales-apparel.
Important: If you plan to set a sales catalog as the default catalog, ensure that your SEOURL table also has a StoreToken:CatalogToken entry for the master catalog. If
not, then SEO URLs cannot be constructed for categories in your master catalog.
Note: SEO URLs for products are always constructed with the URLKEYWORD associated with the default catalog, regardless of the catalog that the product belongs to.
Search engine optimization (SEO) title and meta description (TMD) data for store web pages
Title and metadata information is valuable for allowing your store's pages to stand out on the internet. With the search engine optimization (SEO) feature for WebSphere
Commerce Version 7 Feature Pack 3, each web page in your store is provided with unique content to improve its ranking in search results.
The title and meta description data is comprised of the following elements:
Page title
The page title appears in the browser title bar For example: Large Adjustable Desk Lamp | Madisons
Meta description
Search engines commonly use the meta description on search result pages to provide a concise explanation of the contents of the current web page. The meta
data description is an HTML attribute and is not displayed on the web page.
Meta keyword
The meta keyword is used for the static pages of your store, such as the contact us or help page. This allows for search engines to accurately rank and index the
web page. The meta keyword is an HTML attribute and is not displayed on the web page.
Image alt text
7/8/2013 11:59 AM
8 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
Image alt text describes the contents of an image for search engines to accurately rank and index the image. It is viewable by hovering over the image on the
web page and can be used for text-to-speech systems for the visually impaired.
SEO property
page title
INSERT INTO seourlkeyword (seourlkeyword_id, seourl_id, language_id, storeent_id, urlkeyword) values (<seourlkeyword_id>, <seourl_id>, <langId>, 0, '<url
For example:
INSERT INTO seourlkeyword (seourlkeyword_id, seourl_id, language_id, storeent_id, urlkeyword) values (201, 201, -1, 0, 'teststore');
Note:
The store URL keyword must be set up for every sales catalog that is available for the store. If it is not setup, dynamic URLs are constructed when the store is
viewed with that particular sales catalog. When you set up the URL keyword, ensure that you set the storeent_Id to '0'
Care must be taken in the SEOURLKEYWORD table when stores use multiple languages. The URL keyword is looked up in the following manner:
a. The language Id that is specified in the urlLangId parameter during construction.
b. If the keyword does not exist for the urlLangId, then the store default language is looked up.
c. Otherwise, by default, -1 is looked up.
So, if your store supports multiple languages, be sure to maintain keywords in at least one of those three locales.
The SEOURL_ID can be reused for multiple SEOURLKEYWORDs (for different languages) in the same store, but do not reuse SEOURL_ID values across multiple
stores.
4. Repeat step 2 and step 3 for each additional WebSphere Commerce extended sites store that you want SEO enabled.
5. Refresh the SEOConfigurationRegistry.
Results
All extended sites stores now have SEO-friendly URLs.
7/8/2013 11:59 AM
9 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
the extended site duplicate of the asset store URL and the new URL
When an extended-site URL is cleared for a catalog entry or catalog group, a redirect is created between the extended site URL and the asset store URL
In all of the above cases, if the URL of a catalog entry or a catalog group is updated multiple times, then all previous redirects are updated to point to the latest URL for that
catalog object. This way, redirection chains are avoided.
You can create a 301 redirect in different ways. A common method is to set up web server mod rewrite rules in the web server configuration file. This method might require
many redirect rules - a rule for each category and product on the site. Usually, it is impossible to create a single redirect rule to handle every redirect to SEO URLs. Another
method is to customize the web application layer to automatically redirect the URLs. For more information see, Redirecting legacy URLs to SEO friendly URLs in WebSphere
Commerce.
7/8/2013 11:59 AM
10 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
Microdata specification
schema.org specification
The web pages in your Aurora starter store use microdata format to mark up the content. The following code shows an example of the tags that are used in your JSP files
to mark up the product name, description, price, availability, and review of a product.
<div itemscope="itemscope" itemtype="http://data-vocabulary.org/Product">
<span itemprop="name">Sleek Occasional Table</span>
<span itemprop="description">
The sleek styling makes this occasional table a perfect addition to your home.
Made of oak wood with a tempered glass top and forest green-finish wood frame.
Measures 48" in width, 24" in length, and 19" in height.
Some assembly required.
</span>
<span itemprop="offerDetails" itempscope itemtype="http://data-vocabulary.org/Offer">
Regular price: $
<span itemprop="price">179.99</span>
<span itemprop="availability" content="in_stock">
In stock! Order now!
</span>
</span>
<span itemprop="review" itemscope
itemtype="http://data-vocabulary.org/Review-aggregate">
<span itemprop="rating">4.4</span> stars, based on
<span itemprop="count">89</span> reviews
</span>
</div>
The following code shows an example of the tags that are used to mark up the product name, description, price, availability, and review of a product in schema.org format.
<div itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Sleek Occasional Table</span>
Product description:
<span itemprop="description">
The sleek styling makes this occasional table a perfect addition to your home.
Made of oak wood with a tempered glass top and forest green-finish wood
frame. Measures 48" in width, 24" in length, and 19" in
height. Some assembly required.
</span>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<span itemprop="price">$179.99itemprop="price">$179.99</span>
<span itemprop="availability" href="http://schema.org/InStock" content="in_stock"/>
In stock
</span>
</div>
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
Rated <span itemprop="ratingValue">4.4itemprop="ratingValue">4.4</span>/5
based on <span itemprop="reviewCount">89</span> customer reviews
</div>
<div>
To test how your pages appear in Google search results, see Rich Snippets Testing Tool
Search engine optimization (SEO) for WebSphere Commerce Version 7 to Feature Pack 2
Search engines, such as Google, are considered to be one of the most important channels for a site to reach new customers. To build a loyal customer base, the first step is
to reach new customers and search engines provide an effective way to reach new customers.
Dynamic, database-driven URLs, such as those generated by WebSphere Commerce, contain stop characters (?, &, and %) that can easily overwhelm search engine
crawlers. For this reason, search engines limit the amount of dynamic URLs that they index. To overcome this limitation, WebSphere Commerce provides functionality to
help improve the results of search engine indexing.
WebSphere Commerce's search engine optimization feature consists of the following functions:
1. URL mapping that provides the ability to remove the stop characters by mapping WebSphere Commerce's dynamic URLs to static ones so that search engines can
index the dynamic pages.
2. Site map capability that provides an entry point for the search engine crawler to easily follow the links within your Web pages.
3. Page content optimization that facilitates keyword modification so that the page is ranked high in search engine results. It provides the ability to easily modify words
in the locations that are important for crawlers, by using the Product Management GUI, or by using the Change Pages GUI in WebSphere Commerce Accelerator.
We have provided the functionality to remove the inhibitors so that your Web pages can be indexed by search engines and to facilitate the optimization of page content.
The ranking of your pages in the search results depends largely on how you optimize your pages.
URL Mapping
The URL mapping function allows Web pages to be accessed through a static looking URL by converting the URL from static to dynamic based on a mapping file:
7/8/2013 11:59 AM
11 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
Site Maps
A site map is used to address these two challenges:
Changes to the site are not quickly reflected in the search engine indices.
Most Web pages are designed for human visitors, not crawlers, and the design can reject crawlers due to an excessive number of graphics and large page size.
A site map helps to optimize the entire structure of the site for a crawler by providing an alternative set of Web pages built specifically for crawlers to quickly access and
index a large number of embedded pages. Site maps facilitate deep searches of the site. A deep search is when a crawler visits and indexes pages that are deeply embedded
within the site, for example, product pages that are lower in the hierarchy of the site. The following image shows how the site map function is implemented:
An effective site map is built as a high level overview of the different pages in the site and presents a large list of links to the crawler in as few pages as possible. For
example, a site map starter page can list the top categories and the categories directly under the top categories (second level categories), or even third level categories.
This reduces the number of clicks that it takes to get to any page on the site from the site map and also helps customers to navigate through the site, especially those
customers with slower internet connections. As a result, it reduces the time that it takes for the content refresh to be reflected in the search engine. As new content and
products are added to the site, the site map becomes the easiest way to bring this content forward to be indexed by crawlers.
The following image is an example of a site map starter page for a Madisons starter store page that contains links to the main category pages and their product pages.
7/8/2013 11:59 AM
12 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
Note: It is possible that the site map might affect positioning within search results in search engines such as Google, as if the search engine finds two URLs that link to the
same content, they might rank that result lower if it assumes the site is attempting to manipulate the search algorithms in repeatedly discovering the same content. If you
discover this to be the case, you might want to reconsider how you deploy your site's site map.
Caching considerations
Dynamic URLs can take full advantage of caching. They can use either WebSphere dynamic caching at the Application Server, or edge caching, including the WebSphere ESI
plug-in at the Web Server and the caching proxy in WebSphere Edge Components. Static URLs can only use WebSphere dynamic caching at the Application Server.
7/8/2013 11:59 AM
13 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
7/8/2013 11:59 AM
14 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
or
perl WC_installdir/samples/urlmapping/bin/urlmapping.pl URL_Mapping_File target_directory file
Parameters
URL_Mapping_File
The name of the URL Mapping file.
target_directory
The directory where the JSP files will be output.
starting_directory
The name of the directory containing the dynamic JSP files.
file
The name of a specific file to convert.
Command line example:
URL mapping example:
Original a:href URL syntax:
CategoryDisplay?catalogId=<%=catalogId%>&categoryId=<%=category.getCategoryId()%>&storeId=<%=storeId%>
Converted a:href URL syntax:
Category_<%=catalogId%>_<%=storeId%>_<%=category.getCategoryId()%>
Limitations: This script does not handle JSTL or tags generated dynamically by either Java or other scripts such as out.println("<a
href=\"AugInterest?aucItemId=<%=aucId%>\">")
b. URL Mapping Java Application for JSTL (URLMappingConvertor)
Prerequisite: Java executable is allowed to run in the command prompt window or Unix terminal
Command syntax:
java com.ibm.commerce.util.URLMappingConvertor URL_Mapping_File target_directory
Parameters
URL_Mapping_File
The name of the URL Mapping file.
target_directory
The directory where the JSP files will be output. The JSP files in all subdirectories under this target_directory will also be updated.
Important: Ensure that the classpath parameter is set. If the classpath parameter is not set, you will get ClassNotFound exceptions. For example:
java -classpath Enablement-BaseComponentsLogic.jar com.ibm.commerce.util.URLMappingConvertor URL_Mapping_File target_directory
Command line example:
java com.ibm.commerce.util.URLMappingConvertor WC_eardir/xml/mapper/SEOUrlMapper.xml SiteMap
URL mapping example:
Original <c:url> tag syntax:
<c:url var="TopCategoriesDisplayURL" value="TopCategoriesDisplay">
<c:param name="storeId" value="${WCParam.storeId}" />
<c:param name="catalogId" value="${WCParam.catalogId}" />
<c:param name="langId" value="${langId}" />
</c:url>
Converted <c:url> tag syntax:
<c:url var="TopCategoriesDisplayURL"
value="TopCategoriesDisplay_${WCParam.storeId}_${WCParam.catalogId}_${langId}" />
Limitations:
Any tags other than <c:param> within <c:url> are ignored. For example:
<c:url var="ProductDisplayURL" value="ProductDisplay">
<c:param name="productId" value="${product.productID}" />
<c:param name="langId" value="${langId}" />
<c:param name="storeId" value="${WCParam.storeId}" />
<c:param name="catalogId" value="${WCParam.catalogId}" />
<c:if test="${ !empty WCParam.parent_category_rn }" >
<c:param name="parent_category_rn" value="${WCParam.parent_category_rn}" />
<c:param name="view" value="imageView" />
</c:if>
</c:url>
becomes:
<c:url var="ProductDisplayURL" value="ProductDisplay_${product.productID}_${langId}_${WCParam.storeId}_${WCParam.catalogId}_
${WCParam.parent_category_rn}"">
<c:param name="view" value="imageView" />
</c:url>
This script does not handle standard JSP tags or tags generated dynamically by either Java or other scripts. For example:
out.println("<a href=\"AugInterest?aucItemId=<%=aucId%>\">").
c. Manually, change the dynamic URLs in JSP pages to static URLs.
8. If you are using a site map, include a link to the site map starting page from the header, footer, or sidebar.
Description
7/8/2013 11:59 AM
15 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
Product pages
For catalog entry and category pages, use the Product Management tools to set and appropriate data bean methods to display content in your JSP pages.
In particular, to change the product information, use the Catalog Entry page, as described in Changing a product. Use the appropriate fields to store text
in the different page locations, as follows:
page title
Short Description field
heading
Auxiliary Description field
alt
second Auxiliary Description field
body
Long Description field
meta keyword tag
Keyword field
To display page content in strategic locations on your custom product JSP pages, use the getDescription() method of the ProductDataBean data bean.
Store Home
page
Use the Change Profile function of the WebSphere Commerce Accelerator, as described in Changing the store name and description.
Other pages
Use the Change Pages function of the WebSphere Commerce Accelerator, as described in Changing text in store pages and in notification messages.
7/8/2013 11:59 AM
16 of 16
http://pic.dhe.ibm.com/infocenter/wchelp/v7r0m0/advanced/print.jsp?top...
Use the Sitemap.jsp file to generate all of the URLs that you want a search engine, such as Google, to index. The .jsp file is located under the root of each store for which
you have generated a site map; for example, WC_eardir /Stores.war.
The Sitemap.jsp file uses a storeId, or a list of catalog IDs as its parameters, and generates URLs that access all the categories and catalog entries of the store, in all the
languages supported by the store. The Sitemap.jsp files provided are samples based on the URLs in the ConsumerDirect and AdvancedB2BDirect starter stores only. You can
add or update any URLs in these files provided that they conform with the Sitemap Protocol v0.9.
If you have customized your store, and have to create your own Sitemap.jsp file, you must adhere to the following conventions outlined at the Sitemap Protocol v0.9 web
site:
The Sitemap.jsp file must be encoded in UTF-8.
Each URL must be absolute such as http://example.com.
Use the W3C Date and time formats such as YYYY-MM-DD.
All URLs should be properly escaped using entity escape codes, and follow the RFC-3986 standard for URIs, the RFC-3987 standard for IRIs, and the XML standard.
The generated site map does not contain URLs that start with HTTPS protocol. URLs starting with https are ignored if they are in a site map whose URL starts with
http, and vice versa. For example, if the site map is under http://example.com, any URL that starts with https://example.com in the site map is ignored. To avoid
incomplete crawling, you must list only one type of URL.
If the catalogIds are not passed by the command, the master catalog for the store is used to generate the URLs. In the following example the catalogIds are provided,
and the site map is generated using the URLs of the pages in those catalogs.
/Sitemap.jsp?storeId=10101&catalogIds=10101,10151&hostName=chutes.torolab.ibm.com
Where:
storeId_i
The ID of the store for which the site map is generated, such as 10101.
catalogId_i
The catalogId for a store with storeId_i. Multiple values can be provided for the same i, such as catalogId_i=value1&catalogId_i=value2
hostname
The host name of the production server later used to host the sitemap.xml files. This parameter is required when the command is executed on a staging
server and the sitemap.xml file is hosted on a production server. Specify the host name as name.domain .
The following example shows how a Sitemap.jsp generates an XML file:
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2005-01-01</lastmod>
</url>
</urlset>
Where:
<loc>
URL of the page. All the URLs that the merchants want the Google search engine to index. The following views are included in the site map for WebSphere
Commerce:
TopCategoriesDisplay
CategoryDisplay: the URLs for CategoryDisplay are generated for each top category and subcategory.
ProductDisplay: the URLs for ProductDisplay are generated for each product, item, bundle, and package.
PrivacyView
ContactView
HelpView
<lastmod>
The date the JSP page was modified last. For the CategoryDisplay page, the field LASTUPDATE of the table CATGROUP can be used as the last modification date.
For the ProductDisplay page, the field LASTUPDATE of the table CATENTRY can be used as the last modification date.
7/8/2013 11:59 AM