Pages

Wednesday, May 22, 2013

Specify landing pages for search terms in WCS FEP2+

Landing pages for Search Terms WCS FEP2+


From FEP2 onwards, IBM provides a feature in management center where the user can configure landing pages for search keywords. For example,

search term                                             landing page
help                                                         HelpContactUsView

A specific requirement was to display the same view (ContentDisplayView) but with different parameters based on different search terms as in for search term "Terms and Conditions" the landing page should be ContentDisplayView?emsName=xxx where as for "privacy policy" it should be ContentDisplayView?emsName=yyy

Configuring this scenario using a relative path of the view by passing in the parameters doesn't work. However, landing page can be an absolute URL with query parameters like shown below


Instead of ContentDisplayView as the landing page, you can have http://hostname/webapp/wcs/stores/servlet/ContentDisplayView?storeId=nnn&catalogId=xxx&emsName=zzz

This fulfills the requirement of associating the same landing page with different search terms and different URL parameters.

Tuesday, February 26, 2013

Displaying Search Facets in WCS FEP5



Until about FEP4, the search facets data was in SRCHATTR and SRCHATTRPROP tables. SRCHATTR defines the search attributes and SRCHATTRPROPS defines the properties for the attributes (like facetable, displayable, searchable etc). 

In Feature pack 5, two new tables for facets are available namely, FACET and FACETDESC

As an example, to make price facets work for a different currency that is not supported out of the box, like AUD, we first need to create a search attribute (SRCHATTR table) with IDENTIFIER _cat.OfferPrice_AUD 

For the above search attribute, create a search attribute property name “facet” and property value “price_AUD:{* 100} 100;{100 200} 200;{200 300} 300;{300 400} 400;{400 500} 500;{500 *}” (adjust the range of facet as required)

Now add a row in FACET table with a reference to SRCHATTR_ID created in previous steps. Add appropriate descriptions to FACETDESC table.

Update registry and clear cache and should be able to view the facet on the storefront.

Loading Attribute Dictionary Attributes

Create two csv files as below

AttributeDictionaryAttributeAndAllowedValues.csv 

This contains the attribute name and allowed values AttributeDictionaryAttributeAndAllowedValues,,,,,,,,,,,,
Identifier,Type,AttributeType,Sequence,Displayable,Searchable,Comparable,Name,AllowedValue1,AllowedValue2,AllowedValue3,AllowedValue4,AllowedValue5,Delete

DRColour,STRING,AllowedValues,1.0,true,true,true,Colour,Black,Silver,,,,
DRTuner,STRING,AllowedValues,2.0,true,true,true,Tuner,Single tuner USB HDD PRV,,,,, 
  • The first two lines constitute the header.
  • The first column is an identifier for the attribute.
  • The 2nd column defines the type of the attribute value (STRING, DECIMAL, WHOLE NUMBER)
  • The 3rd column specifies the attribute type. Two types are possible (AllowedValues, AssignedValues). Using AllowedValues, business user can select one of the available values for an attribute. Using AssignedValues, business users can enter the value for the attribute. AllowedValues can be reused and assigned to a different catentry. This column will in most cases be AllowedValues.
  • The 4th Column is Sequence which defines the ordering of attributes. (1.0, 2.0, etc)
  • The 5th, 6th and 7th columns are the displayable, searchable and comparable field which is set to either true/false.
  • The 8th column defines the name of the attribute (like Colour, Size, etc)
  • Columns from 9 onwards to 13 represent the possible allowed values for an attribute.
  • Column 14 defines if the attribute has to be deleted by setting the Delete to 1 

CatalogEntryAttributeDictionaryAttributeRelationship.csv 

CatalogEntryAttributeDictionaryAttributeRelationship,,,,,,
PartNumber,AttributeIdentifier,ValueIdentifier,Value,Usage,Sequence,Delete
P_NZ40006688,DRColour,Black,,Descriptive,1,
P_NZ40006688,DRTuner,Single tuner USB HDD PRV,,Descriptive,2,
  • The first two lines constitute the header.
  • The 1st column defines the partnumber of the catentry to which an attribute is to be associated
  • The 2nd column is an identifier that identifies the attribute that needs to be associated with the catentry
  • The 3rd column is the identifier that identifies the value (an attribute can have multiple values) that needs to be associated with a catentry
  • The 4th column represents the value. (can be same as value identifier or empty)
  • The 5th Column defines the usage which can either be “Descriptive” or “Defining”. For SKU’s use Defining
  • The 6th column defines whether the association has to be deleted. Specifying 1 will delete any existing row. This can be 0 or empty for loading attributes.

TABLES AFFECTED 

ATTR – Contains the attribute definition
ATTRVAL – contains the attribute values
CATENTRYATTR – Contains the link between the catentry and the attribute

Note: These attributes are loaded to the store that owns the master catalog. In case of extended sites store it is the ExtendedSites CAS (Master catalog store entity)

Friday, February 22, 2013

Viewing and publishing Madisons Store in v7 FEP 5 (Developer Environment)



By default, in WCS Feature pack 5, the Madisons Store archives are not displayed in the publish wizard in administration console. These can be made available by following the steps below


Create a folder structure “conf/sar” inside WCDE_installdir/


Go to the starterstores folder in WCDE_installdir/starterstores and copy over any sar that is not available for publish in the wizard (like MadisonsStorefrontAssetStore-FEP.sar) from ExtendedSites folder to the conf/sar folder created above


Open the administration console and use the publish wizard and you should be able to see the sar file in the “Default” option of the publish wizard.

Thursday, February 21, 2013

NoSuchMethodError for getBIProvider()



After migrating from version 6 to version 7 of IBM Websphere Commerce, an exception is generated during the invocation of a getBIProvider() method when business user selects a store in Management Center.



The getBIProvider() method was introduced in version 7 of WCS. After the migration from v6 to v 7 of WCS, the coremetrics.jar file doesn’t get removed from the Stores/WEB-INF/lib directory.  Once removed, the latest coremetrics related class files are loaded.

Reference
http://www-01.ibm.com/support/docview.wss?uid=swg21503410

Friday, July 20, 2012

Registering a Websphere Application Server instance as a windows service.

By default, the default profile of the WAS is registered as windows service during installation. Any new app server profiles that you create can be registered using the following command
 WASService.exe -add <<serviceName>> -serverName <<serverName>> -profilePath <<profilePath>> -startType automatic 

where <<serviceName>> is the name of the service that appears in the component service prepended with "IBM Websphere Application Server V7.0"  
<<serverName>> is the name of the server to start (e.g. server1)<<profilePath>> is the path to the websphere application server profile
startType can be either automatic, manual or disabled
     
Following is the usage for the command

Usage: WASService.exe (with no arguments displays this help)
                    || -add <service name>
                       -serverName <Server>
                       -profilePath <Server's Profile Directory>
                           [-wasHome <Websphere Install Directory>]
                           [-configRoot <Config Repository Directory>]
                           [-startArgs <additional start arguments>]
                           [-stopArgs <additional stop arguments>]
                           [-userid <execution id> -password <password>]
                           [-logFile <service log file>]
                           [-logRoot <server's log directory>]
                           [-encodeParams]
                           [-restart <true | false>]
                           [-startType <automatic | manual | disabled>]
                    || -remove <service name>
                    || -start <service name> [optional startServer.bat parameters]
                    || -stop <service name> [optional stopServer.bat parameters]
                    || -status <service name>
                    || -encodeParams <service name>


                   
To remove a service, use the following command
                   
WASService.exe -remove SOLRSL02Node01
Remove Service: SOLRSL02Node01
Successfully removed service

Thursday, June 14, 2012

Implementing SEO on IBM WCS 7 Feature pack 3 or greater

Enabling SEO for a store

Ensure that the store is > FEP3, i.e., FEP3 sar is published and Search based navigation is enabled in management centre. SEO is not enabled by default after publishing the store. We need to enable SEO for a store by inserting a row in the database table SEOURL as below


insert into SEOURL values
(-100001,'StoreToken:CatalogToken','10352:10021',null,null,null,null,0)

We are inserting a token for storeId and catalog id where store id is 10352 and catalogId is 10021.

This will enable the SEO URLs for the store. Also we need to ensure that in our JSP’s all the URL formation has a patternName defined and this patternName should also be defined in a SEO URL Pattern xml file which will be discussed below.  

Getting rid of the /webapp/wcs/stores/servlet context path

Open wc-server.xml and find the element <SEOConfiguration>. Add the following property to the element.

<SEOConfiguration defaultUrl="" dynamicUrl="true" enable="true" >
 <context-root-rewrite value="/shop" />
</SEOConfiguration>

After restarting the server, all URL’s will be rewritten as www.domain.com/shop/..We also need to configure the webserver to pass through all the requests with /shop to /webapp/wcs/stores/servlet (remember we are not actually changing the context root but we are pretending to)

On a IBM HTTP server, the following redirect rule will suffice (usually done in httpd.conf)

## shop url Pass through
RewriteRule /shop/(.*)$ /webapp/wcs/store/servlet/$1  [PT,L,NE]

Generating SEO content for all dynamic categories and products

This is done by using the batch file provided in commerce v7.0 as shown below (assuming db2 database)

From C:\WCDE_ENT70\bin (Commerce installation path)

seourlkeywordgen.bat <<storeId>> <<catalogId>> <<languageId>> <<path to wc-server.xml>> <<path to wc-admin-component of infrastructure-fep component>> <<db2user>> <<dbpassword>>

where
- storeId is the store which owns the catalog
- catalogId is the sales catalog Id for the store
- languageId is -1 for en_US or all for all languages
- path to wc-server.xml in the EAR
- path to infrastructure-fep wc-admin-component.xml  e.g. C:\WCDE_ENT70\workspace\WC\xml\config\com.ibm.commerce.infrastructure-fep\wc-admin-component.xml
db2 user Id
- db2 password 
This will generate the keywords for the products and categories based on the names.

Now every link in the JSPs that are being formed for the categories and products should have a patternName defined. This patternName maps to the one of SEOURLPatterns*.xml which can be found under Stores/WebContent/WEB-INF/xml/seo/stores/<<storename>>

Thursday, February 16, 2012

IBM WCS Indexing Product attributes and Enabling Facets

IBM WCS Indexing Product attributes(Classic Attributes)

  1. Product attributes can be either defining (SKUs) or descriptive.
  2. There are 30 String fields and 10 Integer and Float fields each that can be used for attribute indexing.
  3. To index an attribute, enter the attribute name in “ATTRNAME” field of “CLSATTRSRCHCONF” table. For e.g., enter “Colour” if you have colour as the defining/descriptive attribute for items
  4. Update the separator to the relevant separator character. For me it is a semicolon ;
  5. Once this is done, run the pre-processing and then build index.
  6. This will index the catalog attributes in Solr

IBM WCS Enabling Facets on Product attributes

Indexing will not enable the facets display on the store. To enable facet display, follow the steps below:

We need to add a search attribute for Colour in SRCHATTR table (Assuming colour is my product attribute)
-10001    0    CatalogEntry    _cat.Colour    0

Also add the search attribute properties in SRCHATTRPROPS as below
-10001    rank    cas_f1    0
-10001    search    cas_f1    0
-10001    display    cas_f1    0
-10001    filter    cas_f1_ntk_cs    0
-10001    catalogFilter    cas_f1_ntk_cs    0
-10001    facet    cas_f1_ntk_cs    0

Where cas_f1 and cas_f1_ntk_cs are the fields defined in solr core. Restart the websphere commerce server once done and you have the attribute facets appearing on the page.

Monday, December 19, 2011

Shipping Calculation Code


Shipping jurisdictions, rules and charges can be configured using calculation code data model within websphere commerce.

SHIPMODE table consists of the shipping mode / method.
SHIPMODEDESC table consists of the description of the shipping method defined above
JURST consists of a Jurisdiction definition and JURSTGROUP is the grouping of the Jurisdictions. The JURST table also consists of the zip code range for which the shipping rule may apply.

JURSTGPREL table defines the relationship between JURST and JURSTGROUP. The SUBCLASS field of JURSTGPREL defines whether it is a ShippingJurisdiction (1) or TaxJurisdiction (2)

SHPJCRULE contains the relationship between the Jurisdiction and the Shipping mode. If multiple rows from the SHPJCRULE table qualify for the rule, then the row that has the highest precedence set will be applied.  If two rules have the same precedence then both the rules are applied.