Posts

Showing posts from January, 2013

Implementing AjaxAction based Commands

A process of communicating with Commerce commands in an Ajax fashion without refreshing the page. The response generated in the Command is converted to a JSON ( JavaScript Object Notation). However this is not done using any Ajax framework at the client end. Commands Create a regular command interface and implementation in Commerce. Only difference in writing this AjaxAction based command compared to a regular command is the inclusion of the line at the end of performExecute() method setResponseProperties(rspProp); Here rspProp is the TypedProperty variable in the method. All the data that is required to be sent back to the source (JSP/browser) that called this command should be placed in the TypedProperty variable. Struts Configuration ·          Instead of setting the type of < action-mappings > as BaseAction , it is set to AjaxAction ·          There is no <global-forwards> entry required for this since only data object is got back instead o

Cleaning Up WebSphere Commerce Databases

In the IBM Rochester lab, the Business Solutions Test (BST) team has implemented IBM's WebSphere Commerce in several of its customer-like scenarios. While doing so, the BST team discovered the importance of the Clean WCS Database (CLNWCSDB) command. Here, I'll explain how to use the command for both WebSphere Commerce Suite Version 5.1 (WCS V5.1) and WebSphere Commerce Version V5.4. Cleaning up unnecessary data in a WebSphere Commerce site can improve performance, decrease the amount of storage needed to host the WebSphere Commerce site, and decrease the amount of time required to do future upgrades and migrations. A number of different tables can be cleaned up, and this cleanup can be done on an individual basis, depending on the needs of the site. If rows need to be deleted from a WebSphere Commerce database, it is important to use the CLNWCSDB command in order to properly handle constraints.   CLNWCSDB works in conjunction with the WebSphere Commerce CLEANCONF tab

CommandFactory.createCommand() method

This method searches the command registry(CMDREG table) for an entry corresponding to the specified command name (Interface)and storeId. if no entry is found for specified store, it will look for an entry corresponding to storeId=0. if both fail, it will check for a default implementation of the command from the interface and returns an entry that represent the default implementation of the interface. Ex: static final String defaultCommandClassName = "com.ibm.commerce.sample.commands.MyNewControllerCmdImpl"; so, when you make a command with the CommandFactory class, you need to pass in the interface name, rather than the implementation class, since the field looked up in the database is the CMDREG.INTERFACE field. if you specify the implementation class (MyNewControllerCmdImpl) rather than the interface (MyNewControllerCmd) may result in a ClassNotFoundException.

How to copy one user details to another user?

I feel this is a very interesting feature.. 1.How will you move the shopping cart details of the guest user to register user after login? 2.How you will move guest users shopping list to register user? 3.How you will move guest user Address to the Registered user ? One of the solution is :  MigrateUserEntriesCmdImpl This task command is used to migrate resources owned by one user to another. The mandatory resources that are migrated are Addresses, Current Orders, Interest Items, Order Items, Orders, and Order templates. Some of the methods are :     migrate address     migrate orders     migrate coupons     migrate current orders     migrate experiment results     migrate interest item list

How to activate data beans in JSP pages?

A data bean is a Java bean that is used within a JSP page to provide dynamic content. A data bean normally provides a simple representation of a WebSphere Commerce entity bean. The data bean encapsulates properties that can be retrieved from or set within the entity bean. As such, the data bean simplifies the task of incorporating dynamic data into JSP pages. A data bean is activated in one of the following ways: by means of the wcbase:useBean tag (recommended) <%@ taglib uri="http://commerce.ibm.com/base" prefix="wcbase" %> <wcbase:useBean id="storeAttrValueBean" classname="com.stockmann.hobbyhall.data.store.beans.StoreAttributeValueDataBean" > <c:set value="${parameterValueId}" target="${storeAttrValueBean}" property="storeAttrValId" /> </wcbase:useBean> by means of the following call: com.ibm.commerce.beans.DataBeanManager.activate(data_bean, request, response) where data_

Difference between V6 and V7

Order trash can feature disabled by default In WebSphere Commerce Version 7, the order trash can feature is disabled by default. In WebSphere Commerce Version 6, the default owner for deleted orders was -1002. In Version 7, the default owner for deleted orders is now -1006 (a guest user). Changed functionality Changed functionality typically involves changes in default values or an outcome different from what would have occurred in previous releases. For example, a default parameter might use one value in   WebSphere Commerce   Version 6 and a different value in   WebSphere Commerce   Version 7. Madisons starter store replaces the consumer direct sample store The Madisons starter store is the new store that replaces the consumer direct sample store in the previous release. The Madisons starter store uses Rich Internet Application (RIA) technologies such as Asynchronous JavaScript and XML (AJAX) and Dojo widgets to provide customers with an interactive and rich shopping exp

Endeca: A Simple developer OverView

Image
 Endeca overview UrlENEQuery   : This class is to parse MDEX Engine pecific parameter from the browser request query string into engine query parameters. MDEX Engine  : This returns ENEQueryResults Object which contains the following information : Navigation, Record Search,Dimension Search and so on.It includes all the information required to build entire page. The three core classes of Endeca API ; HttpENEConnection  - enable connection with MDEX Engine. ENEQuery  -  class build the query to be sent to the MDEX Engine. ENEQueryResult  -  class contain the result of MDEX Engine Query. UrlEneQuery   is the subclass of   ENEQuery Creating a new application in Endeca with you own data Following steps describe the details about creating a new application with a new data (other than sample wine data) and deploying to Endeca. It also gives information about the tutorial which need to be followed to help you understand the basic learning process

AJAX sample implementation for WebSphere Commerce

Assuming the following design requirements: The AJAX handler will be /AjaxPPTGiftCardsBalanceEnquiry The command to serve the AJAX request will be com.ibm.commerce.payment.commands.ajax.DoPPTGiftCardsBalanceEnquiryCmd The equivalent implementation class will be com.ibm.commerce.payment.commands.ajax.DoPPTGiftCardsBalanceEnquiryCmImpl The store id is 10003 The AJAX request is required during checkout process and will be added to “OrderSummaryDisplay.jspf” The AJAX call is used to verify GiftCard numbers along with their pin High level implementation is shown in code snippets below with place holders on where to add your implementation Follow the steps below to add an AJAX call to your site: Add the following lines of code to OrderSummaryDisplay.jspf It is important not to forget the call to e.preventDefault() or you will end up refreshing the whole page. < form name = "giftcardform" method = "post"