Most of the WCS developers are confused with the member subsystem and different types of users in WCS. Here is a small post on the different types of WCS users and their differences.
The member subsystem of WCS handles the users of a WebSphere Commerce site (Member subsystem also covers the organizations, member groups, roles and access control policies). Users of a WCS site are the business users or administrators that manage the store or end users who access the site for shopping.
A WebSphere Commerce site can have three types of users. Generic, Guest and Registered users. All the users of any WCS installation fall under any of these categories including business users and store administrators.
A generic user is a user who just accessed the site. Any user accesses a WCS website will have a userId associated. All the generic users share the same userId and for a default WCS installation the generic userId will be -2001 (At least in my case). The generic user does not have any user information.
When a generic user adds an item to the shopping cart, he/she becomes a guest user. All the guest users will have a unique userId associated. This guest user can have personal information stored in the database as they are having a unique userId. This userId is extremely important and is used for tracking their shopping cart.
A registered user is any user who signs up in a WCS system. They will have a username and password for logging into the application. They can have a permanent address in the system. Even the site/store administrators and business uses comes under this category. Any user can become a registered user by signing up or signing in to the system.
A new problem has been found in WebSphere Commerce Server sites. Because of a hard coded date in the product, customers will no longer be able to add items to their shopping carts. All WebSphere commerce sites are affected as all editions of the product has this hard coded date. When customer adds an item to the shopping cart, an error message “CMN2022E: The command is unable to determine an appropriate fulfillment center for an OrderItem.” will be displayed.
The solution to this problem is to check the SHPARRANGE table and verify that the ENDDATE field has not expired. If it is expired, update this field to a future date and restart the WebSphere Commerce Server.
update shparrange set enddate = '2018-06-22-23.00.00.000000' where enddate = '2008-06-22-23.00.00.000000
To create a new view command in WCS 5.6 we need to make a couple of database entries. i.e., we need to make an entry in VIEWREG, ACACTION, ACACTDESC, ACACTACTGP tables. For e.g.: if we want to make a new view command ‘MyNewView’, the database entries for this view command to work will be.
INSERT INTO VIEWREG(VIEWNAME, DEVICEFMT_ID, STOREENT_ID, INTERFACENAME, CLASSNAME, PROPERTIES, DESCRIPTION, HTTPS, INTERNAL) VALUES ('MyNewView', -1, 1000, 'com.ibm.commerce.command.ForwardViewCommand', 'com.ibm.commerce.command.HttpForwardViewCommandImpl', 'docname=MyNewView.jsp' , 'My New view', 0, 0);
INSERT INTO ACACTION(ACACTION_ID, ACTION) VALUES ((SELECT MAX(ACACTION_ID)+1 FROM ACACTION), 'MyNewView');
INSERT INTO ACACTDESC(ACACTION_ID, DISPLAYNAME, DESCRIPTION, LANGUAGE_ID) VALUES ((SELECT ACACTION_ID FROM ACACTION WHERE ACTION='MyNewView'), 'MyNewView', 'MyNewView', -1 );
INSERT INTO ACACTACTGP(ACACTGRP_ID, ACACTION_ID) VALUES ((SELECT ACACTGRP_ID FROM ACACTGRP WHERE GROUPNAME='AllSiteUsersViews'), (SELECT ACACTION_ID FROM ACACTION WHERE ACTION='MyNewView'));
Here the storeId I used is 1000 and the viewname is ‘MyNewView’. This is the easiest way of creating a new view command in WebSphere Commerce Server 5.
To create a new controller command we need to make a couple of database entries. i.e., we need to make an entry in URLREG, CMDREG, ACACTION, ACACTDESC, ACACTACTGP, ACRESCGRY, ACRESCGRY, ACRESGPRES tables. For eg: if we want to make a new controller command ‘MyNewCommand’, the database entries for this command to work will be.
INSERT INTO URLREG (URL, STOREENT_ID, INTERFACENAME, HTTPS, DESCRIPTION, AUTHENTICATED, INTERNAL) VALUES ('MyNewCommand', 1000, 'com.mycomp.commands.MyNewCommandCmd', 0, 'My New controller command', 0, 0);
INSERT INTO CMDREG (STOREENT_ID, INTERFACENAME, DESCRIPTION, CLASSNAME, TARGET) VALUES (1000, 'com.mycomp.commands.MyNewCommandCmd', 'My new controller command', 'com.mycomp.commands.MyNewCommandCmdImpl', 'Local');
INSERT INTO ACACTION (ACACTION_ID, ACTION) VALUES ((SELECT MAX(ACACTION_ID)+1 FROM ACACTION), 'com.mycomp.commands.MyNewCommandCmd');
INSERT INTO ACACTDESC (ACACTION_ID, DISPLAYNAME, DESCRIPTION, LANGUAGE_ID) VALUES ((SELECT ACACTION_ID FROM ACACTION WHERE ACTION='com.mycomp.commands.MyNewCommandCmd'), 'MyNewCommand', 'My New controller command', -1);
INSERT INTO ACACTACTGP(ACACTGRP_ID, ACACTION_ID) VALUES ((SELECT ACACTGRP_ID FROM ACACTGRP WHERE GROUPNAME='AllSiteUsersViews'), (SELECT ACACTION_ID FROM ACACTION WHERE ACTION='com.mycomp.commands.MyNewCommandCmd'));
INSERT INTO ACRESCGRY(ACRESCGRY_ID, RESCLASSNAME) VALUES ((SELECT MAX (ACRESCGRY_ID) + 1 FROM ACRESCGRY), 'com.mycomp.commands.MyNewCommandCmd');
INSERT INTO ACRESGPRES(ACRESCGRY_ID, ACRESGRP_ID) VALUES ((SELECT ACRESCGRY_ID FROM ACRESCGRY WHERE RESCLASSNAME='com.mycomp.commands.MyNewCommandCmd'), 10119 );
Here the storeId I used is 1000 and the command interface is ‘com.mycomp.commands.MyNewCommandCmd’ and the implementation class is ‘com.mycomp.commands.MyNewCommandCmdImpl’. This is the easiest way of creating a new controller command.
To add a new menu in organization administration console we need to edit the ‘BuySiteAdminConsole.xml’ which is present in the
the following locations.
Commerce Toolkit installation directory\xml\tools\buyerconsole\BuySiteAdminConsole.xml
WCS installation directory\CommerceServer\xml\tools\buyerconsole\BuySiteAdminConsole.xml
If we want to add a new menu, use the menuitem tag or else (ie for adding submenu) use the node tag.
Here name of the menu will be the text displayed in the admin console against the menu. For The users tag contains the roles of all the users who can access this menu. The node tag represents a sub menu. the url will be the action associated with the submenu. Depending on our requirement we can have Wizard, Notebook, Dialog, DynamicList etc views. In the above example the ActionXMLFile points to an xml file present in the ‘mydir’ directory. Before using the xmlfile name here we need to define the xml file definition inside the resources.xml file present in the ‘mydir’ directory. cmd stands for the viewname associated with the submenu action.
The name of the xml file (which is defined inside the attribute ‘name’) is coming from the corresponding properties file. The default properties file for BuySiteAdminConsole.xml is BuyAdminConsoleNLS.properties. This file is present inside the following directory.
Commerce Toolkit Install Directory\properties\com\ibm\commerce\tools\buyerconsole\properties\BuyAdminConsoleNLS.properties
Appserver install directory\AppServer\installedApps\\\properties\com\ibm\commerce\tools\buyerconsole\properties\BuyAdminConsoleNLS.properties
Depending upon the locale you may need to edit one more properties file which is present in the same directory. For eg: if your locale is en_us you need to edit BuyAdminConsoleNLS_en_US.properties file also.