Friday, January 23, 2015

Message recipients

The recipients for Message types (for sending emails) is stored in

ISEDITATT table

Labels: , ,

Monday, June 02, 2014

Scheduler Queries

Find status of your jobs based on job name:


select * from SCHSTATUS WHERE SCSJOBNBR IN (SELECT SCCJOBREFNUM FROM SCHCONFIG WHERE SCCSTART = '2014-06-02'  AND SCCPATHINFO = 'SomeCmd')

Find active jobs based on job name

SELECT * FROM SCHACTIVE WHERE SCSJOBNBR IN (SELECT SCCJOBREFNUM FROM SCHCONFIG WHERE SCCPATHINFO = 'SomeCmd')

Wednesday, February 12, 2014

DB2 Update Replace String with another String

In DB2, REPLACE function allows to replace a string with another string. This can be used in update statement as below:

Suppose you want to replace text "India" with "USA" in COLLDESC.MARKETINGTEXT column,
below statement should do it.


UPDATE COLLDESC SET MARKETINGTEXT = (select REPLACE(MARKETINGTEXT,'India,'USA') from COLLDESC WHERE COLLATERAL_ID=123) WHERE COLLATERAL_ID=123;

Tuesday, June 04, 2013

Where do the commands in Scheduled Job come from?

In Administration Console, while scheduling a new Job, Infocenter only mentions that the Commands which needs to be scheduled appear in the drop down List.

These are actually picked from the struts configuration files, hence you need to ensure that the requisite Commands are present in Struts configuration file. Also, ACP should be run for this, to ensure jobs run properly.

Wednesday, March 27, 2013

DB2 SQL Error: SQLCODE=-805, SQLSTATE=51002, SQLERRMC=NULLID.SYSLH203

I encountered this exception when running a custom batch job in WCS which used JDBCHelper to update data into WCS Tables.

The reason for this is that the JDBCConnection was not closed.
It looks like we need to close and open the connection frequently, else it results in too many open statements and results in this error.

Tuesday, March 26, 2013

Obtaining Primary Key while using JDBCHelper

If you plan to insert a new record into a WCS OOB or Custom table using JDBCHelper, you should ensure that there is no conflict between the EJBs and your program.

The KEYS.PREFETCHSIZE field reserves  a block of primary key values for use between the EJBs, so if you try doing an insert by doing SELECT MAX+1 then , it would result in Duplicate Key exception.

To avoid this, use the KeysManager to get the next primary key for using in JDBCHelper.

long
primaryKeyId= com.ibm.commerce.key.ECKeyManager.singleton().getNextKeyAsLong("table_name");
This would ensure you do not pick up a Key which is already being used by the EJBs.







Labels: , ,

Monday, December 31, 2012

Massload Tool

Thursday, December 27, 2012

Extract String Value from XML attribute in a text file

I have an xml which is similar to below in a file called filename.txt

<tag1 attribute1="1234"></tag1>
<tag1 attribute1="4567"></tag1>

I need to extract the values of the attributes alone into another text file.
To do this in unix, a combination of grep and sed works as below:

grep "attribute1=" filename.txt|sed 's/.*attribute1="\([0-9]*\).*/\1/'   > valuelist.list

This will write the list of values to valuelist.list

Tuesday, September 25, 2012

Find the Websphere Commerce App server where request goes

To identify which app server we are hitting , we can use the clone ID in jsession cookie

Get the JSESSION cookie from browser. 
The second part following ":" is the clone iD.
Once you get it, you can go to Was Profile / Deployment Manager/config/cells/../nodes/../servers/web server/plugin-cfg.xml and search for the clone id to get the server name.

Monday, June 04, 2012

Cannot get security object from WCCM. Exception

This exception occured while Starting the Websphere Commerce Server.

An error occurred initializing, server1 [class com.ibm.ws.runtime.component.ServerImpl]
com.ibm.ws.exception.ConfigurationError: com.ibm.websphere.ssl.SSLException: Cannot get security object from WCCM.
 at com.ibm.ws.ssl.core.SSLComponentImpl.initialize(SSLComponentImpl.java:208)
 at com.ibm.ws.runtime.component.ContainerHelper.initWsComponent(ContainerHelper.java:1191)
 at com.ibm.ws.runtime.component.ContainerHelper.initializeComponent(ContainerHelper.java:1098)
 at com.ibm.ws.runtime.component.ContainerHelper.initializeComponents(ContainerHelper.java:900)
 at com.ibm.ws.runtime.component.ContainerImpl.initializeComponents(ContainerImpl.java:776)
 at com.ibm.ws.runtime.component.ContainerImpl.initializeComponents(ContainerImpl.java:750)

Solution: WC Dir/wasprofile\config\cells\localhost\security.xml may be corrupted

Restore this from back up.

Note: It is a good practise to backup the WC Install directory and RAD directory as every once in a while WCS Installation tends to get corrupted.

Monday, May 21, 2012

Removing Access Control Policies

If you need to delete access control policy you accidentally created, looks like removing this from Org Admin Console is the only way.

http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.admin.doc/tasks/taxdepol.htm?resultof=%22%64%65%6c%65%74%65%22%20%22%64%65%6c%65%74%22%20%22%61%63%63%65%73%73%22%20%22%63%6f%6e%74%72%6f%6c%22%20

Let me know if you find any other procedure for this.

Labels: ,

Wednesday, May 16, 2012

Finding files modified after initial commit in SVN

I ran into a requirement where i need to retrieve the files changed in SVN after initial commit of the Websphere Commerce code. This is to extract only those files which have been customized and did not need the OOB JSPs.

Thanks to Chris Hope for the following article which explains how to do this.

http://www.electrictoolbox.com/tortoisesvn-exporting-changed-files/

Labels: ,

Tuesday, March 13, 2012

Datasource demo Error

Following errors are seen after deployment


javax.naming.NameNotFoundException: Context: name: jdbc/WebSphere Commerce DB2 DataSource demo: First component in name WebSphere Commerce DB2 DataSource demo not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]

servlet E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet *.jsp in application Exception created : com.ibm.websphere.servlet.error.ServletErrorReport: com.ibm.commerce.exception.ECSystemException: The following command exception has occurred during processing: "com.ibm.ws.naming.util.InvalidObjectException: Some object reference in the name [EJBName]Home" relative to the context "clusters/WC_comm01" is invalid. Some possible causes include a context binding in the name which refers to a destroyed context, or an object binding which contains an invalid EJBHome reference. [Root exception is org.omg.CORBA.INV_OBJREF: Could not resolve IOR string. vmcid: 0x0 minor code: 0 completed: No]".


This happens when multiple data sources are bound during deployment.
To fix this, go to profiles/[DeploymentManagerdirectory]/config/cells//applications/WC_.ear/deployments/WC_/WebSphereCommerceServerExtensionsData.jar/META-INF

Open ibm-ejb-bnd.xmi file. Look for multiple data sources/CMP Connection factory. Remove the Datasource demo factory or one of the datasource as the case may be.

Synchronize the nodes from WAS Console.

Wednesday, January 11, 2012

Box Shadow Support in IE7 and IE8

For emulating css3 property box shadow in IE 7 and IE 8, use following snippet in style properties

IE 7

filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135,
Color='#000000');

IE 8

-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135,
Color='#000000')

Internet Explorer cannot display the WebPage in WCS

This error happens in Websphere Commerce when the Redirect URL in the Controller Command has more than 2084 characters and IE 8 and below are unable to process this.
Solution is explained here http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/concepts/csdprogrammingguide06.htm
On Redirect from a Command, all the input parameters in Request properties are set back into the URL. All these may not be required in the landing view.
If there are repetitive parameters in the URL (typically when there are multiple items in the cart), these can be removed by setting URL = ViewName?para1_*=&para2_* etc.

Wednesday, November 23, 2011

State and Country List

Can be retrieved from CountryStateListDataBean
refers to COUNTRY and STATEPROV tables.

Thursday, September 22, 2011

Calculation Framework invocation in Product Page

In order to call Calculation framework in product page for getting tax, discount details etc, we can directly call ApplyCalculationUsageCmd with out calling OrderPrepare or OrderCalculate.
Write a command data bean which implements ApplyCalculationUsageCmd.

Monday, September 19, 2011

JSP Include

To statically include other JSPs in a JSP, use include directive. This is preprocessed.

<%@ include file="file name" %>
To dynamically include JSP when a jsp is executed, use:

<jsp:include page="file name"%>

Thursday, September 15, 2011

Inventory in WCS

4 types of Inventory

Value in STORE.INVENTORYSYSTEM=
-1. ATP - Inventory can be allocated based on on hand or back order from expected inventory. Estimated Avail Time can be obtained for items in cart.

-2. Non ATP - Inventory allocated based on on hand inventory
-3. No Inventory - For infinite inventory like digital downloads.
-4. External Inventory


Order subsystem in WCS

1. Order Capture - Shopping Cart, Shipping, Billing, Order submission
2. Order Process - coordination of inventory, billing, releasing order to fulfillment, order status tracking
3. Inventory - ATP, Non-ATP, No Inventory, External Inventory
4. Payment - plugins for offine/online payment processing

Wednesday, September 14, 2011

Access Control in WCS

There are 2 levels of access control

Role or Command Level - A particular role can be attached to a particular resource group which share a list of commands.
For views, view name should be present in ACACTION table associated to an action group and referenced in ACPOLICY table.

Resource Level - resources specified in getResources() method

Consumer Direct Store

STORE table has STORETYPE value as "B2C" for a Consumer direct store.

There are 3 organizations for a Consumer Direct store

Root - Parent organization
Default - Customers are owned by default
Seller - Can maintain different stores and Sellers

In addition each store can have a B2C organization per seller

Users in WCS

There are 3 type of users in WCS from an end consumer perspective.

Generic User - This user doesnt get assigned a unique user id. All users browsing through the site, like search pages, verticals, product pages etc are generic users

Guest User - This user gets assigned a unique user id in WCS. Required for activities like add to cart and order placement

Registered User - User gets a unique profile in the site when the user registers.

Tuesday, September 06, 2011

Creating database for WCS

By Default WCS creates cloudscape database.
If you need to switch to DB2.
Go to Toolkit bin directory.
Run setdbtype command
Run db2cmd
Run createdb.db2.bat
Example: C:\Apps\WCToolkitEE60\bin>createdb.db2.bat wcsdb db2admin admin db2admin

Change user in Windows command prompt

How to change user name in Windows Command Prompt

Syntax: runas /user:@[domain] [applicationname]
Example :runas /user:db2admin cmd

Saturday, August 27, 2005

CAT Confusions

Am sure that the title will catch hold attention of 1.5 L youngsters (And not so Youngsters) across India. The ever alluring dream of CAT. After a lot of internal debate, i decided to give it a last try this time. First time when i tried in 2001 i went into a panic mode in the Exam hall scribbling black round dots where ever i could see with my half polished pencil. After 4 years i still do the same. After taking half an hour for finding the answer for 234*23/182 i begin to think is this really for me. On an average, if we assume that in every city in india there will be one genius who can crack CAT easily the total number of CAT crackers would easily be above 5000. In that case is it any use trying to climb the Mount Everest.(Or Menaki for that matter). But human beings have never learned to act on common sense till now. That is how and why miracles happen.
As i go to write the first mockCAT of IMS tomorrow morning 10:30 ( or is it 10? i forgot) i wish all you senseless idiots the best of lucks. Remember, miracles do happen.