Saturday 29 June 2013

Websphere Commerce Interview Questions and Answers

Hi Guys,

A Good collection of Websphere commerce Interview questions and answers can found in following blog

http://www.buggybread.com/2013/03/ibm-wcs-websphere-commerce-interview.html

http://sureshraja-wcs.blogspot.co.uk/2012/08/wcs-interview-questions.html

http://kingofwcs.blogspot.co.uk/2011/01/wcs-interview-questions.html


I hope it will be useful for most of the readers ;)

Naming Conventions for Controller Command and Task Command

Standard Naming conventions for controller commands and task commands followed in OOTB is

Controller Commands : Noun+Verb combination for eg: OrderProcessCmd
TaskCommands : Verb + Noun combination for eg: ProcessOrderCmd

In case you are creating any New Controller Commands/Task Commands please follow the above naming convention as a standard practice




Loading Access Control Policy using SQL

Recently came across a nice blog on loading access control policies using SQL.

Following is the reference URL for the same

http://techhari.blogspot.co.uk/2011/12/loading-access-control-policy-using-sql.html

Loading ACP Policies - acpload

ACP Policies are loaded using acpload command mentioned below

acpload db_host_name db_name db_user db_password inputXMLFile schema_name
 
Where: 
db_host_name
is the hostname of the machine on which your development database runs. This parameter is only required for remote databases.
db_name
is the name of your development database
db_user
is the name of the database user
db_password
is the password for your database user
inputXMLFile
is the XML file containing the access control policy specification
 
 
 

setdbtype Command

setdbtype command for switching database is mentioned below

DB2:

setdbtype db2 DB2_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort dbNode] [createdb]

Oracle :


setdbtype oracle ORACLE_HOME dbName dbAdminID dbAdminPassword dbUserID dbUserPassword [dbHost dbServerPort] [createdb]

Derby/Cloudscape:

setdbtype cloudscape [createdb]

Where:
DB2_HOME
The root directory of DB2. For example, C:\IBM\SQLLIB
ORACLE_HOME
The root directory of the Oracle DBMS. For example, C:\oracle\product\11.1.0\client_1
dbName
The name of the database. For example, mall.
dbAdminID
The database administrator's ID. For example, db2admin or oracle.
dbAdminPassword
The associated password for dbAdminID
dbUserID
The database user ID that connects to the database.
dbUserPassword
The associated password for dbUserID
dbHost
The host name of a remote database server.
dbServerPort
The port number of the remote database server.
dbNode
The node name of the remote database.
createdb
If specified, the command creates a new empty database.


Connecting to Cloudscape/Apache Derby when the Server is Stopped

We can connect to Cloudscape/Apache Derby database even when the server is stopped. Use the following steps to connect to database

1.Navigate to bin folder under WC Installation Directory for eg: WCDE_ENT70\bin
2. Open ij.bat file
3. At the ij> prompt type connect '..\db\mall';
4. Write the SQLstatement you want to run and execute it.

Resetting the wcsadmin user password

It is quite obvious that you might forget the password for the wcsadmin user if you are not using it quite oftenly and we have to do a reset of the password for wcsadmin user.

Execute the following queries to reset the wcsadmin password

Cloudscape/DB2 : 

update userreg set logonpassword = x'74434f61354f51593862415655304d5
268424e54723865685653356151374a2b353163506c4261363730633d20202020202
02020202020202020202020202020202020202020202020202020202020202020202
02020202020202020202020202020202020202020202020202020202020202020202
020202020202020202020' where logonid='wcsadmin'; 

update userreg set salt = 'hsdbacehyoyn' where logonid='wcsadmin'; 

update userreg set status = 1 where logonid='wcsadmin'; 

update userreg set passwordexpired = 0 where logonid='wcsadmin';
 
Oracle :

update userreg set logonpassword = '74434f61354f51593862415655304d52
68424e54723865685653356151374a2b353163506c4261363730633d202020202020
20202020202020202020202020202020202020202020202020202020202020202020
20202020202020202020202020202020202020202020202020202020202020202020
20202020202020202020' where logonid='wcsadmin'; 

update userreg set salt = 'hsdbacehyoyn' where logonid='wcsadmin'; 

update userreg set status = 1 where logonid='wcsadmin'; 

update userreg set passwordexpired = 0 where logonid='wcsadmin';

commit;
 
Reference : http://pic.dhe.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?
topic=%2Fcom.ibm.commerce.admin.doc%2Ftasks%2Ftseresetwcsadminaccount.htm 

Debugging Access Control in Websphere Commerce

Recently I came across a nice article on Debugging Access Control in Websphere Commerce. Though its a old article but it is really helpful

Following is a URL reference for the article

http://www.ibm.com/developerworks/websphere/library/techarticles/0805_callaghan/0805_callaghan.html



Disabling Access Control Policy in Websphere Commerce (Development Environment)

In order to disable the access control policy in your development workspace follow the steps mentioned below

1. Open wc-server.xml which is located in WCDE_ENT70\workspace\WC\xml\config\wc-server.xml
2. Search for "<Instance" tag
3. Add AccessControlUnitTest="true immediately after "<Instance "
4. Save the file
5. Restart the server

After implementing this steps the server will not complain about "User does not have authority to execute Command/View"

If you want to disable access control policy for a controller command without making the changes mentioned above you can use below line in setRequestProperties()/performExecute() method of your ControllerCommandImpl class

setAccCheck(false);

Note : Use this tip for only development purpose not in Higher Environments