Thursday, October 24, 2013

WCS (Websphere Commerce Suite) Basics or Interview questions

1)    What are the subsystems you deal in your project?
Ø  Marketing Subsystem - The Marketing subsystem provides numerous marketing concepts to your site, designed to increase brand awareness, and to attract and retain customers. Components of the marketing subsystem provide functionality to create marketing campaigns, including customer segments and advertising; and e-mail activities.
Ø  Catalog Subsystem- The catalog subsystem provides online catalog navigation, partitioning, categorization, and associations. In addition, the catalog subsystem includes support for personalized interest lists and custom catalog display pages. The catalog subsystem contains all logic and data relevant to an online catalog, including catalog groups (or categories), catalog entries, and any associations or relationships among them.
Ø  Member Subsystem- A member can be a user, a group of users (also known as a member group), or an organizational entity (which can be an organization, such as "IBM" or an organizational unit within an organization, such as "Electronic Commerce Division"). Business logic in the Member subsystem provides member registration and profile management services. Other services which are closely related to the Member subsystem include access control, authentication, and session management.
·         Registration information: Registration data for users and organizational entities can be configured to be stored in the WebSphere Commerce database or the directory server. Member group’s data can be stored only in the WebSphere Commerce database. For authentication purposes, a registered user has a unique identifier and a password. If the WebSphere Commerce database is used as registry, the unique identifier is the logon ID. If the directory server is used, the unique identifier can be a distinguished name or a relative distinguished name.
·         Profile management: A Site Administrator manages user and organizational entity profiles and data, including the organizations or organizational units, roles, users, and member groups within a site. In addition, a Buyer Administrator and Seller Administrator can manage users and organizational entities.
·         Access control and authorization: Access control determines what tasks users can perform on specific resources. An access group is a group of members defined specifically for access control purposes. A Site Administrator creates, maintains, and deletes access groups for a site. A Buyer Administrator or a Seller Administrator can also manage access groups for access control policies. Access groups usually group users based on their roles, organizations, and registration status.
·         Security, authentication, and session management: A user can be authenticated against a WebSphere Commerce database or a directory server. WebSphere Commerce supports two challenge types: logon ID and password, and X.509 client certificate. When logon ID and password is used, a user is authenticated against the WebSphere Commerce database or a directory server. When X.509 client certificate is used, the Web server performs the authentication. WebSphere Commerce supports two types of session management: cookie-based and URL rewriting.
·     Trading Subsystem- The trading subsystem in WebSphere Commerce provides the logic, function and data relevant for negotiating the price and quantity of a product or set of products between the buyer and seller organization. The trading subsystem includes auctions, contracts, and Request for Quote (RFQ) components that are used to carry out specific transactions between organizations.
·     Order Management Subsystem- The Order Management subsystem provides shopping carts, order capture, order fulfillment, inventory, and payment function support.
Order management is broadly divided into:
Ø     Order capture: Order capture provides functionality such as sales quotes and shopping carts and order submission. There are a number of ways to create shop carts and submit orders, as described in the order mechanisms section.
Ø     Order processing: Order processing is responsible for the overall coordination of inventory allocation, payment processing, releasing the order to fulfillment and tracking order status.
Ø     Inventory processing: WebSphere Commerce supports two inventory systems: Available to promise (ATP) and non-ATP. The interface to inventory is encapsulated by a single inventory task command, which in turn invokes either ATP or non-ATP task commands.
Ø     Payment processing: WebSphere Commerce Payments supports the use of payment plug-ins for offline or online payment processing.

2) Explain Order Management subsystem flow?                                                                                                                         
The Order Management subsystem includes all logic and data relevant to placing, processing, and managing orders. The Order Management subsystem also deals with returns.                                                               
Ø     OrderCreate: The order will be created even though there is no orderitems in the cart.
Ø     OrderItemAdd: When the customer selects the item and click on the add to the cart, then the OrderItemAddCmd will be called. The order state will be pending (P).
Ø     OrderItemUpdate: This command will be called when the quantity of the item is updated in the shopping cart page. The order state will bepending (P).
Ø     OrderCalculate: This command will be called when the customer adds the orderitems in the cart. The order state will be pending (P).
Ø     OrderItemMove: This command merges the current pending order to the previous order when the customer places the order by signing on to the store.
Ø     OrderPrepare: It basically calculates determines the discount, prices, shipping charges and taxes for the order.
Ø     OrderProfileUpdate: This command will be called to update the billing and shipping address and ship mode of the customer.
Ø     OrderProcess: Submits the order.
Here, the order can be blocked for several reasons.
·     This may be due to manual verification of the customer.
·     The order payment has not been captured completely. If the full payment has been captured then the state of the order is complete (C)i.e. payment authorization is complete. When the partial payment has been captured the order state will be (M) i.e. part of the amount has been approved.
Ø     OrderScheduled: The order is released, if the order is unblocked and fulfills all the requirements. This cmd is invoked by the scheduler. The order state will be released (R). When the order will be released, message will be sent to the LSP for shipment. Once the order gets shipped, the state of the order will be shipped (s) and after that shipment confirmation mail will be sent to the ecommerce. After this the state of the order will be deposited (D).
Ø     OrderCancel: The order can be cancelled through Customer Sales Representatives, before the order is released to Fulfillment. OrderCancel can cancel orders with an order status of P, X, W, E, A, B, C, M and OrderItem not in R, S, F, and G. Here the order state will be cancelled (X).
Ø     OrderEdit: This will be called, when the CSR is working with the order. The editor id will be assigned to the order. The order state will be CSR Edit (E). The order can be edit before the releasing the order.

3) Can you explain about Access Control Policies?
A) Access control policies is the utility provided by WebSphere Commerce, to allow access to the authorized group of user to a perform set of actions on the resources present in the application. There are four main concepts in the ACP.
·         Access: Allowing access to group of authorized users to which policy applies
·         Actions: Actions performed by user on the resources.
·         Resources:  Resources may include business objects (i.e. set of commands, etc)
·         Relationship: Each user can have relationship associated with it. (For e.g. a policy can apply the creator of an order can modify it and it is between the order and the user.)
The basic XML elements of the access control policy files are
·         <Action>: The new action will be loaded on ACACTION table.
·         <ActionGroup>: It is a group of related action and the action groups are stored in ACACTGRP table. Actions are associated with action groups in ACACTGRP table.
·         <Attribute>: Attribute is defined in ACATTR table.
·         <ResourceCategory>:  Resource Category is defined in ACRESCGRY table.
·         <ResourceGroup>: It is a set of resources and defined in ACRESGRP table.
·         <Relation>: Each resource can have set of relationship associated with it and it is stored in ACRELATION table.
·         <RelationGroup>: Relation group are defined in ACRELGRP.
·         <Policy>: Policies are defined in ACPOLICY.
·         <PolicyGroup>: Policy group are defined in ACPOLGRP.
Syntax:
acpload database_name db_username db_pwd  WC_Installdir/xml/policies/acp_file_name.xml

4) What is acugload?
A) The acugload is the utility to load the user access group in the appropriate database. This utility will load the <UserGroup> element in theMBRGRPUSG table.
A member group of type Access Group (-2) is for access control purposes, while a member group of type User Group (-1) is for general use.

5) What is acpnlsload?
A) The acpnlsload utility loads the XML files containing the display names and descriptions, into the appropriate databases. To insert or update display names and descriptions for the various policy related elements run the acpnlsload script.
 This script loads the following elements:
<Action_nls>, <Attribute_nls>, <ActionGroup_nls>, <ResourceCategory_nls>, <ResourceGroup_nls>, <Relation_nls>, <Policy_nls>, <PolicyGroup_nls>

6) What is acpextract?
A) The acpextract utility extracts the access control policy and access group information in the database and generates files that capture the information in XML format. It uses an input filter XML file to specify the data to extract from the database.

7) Suppose one user login into our site. He selected some of items and he has given the order. After two months, how can you check the status of the Order?
A) The status of the order can be checked from ORDERS table.
                Select STATUS from ORDERS where ORDERS_ID=XXXXXXX;

8) I want to collect user email id’s whose email id ends with @and particular company name.com. Then how can you give SQL query to Database in WCS?
A) The email id of the user can be found from ADDRESS table.  The ADDRESS_ID is the foreign key in the ORDERS table.
So for the particular user, first take the order no and fetch the ADDRESS_ID from the ORDERS table.
Use that ADDRESS_ID to get the email id for the user. Here there can be multiple addresses like permanent address (P) and the temporary address (T) for the same user. So, fetch the address with the STATUS as P.

Select EMAIL1 from ADDRESS where STATUS=’P’ and ADDRESS_ID in (select ADDRESS_ID from ORDERS where ORDERS_ID = XXXXXXX);
If you want to search email ID directly, so run the below query.
Select * from ADDRESS where EMAIL1 like ‘%@abc.com’ OR ‘EMAIL2 like ‘%@abc.com
Where EMAIL1 stands for primary email address.
EMAIL2 stands for secondary email address.

9) I want to know the particular member _id. Then tell me the relation between MEMBER tables with ORDER table?
A) The MEMBER_ID is the primary in the MEMBER table and the foreign key in the ORDERS table.

10) What kind of tables did you use?
A) In the Order management Flow following tables are used.
     ORDERS, XORDERS, ORDERITEMS, XORDERITEMS, OICOMPLIST, XOICOMPLIST, RMA, XRMA,    RMAITEM, XRMAITEM, RMAITEMCMP, XRMAITEMCMP, ORDADJUST, ORDIADJUST, CATENTRY, CATENTREL
In Member Subsystem, following tables are used.
USERS, MEMBER, USERREG, USERSDEMO, USERPROF, ADDRESS, ADDRESSBOOK

11) What are JSP programming best practices?
A) Below are the JSP programming best practices:-
·                     Use JSTL in place of Java Code.
·                     Use commerce specific bean (<wcbase:useBean>) in place of standard bean (<jsp:useBean>) activation.
·                     Use commerce specific maps to access request parameters i.e. WCParam & WCParamValues.
·                     Use StoreErrorDataBean data bean for error handling. This can be used to display store specific error message in the jsp.
·                      Use appropriate includes mechanism.
ü  Static include: Includes the jsp file at the compile time.                                                                 <%@ include file=”filename.jspf” %>
ü  Dynamic include: Includes the jsp file at run time, while the request is getting processed.                                                                                                                                        <c:import url=”filename.jsp”> … </c:import>                                                               <jsp:include  page=”filename.jsp” flush=”true|false”/>          
·                     Use .jspf extension for the JSP segments. The parent jsp should be with .jsp extension and the included jsp should be with .jspf extension.
·                     Use escapeXml attribute to preserve the HTML formatting. By default the value of the escapeXml will be true. When this value is true then the html special characters will be converted to standard entity codes.
For e.g. <c:out value=”${list.productPrice}”/>
Here the value is true by default, if there is any special character in the price, it will display the entity code in the UI
<c:out value=”${list.productPrice}” escapeXml=”true”/>
Here the value is false, if there is any special character in the price, it will display the special characters it is in the UI.
·                     Use the POST method instead of GET.

12) What are different types of promotions?
A) There are three types of promotions.
·                     Order Promotions
Ø  Percentage off
Ø  Fixed amount Off
Ø  Free gift with purchase
·                     Product Promotions
Ø  Fixed amount off per item
Ø  Percentage off per item
Ø  Fixed amount off for all
Ø  Free gift with purchase
Ø  Buy X, get one or more items for discount
·                     Shipping Promotions
Ø  Free shipping
Ø  Discounted shipping for the order using a selected shipping mode.
Ø  Discounted shipping for all the item using a selected shipping mode.
Ø  Discounted shipping per item using a selected shipping mode.

13) What are different types of calculation usages used in WCS?
A)   WebSphere Commerce performs all calculations for one calculation usage at a time. The order of calculation usages is stored in the SEQUENCEcolumn of the STENCALUSG database table. The entries in this table are initially populated with information from the language-independent bootstrap file: wcs-bootstrap.xml.
Calculation usage
Calculation usage code
Discount
-1
Shipping
-2
Sales tax
-3
Shipping tax
-4
Coupon
-5
Surcharge
-6
Shipping Adjustment
-7

14) On what table promotion codes are stored?
A) The promotions that are created through accelerator are stored in PX_PROMOTION table.
PX_PROMOTION_ID is the primary key
STATUS:  0 means inactive, 1 means active, 2 means mark for deletion, 3 means suspended and 4      means Obsolete.
All the promotion related information that is created from accelerator is stored in PX_PROMOTION table.
PX_PROMOTION contains PX_PROMOTION_ID,
CALCODE and CLCDPROMO are the two tables that can be used to populate the promotion code.
CALCODE consists of CALCODE_ID, STOREENT_ID, CALUSAGE_ID, CODE, DESCRIPTION, START_DATE, END_DATE, and LAST_UPDATE.
CLCDPROMO consists of CALCODE_ID and PX_PROMOTION_ID. NAME, CODE, STOREENT_ID, START_DATE, END_DATE, XML_PARAM, STATUS and etc.
ORDADJUST contains information of the promotions that are applied to the order.
ORDADJDSC consists of ORDADJUST_ID, LANGUAGE_ID, and DESCRIPTION.
ORDIADJUST consists of ORDIADJUST_ID, ORDERITEMS_ID, ORDADJUST_ID and AMOUNT.
ORDPROMOCD consists of ORDERS_ID and CODE
PromotionCodeAddRemoveControllerCmdImpl and PromotionEngineOrderCalculateCmdImpl are used to add the promotion code to the order.

15) How do you call a task command from a controller command? And what is the syntax?
A) Task commands are invoked from controller commands to perform the set of business operations.
     SYNTAX:
                OrderCalculateCmd cmd = (OrderCalculateCmd) CommandFactory.createCommand (OrderCalculateCmd.class.getName(), getStoreId()))
cmd.setCommandContext (getCommandContext ());
cmd.setRequestProperties (requestProperties);
cmd.execute ();

16) What is controller commands used in Member Subsystem?
A) UserRegistrationAddCmd for adding the user. This will insert the data of the user in USERS, USERREG, USERPROF, USERDEMO and ADDRESS table.
    UserRegistrationUpdateCmd for updating the user profile.
    LogOffCmd for logging out user session.
Customized Controller Commands in GOSP are GOSPNCIMHandShakeCmd used for authenticating the user, by hand shaking with NCIM. This command will search for user authentication token, if the authentication token is available, then the user will be allowed to sign on.
GOSPNCIMUserRegistrationFormCmd used for creating the registration form for the user.

17) For creating a Controller Command, we register Controller Command into CMDREG table? Is it necessary to register in that table? What is the main purpose to register in CMDREG table?
A) It is not necessary to enter data in the CMDREG table, but an entry should be made in the struts-config.xml.
The controller command can be registered in the CMDREG table by xml and SQL query.
To register a new controller command, or a new task command, in the CMDREG table, create an entry in the XML file for each new or customized controller or task commands, using the following example of a task command as your guide:
<cmdreg storeent_id="@storeent_id_1" interfacename= " com.ibm.commerce.payment.commands. DoPaymentCmd " classname = "com.ibm.commerce.payment.commands .DoPaymentMPFCmdImpl"/>

To register by SQL query
insert into CMDREG (storeent_id, interfacename, description, classname) values  (0,' com.ibm.commerce.payment.commands. DoPaymentCmd ', 'Payment  commands for all shops', ' com.ibm.commerce.payment.commands .DoPaymentMPFCmdImpl ').
If there is no entry for the command in the CMDREG table, then controller will check defaultCommandClassName in the interface.
public interface GOSPShipmentNotificationServiceCmd extends ControllerCommand {
                public static final String NAME = GOSPShipmentNotificationServiceCmd.class.getName();
               public static final String defaultCommandClassName = GOSPShipmentNotificationServiceCmdImpl .class.getName();
}


18) Can you list out some of the Controller Commands for giving the promotions to products, which you have been used? And explain the scenario?
A) Our custom command GOSPPromotionCodeAddRemoveCmdImpl inherits the out of box command PromotionCodeAddRemoveControllerCmdImpl to apply promotion in the shopping cart page.
Promotion codes are managed by the PromotionCodeManager component of the PromotionEngine. This is a configurable component. The default promotion code manager, WCSPromotionCodeManager, simply records promotion codes entered for an order in the ORDPROMOCD table. All promotion code managers must implement the com.ibm.commerce.marketing.promotion.code.PromotionCodeManager interface.

19) Can you list out the tag libraries in WCS?
A)    Core tags, sql tags, xml tags and fmt tags.

20) What is Dyna caching?
A) Caching improves response time and reduces system load to improve the performance of world-wide web applications.
The Dyna caching service includes:-
ü  Servlet or JSP result cache, caching the fragments of JSP or whole page.
ü  Command cache to cache business objects.
ü  Edge Side Include (ESI) caching to cache, assemble and deliver the dynamic web pages at the edge of enterprise network.
ü  Invalidation support to ensure that the content of cache is correct. Invalidation can be rule-based, time-based, group-based and programmatic.
ü  Replication support, to enable cache sharing and replication on multiple servers.
ü  Disk offload capability, to enable and storing large amount of data, preserve the content in the application server until it is restarted or stopped.
The caching specific behaviour of the WCS is specified in the cachespec.xml present in the Stores.war.
Dyna caching service, places the objects in the cache which is identified by unique cache-id’s (<cache-id> rules) defined in the <cache-entry> elements.
Once the objects with particular cache-id are in the cache, then the subsequent request for the same cache-id is served from the cache.
Cached objects are removed from the cache according to the information provided in the <cache-entry> elements such as <time-out>, <invalidation> and<priority> elements.
When the available cache memory is full, LRU algorithm removes the cached objects with the lower priority.
The <dependency-id> and <invalidation> elements defines the rule to generate dependency-id’s and the invalidation-id’s, which together specifies certain objects should be removed from the cache after the request is processed.
The <inactivity> element is used to specify a time to live (TTL) value for the cache entry based on the last time that the cache entry was accessed.
Caching strategy
When determining a caching strategy for WebSphere Commerce, the key issues that need to be resolved are:
Ø  Which pages should be cached
Ø  Where caching should take place
Ø  Cache full pages or page fragments
Ø  How to invalidate the cached data.
When determining which Web pages should be cached, good candidates for caching are pages that:
Ø  Are accessed frequently
Ø  Are stable for a period of time
Ø  Contain a majority of contents that can be reused by a variety of users

The following <cache-entry> example uses a <cache-id> element to cache results created by a JSP and generate a cache ID with two components, "storeId" and "catalogId", obtained from parameters in the request object:
<cache-entry>
 <class>servlet</class>
 <name>/ToolTech/. . ./StoreCatalogDisplay.jsp</name>
 <property name="save-attributes">false</property>
 <property name="store-cookies">false</property>
 <timeout>3600</timeout>
 <priority>3</priority>
 <cache-id>
  <component id="storeId" type="parameter">
   <required>true</required>
  </component>
  <component id="catalogId" type="parameter">
   <required>true</required>
  </component>
 </cache-id>
...
</cache-entry>

21) What is the difference between WCParam and param implicit objects?
A) WCParam is a Websphere Commerce specific implicit object. This allows to access and decrypt the the HTTP request.
Param is a standard JSP implicit object, but it does not guarantee to decrypt the HTTP request.
When you don’t want to encrypt the request parameters, then following configuration needs to be done.
<NonEncryptedParameters display="false">
 <Parameter name="storeId" />
 <Parameter name="langId" />
 <Parameter name="catalogId" />
 <Parameter name="categoryId" />
 <Parameter name="productId" />
</NonEncryptedParameters>

22) What are the different ways of Cache Invalidation?
A)
Ø  Invalidating the cache using timeout: This can be done by adding <timeout>10</timeout> in side of <cache-id> element. The timeout value will be in seconds. If the default value is 0, then the cache will not expire.
Ø  Using Command invalidation: Command based invalidation means invalidation rules are executed upon the execution of the command that extends CachableCommandImpl WebSphere Command framework.
The invalidation id’s are constructed based on the fields and methods provided by command.
Ø  Invalidating cache using dyna cache API and CACHEIVL table: WebSphere provides DynaCacheInvalidation command which is called by scheduler to process the record in CACHEIVL table.
Ø  Invalidating cache using dependency trees: Using dependency id’s the cache can be invalidated.
For e.g.
<dependency-id>KitchenWare
   <component id="" ignore-value="true" type="pathinfo">
      <required>true</required>
      <value>/CategoryDisplay</value>
   </component>
   <component id="parent_category_rn" ignore-value="true"  type="parameter">
   <required>true</required>
     <value>10003</value>
  </component>
</dependency-id>

23) How to use the dyna cache API not to cache the page?
A)               
Ø  Not caching the whole page:
<%@ page import = "com.ibm.commerce.webcontroller. HttpControllerRequestObject" %>
<%@ page import="javax.servlet.http.HttpServletRequest" %>
<%@ page import="com.ibm.commerce.server.JSPHelper" %>
<%@ page import="com.ibm.commerce.command.CommandContext" %>

<%
         CommandContext commandContext = (CommandContext)request. getAttribute("CommandContext");

         HttpControllerRequestObject controllerReq = (HttpControllerRequestObject)commandContext.getRequest();

                 HttpServletRequest req = controllerReq.getHttpRequest();

                 JSPHelper.setUncacheable(req,true);

%>

Ø  Not caching the fragment of page:
     <%@ page import="com.ibm.websphere.servlet.cache.*" %>
            <%                      
              ((ServletCacheResponse)response).setDoNotConsume(true);
            %>

24) What is CommandContext ?
A)  CommandContext is the interface in WebSphere Commerce, which contains session and user information and set in the Controller command before the execute method is called.
25) What is use of fmt tag?
A) fmt tag is used to display the message in locale language.
     For e.g <fmt:message key="TERMSCONDITION122C" bundle="${termsConditionText}" /></a>
26) Why JSTLEnvironmentSetup.jspf is included in jsp ?
A) This file retrieves and prepares the JSP page path, file path and resource bundle path which are used by other JSP’s. The EnvironmentSetup.jsp includes most commonly used attributes such as storeDir, jspDir, includeDir, bundleDir, etc.
27) How can you do Internationalization in WCS using fmt tag library? Tell me total flow of execution? What are the files to modify for that purpose?
A) To do Internationlization in WCS, following steps needs to be followed.
Ø  Include JSTLEnvironmentSetup.jspf in the jsp. This is required to get the path of the properties files from the environment. The properties files are fetched based on the language id.
Ø  Declare the variable name of the bundle in the jsp using the below code.                              <fmt:setLocale    value="${CommandContext.locale}" />                                                    <fmt:setBundle basename="${sdb.jspStoreDir}/GOSPNokiaTermsandCondition_NLS" var="termsConditionText" />
Ø  Get the key from the bundle and display in the jsp.                                                             <fmt:message key="TERMSCONDITION1"  bundle="${termsConditionText}" />
28) How can you take shipping address and billing address from customer? Explain?
A) The shipping and billing address of the customer are stored in the ADDRESS table. There will be two ADDRESS_ID one is for shipping and other is for billing addresses. The ADDRBOOK_ID is the foreign key in the ADDRESS table. The ADDRESSTYPE will be S for shipping , B for billing and SB for both shipping and billing.
The ORDERS table only contains the ADDRESS_ID of the billing address.

29) Do you know about .sar files? What’s the use of it?
A) Store archive file (.sar) is the zip file that contains all necessary assets to create a store or site.

30) What are the business models in WCS?
A) Business model provides sample commerce solution which includes organization structure, default roles and access control policies, one or more starter stores, administrator tools and business processes that demonstrate best practices.
Ø  Consumer Direct: A store that support commerce transactions involving products, services or information directly between businesses and consumers.
Ø  B2B Direct: A store that supports commerce transactions between two business parties.             
·         Hub: A site that enables its customers and partners to access products and services available from business partners or clients of the hub owner.
·         Extended Site: A site that allow the selling organization to provide unique storefronts for different enterprise customers.

30) What is the difference between DataBean and AccessBean?
A) DataBean class implements SmartDataBean uses lazy fetch method. Uses appropriate AccessBean for database access. It is used in JSP.
AccessBean are light-weight simple Java Bean and it is called in the Command, to fetch all the data at once. AccessBean extends AbstractEntityAccessBean.
InputDataBean retrieves data from the URL or view command attributes.

31) What are the types of Data Bean?
A) Data Bean is Java Bean that is used in JSP to populate dynamic data.
There are three types of Data Bean,
Ø  Smart Data Bean: Smart Data Bean uses lazy fetch method to retrieve data. This type of data bean provides better performance in the situations where not all data from data beans are required. Smart Data bean that requires access to the database should extend access bean from the corresponding entity bean and implement com.ibm.commerce.SmartDataBean interface.
Ø  Command Data Bean: Command data bean relies on the command and it is more light weight. The command data bean fetches all the data at once, regardless of whether the JSP requires them or not. Command Data Bean extends corresponding Access Bean and implements com.ibm.commerce.CommandDataBean. interface
Ø  Input Data Bean: The Data Bean implementing com.ibm.commerce.InputDataBean interface retrieves data from the URL parameters or attributes set by the View.
When a JSP page is invoked, the generated servlet populates all the attributes that matched in the URL parameters and activates the data bean by passing it to the data bean manager. Then the data bean manager invokes the data bean’s setRequestProperties () method to pass all the attributes set by the view.
The following code is required to activate the data bean.
com.ibm.commerce.beans.DataBeanManager.activate (data_bean, request, response).

32) How do we use Data Bean in the JSP?
A) The below code is used to get access to data bean from JSP.
<wcbase:useBean id=”orderDB” classname=”com.gosp.order.beans.GOSPOrderDataBean” scope=”request”>
<c:set value=”${orderId}”  target=”${ orderDB }” property=”orderId”/>
</wcbase:useBean>

33) Explain about blocking an order.
A) The order will be blocked by calling task command NotifyBlockCmd or the controller command BlockNotifyCmd. When the order is blocked, the value of BLOCKED column in the ORDERS table will be 1 (means the order is blocked).
The record for the blocked orders exists in ORDERBLK table. This table contains the ORDERBLK_ID, ORDERS_ID, BLKRSNCODE_ID, RESOLVED (value 0indicates not resolved and 1 indicates resolved).
The BLKRSNCODE and BLKRSNDESC table contains the reason for blocking the order.
The STORBLKRSN table contains the block reason that is available for the store. Here the RESPECTED column is used to make active the reason code (0 means off and 1 means on).

34) Explain Controller command programming model?
A) The new controller command should extend com.ibm.commerce.command .ControllerCmdImpl or implements abstract class or interface. While writing new controller command you must implements following methods from abstract class.
Ø  isGeneric (): In WCS, there are three types of users, registered users, guest users and generic users. The generic users have common id, and that common id is used to browse to the site.
The isGeneric () methods returns true, if the user is generic and returns for registered users.
Ø  isRetriable (): This method returns true, if the command is tried even after the transaction rollback exception or not.
For e.g. the command should be retried even after the transaction rollback exception occurred during the OrderProcess. This command invokes third party payment system for authorization process. It cannot be retried, since authorization cannot be reversed. An example of command that can be retried is ProductDisplay command.
Ø  setRequestProperties (com.ibm.commerce.datatype.TypedProperty reqParams) :
This method is invoked by the web controller to pass all the input properties to the controller command. The controller command must parse the input properties and set each individual property explicitly in this method.
Ø  validateParameters (): This method is used to validate all the request parameters before processing.
Ø  getResources (): This method is used to implement resource level access control. If the resource level action is performed, then it returns vector which contains resource-action pair and if no action is performed then it returns nothing.
Ø  performExecute ():  this method is called to perform business logic. Before calling this method, the controller command should invoke the super class performExecute () methods.
35) What is master catalog?
A) Master Catalog is a centralized location to manage stores. Everything that is required for the store is present in master catalog. It is a single catalog that contains products, items, relationships and prices that is required for sale in the store.

36) What is a fulfillment center? Can a store have a multiple fulfillment centers?
A) Fulfillment centers are used by stores as warehouses for shipping and receiving centers. One store can have multiple fulfillment centers associated with it. Inventory count is maintained separately for each fulfillment centers. Fulfillment includes picking, packing and shipping. Picking is the selection of products from one or more releases from a fulfillment centers, packing is the putting the products in the shipping container and shipping is sending them to customers.
37) What is the role of helper classes in WCS?
A) Helper class is a utility class that can be used any where and anytime without prior coding and it reduces code redundancy.
For e.g. BaseJDBCHelper is a JDBC helper class which provides interaction with the database, such as establishing connection with the database, executing the query and closing the connection.

38) Which method is invoked in the data bean for calling an access bean?
A) In the populate () method we can write the code to call access bean.

39) What is Optimistic locking?
A) Optimistic locking allows you to lower the isolation level that you use in the application, so that fewer locks are placed against the database assets. It allows more application to run concurrently against the same database.

40) Explain something about scheduler?
A) A WebSphere Commerce scheduler is a background server that schedules and launches the jobs both at the site level and the store level.
The scheduler polls the SCHACTIVE table to find the jobs scheduled to run.
Following are the value of STATE in SCHACTIVE table
Ø  W:  the job is waiting for execution
Ø  I:  the job is currently inactive.
Ø  IF: the job has run and failed.
Ø  R: the job is currently running.
Ø  RF: the job is running because of previous attempt failed.
Ø  C: the job is finished running.
Ø  CF: the job failed to execute successfully.
The scheduler gets the job configuration information from SCHCONFIG table. The job can be run only on WebSphere Commerce server and its clones.
The scheduler logs the status of the job in SCHSTATUS table.
The scheduler can broadcast the jobs on its clones and logs the broadcast job entries in SCHBRDCST table.

41) Difference between Optimistic locking and pessimistic locking?
A) Optimistic locking improves the performance of application by reducing the isolation level of the database transactions. If two or more transaction is performing the update operation of the same row, the lock on the row will be acquired by one transaction and remaining transaction will be roll backed.
Pessimistic locking protects the integrity of the database by locking the database assets over the entire duration of the transaction. But this will affect performance of the application that is running multiple transactions at a time and becomes deadlock.

42) Explain about bundle and kits?
A) There are different types of bundle and kits
Ø  Prebuilt Kit: A prebuilt kit is a collection of catalog entries that cannot be sold separately. A prebuilt kit has own its price and cannot be changed once it is added to the shopping cart. Inventory of prebuilt kit is independent of its component parts.
Ø  Dynamic Kit: A dynamic kit is a group of product that is ordered as a unit. The components of kit cannot be modified in the order, but they are reconfigured by the configurator. The entire configuration must be fulfilled together.
Ø  Static Kit:  A static kit is a group of product that is ordered as a unit. The components of kit cannot be modified in the order. The individual components within the order cannot be modified and must be fulfilled together. A static kit will be backorder if any of its components is unavailable. A static kit has no inventory of its own. When the static kit is purchased, the inventory of its component part is lowered.
Ø  Bundle: A bundle is a collection of catalog entries which allows customer to buy multiple merchandise with one click. The bundle components can be sold separately.

43) Explain exception types in WCS?                                                                                                                     
A) A command can throw two types of exceptions
Ø  ECApplicationException:  This exception is thrown; if the error is related to user input and it always fail. When the user enters invalid parameter, this exception is always thrown. When this exception is thrown, the solution controller does not retry the command, even if the command is specified as retirable.
Ø  ECSystemException: This exception is thrown if a runtime exception or any WebSphere configuration error occurs. Examples of this exception are Remote Exception, Create Exception or other EJB exceptions. When this exception is thrown, the solution controller retries the command if the command is retirable and the exception was caused by either a database dead lock or database rollback.

44) What is the purpose of Bootstrap files?
A) Bootstrap files are XML files which WebSphere Commerce uses during instance creation to populate database tables with information after the schema has been created. Once the data has been loaded, you can see the preloaded information in the table. These files are used to retrieve information about the specific data, such as calculation codes and pricing policies.

45) What is Search Engine Optimization?
A) Search Engine Optimization is considered to be the one of the most important channel that can be reached to the customer.
Dynamic Database driven URL such as those generated by WebSphere Commerce contains stop characters like (?, %, &) that can be overwhelm by search engine crawlers. For this reason, search engine limit the URL’s that they index. To overcome this limitation, WebSphere Commerce provides the functionality to help improve the results of search engine indexing.
Crawler is software that is used by search engine to index the page that is available in the website for public.
In WebSphere Commerce, we need to create static URL for the database driven dynamic URL.
For e.g.
The dynamic URL that generates the request as shown below:-
/TopCategoryDisplay?storeId=10500&languageId=-1&categoryId=56723&catalogeId=21789
This dynamic URL contains the stopping characters and it will prevent the indexing by the search engine crawlers.
To avoid this, we need to create a static URL as below:-
/CategoryDisplay_10500_-1_56723_21789
The static URL for all the request can be created by making an entry in the SEOUrlMapper.xml
<mappings>
<pathInfo_mappings separator=”_”>
                <pathInfo_mapping name=”CategoryDisplay” requestName=” TopCategoryDisplay”>
                                <parameter name=”storied” />
                                <parameter name=”languageId” />
                                <parameter name=”categoryId” />
                                <parameter name=”catalogId” />
                </pathInfo_mapping>
</pathInfo_mappings>
</mappings>
When search engine analyze the page, it gives more weightage to the page title, page header and the page first sentence of the body.

46) Explain relationship between CATENTRY and CATENTREL?
A) The CATENTRY_ID is the foreign key in the ORDERITEMS table and OICOMPLIST table.
The CATENTRY_ID is the primary key in the CATENTRY table. The relationship of the parent and child CATENTRY_ID can be defined in CATENTREL table.
The CATENTRYTYPE_ID can be Product Bean, Item Bean, Package Bean, Bundle Bean, DynamicKitBean and CatalogEntryBean.
The CATENTDESC contains all the descriptive information for the CATENTRY_ID and the CATENTRY_ID is the primary key in the table.
The LISTPRICE contains the pricing information of the CATENTRY_ID.
The OFFER table contains the OFFER_ID of the CATENTRY_ID.
The OFFERPRICE table contains the offer price of the CATENTRY_ID and the OFFER_ID is the primary key.


47) Explain something about ATTRIBUTE?
A) The ATTRIBUTE table contains all the attribute information of the CATENTRY_ID. ATTRIBUTE_ID is the primary key. The single CATENTRY_ID can have more than one ATRRIBUTE_ID.
Examples of ATTRIBUTE are like color, Internet browser, FM Radio, Blue Tooth, Warranty, Video Recorder, Music player, etc.
ATTRIBUTE specifies all the features that are available for the CATENTRY_ID.
THE ATTRTYPE table contains attribute type information. ATTRTYPE_ID can be STRING, FLOAT, INTEGER, DATETIME, FREEFROM, BIGINT, and ATTACHMENT.
The ATTRVALUE table contains the STRINGVALUE and the FLOATVALUE description of the ATTRIBUTE_ID based on the store specific LANGUAGE_ID.

48) Explain something about EMSPOT?
A) All the Marketing spot that is created in the application will have record in the EMSPOT table.
EMSPOT table consists of EMSPOT_ID, STORE_ID, NAME, DESCRIPTION and USUAGETYPE
ESMAPOBJ table consists of mapping between ESMAPOBJ_ID and the OBJECT_ID.

49) Explain something about INVENTORY?
A) The INVENTORY contains information like CATENTRY_ID,  STORE_ID, FFMCENTER_ID, QUANTITY and INVENTORYFLAGS.
INVENTORYFLAGS values can be as below:-
1 = noUpdate. The default UpdateInventory task command does not update QUANTITY.
2 = noCheck. The default CheckInventory and UpdateInventory task commands do not check QUANTITY.

50) Explain something about ADDRESS and ADDRBOOK?
A) ADDRBOOK table contains the address owned by the member. ADDRESS_ID is the primary key.
ADDRESS table consists of Member own address, friend address and etc.  ADDRESS_ID is the primary key; ADDRESSTYPE can be Shipping S, Billing B or Shipping and Billing SB.

51) Explain SHIPMODE, SHIPINFO, SHPMODEDSC, SHPMODCLCD, SHPARRANGE, and SHPJCRRULE.
A) SHIPMODE – Each row of this table represents the shipmode for store entity.  
SHIPMODE_ID, STOREENT_ID, CODE, CARRIER and MARKFORDELETE (0 by default)
SHPARRANGE- Each row of this table represents a ShippingArrangement, indicating that a FulfillmentCenter can ship products on behalf of a Store using a ShippingMode.                      SHPARRANGE_ID, STORE_ID, FFMCENTER_ID, SHIPMODE_ID.

SHIPMODEDSC-Each row contains the language dependent description of the ship mode.

2 comments:

  1. Very nice article.. Thanks for the useful info

    ReplyDelete
  2. "Great blog created by you. I read your blog, its best and useful information. You have done a great work. Super blogging and keep it up.php jobs in hyderabad.
    "

    ReplyDelete