Pages

Wednesday, July 27, 2011

Stop Search Engines to Indexing your site

This is something unrelated to IBM WCS but I encountered a situation where I had to do this on a IBM WCS powered ecommerce site.
To prevent a Search Engine from indexing a page, place the code below between the <HEAD> and </HEAD> tags.


<META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW">

This tag tells the robots not to index this page and not to follow any links within the page.

<META NAME="ROBOTS" CONTENT="NOINDEX,FOLLOW">

This tag tells the robots not to index this page, but follow any links within the page.


Another way is to place a Robots.txt file under the webroot folder of the webserver with the following contents


User-agent: *
Disallow: /
 
This will disallow indexing on the whole site 

Wednesday, July 13, 2011

Creating JSON object in WCS

Websphere Commerce provides a jsp tag to make it simple to generate a JSON object. For example, a product JSON might have to be created depending on the business requirements.

The details of the jsp tag is given below
<wcf:json object="${productJSON}"/>

where productJSON is an object (generally a Map) which gets converted to a JSON object.

Map contains key value pairs which are translated to JSOn as below

{
   Map {
         color: red
         price:20
}
}

Tuesday, July 5, 2011

Finding which APAR is installed on your Commerce instance


To find if a particular APAR is installed or find all APARs those are installed on your websphere commerce instance, check for the file NIFStack.xml or NIFHistory in the following path

<<CommerceInstallPath>>\properties\version\update\backup

Thursday, June 30, 2011

Extended site user login issue


This is an issue that I faced when creating a new extended site from the extended site Hub. After the store was created, I registered as a customer on the site. But, I couldn’t login to the site with error saying “user does not have the authority to perform the action”.
Finally after much research I found that the registered user does not have an entry in the MBRROLE table with role id -29 (registered user) for the Org Entity (foreign key to ORGENTITY table. It’s basically the site). Also, apparently the organisation structure was modified as per the requirements of the organisation. I had to do the following entries in order to enable users registering on the site to login.
Open MemberRegistrationAttributes.xml and under <UserRoles> add a new entry for user registration type for the new store











This will still not allow already registered users to login. For that I had to make an entry in the MBRROLE table with ROLE_ID=-29 for the site.

Wednesday, June 29, 2011

The value of the parameter URL is not correct


When integrating IBM websphere commerce with external third party systems like paypal, payment express, etc., there can be situations when an error “The value of the parameter URL is not correct” occurs. This error occurs for a redirectView – probably a return URL passed back from PayPal for example.

This may be the cause of enabling URL redirect filtering. This is configured in the instance xml (or wc-server.xml in Developer toolkit). Locate the <Module> tag for the store web module



        


        
        
        


To prevent the error, either turn off the URLRedirectFilter (not recommended on prod as this is in place to prevent phishing attack or enter the <AllowedHost> entries.

More information on the links below