Posted by Albin Joseph | Posted in WebSphere, WebSphere Commerce | Posted on 19-02-2008
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.
Posted by Albin Joseph | Posted in WebSphere, WebSphere Commerce | Posted on 18-02-2008
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.
Posted by Albin Joseph | Posted in WebSphere, WebSphere Commerce | Posted on 07-10-2007
The following code give a reference to HttpSession object in a WebSphere Commerce Controller Command.
HttpSession session = ((com.ibm.commerce.webcontroller.HttpControllerRequestObject) getCommandContext().getRequest()).getHttpRequest().getSession(); |
Posted by Albin Joseph | Posted in WebSphere, WebSphere Commerce | Posted on 07-10-2007
History of 11 year old e-commerce software leader Websphere Commerce.
WCS History