Posts

Showing posts from 2014

Service Oriented Integration (SOI) - Websphere Commerce Web Services

Image
Service Oriented Integration (SOI) - Websphere Commerce Web Services As part of the WebSphere Commerce transition to SOA, there is an effort to decouple components to allow re-use of WebSphere Commerce business services in other environments besides the WebSphere Commerce application. In order to support this decoupling, the core infrastructure is the first piece that needs to run independently so it can be leveraged in other environments as well. The request handling has changed to create a lightweight runtime environment that new and existing components can use. This lightweight runtime focuses on the processing of business object documents (BODs). This new architecture paves the road to SOA adoption by standardizing on how clients will talk with SOA components. WebSphere Commerce now provides 4 SOI service modules -- logical groupings of business objects that have been grouped to standardize communication. These service modules are: Member Order Catalog Contract The

BOD and SOI

BOD   BOD uses pattern matching and DSL to the enter the database SOI  SOI uses controller commands\data beans \access beans. Two ways to customize SOI :  1. One way is to take advantage of the UserData hooks within the existing types to pass unstructured      information. 2. The other way is to use the Overlay methodology. The limitation of this method is UserData provides the ability to pass name-value pairs only. Overlays , a part of the OAGIS model, extend complex types similar to the inheritance model in Java. Within the Overlay model, you extend your complex type defined within the noun and generate Java code to represent that complex type. More specifically, where you referenced the default WebSphere Commerce version of the complex type, you reference your new version of the complex type and substitute it in. Within the client server framework, when the complex type is sent from the client to the server the business logic retrieves your version of the extended

Pass an extra parameter to store Custom data while add to cart by using UserData Noun extenstion (SOI based Service)

Image
Pass an extra parameter to store Custom data while add to cart  by using UserData Noun extenstion (SOI based Service) Step1: Register your new Client API Open struts-config-ext.xml. Copy the following text into the bottom of the file, before the </struts-config> tag: <plug-in className="com.ibm.commerce.struts.ComponentPlugIn"> <set-property property="componentId" value="order"/> <set-property property="clientFacadeClassName" value="com.mycompany.commerce.customization.order.ExtendedOrderFacadeClient"/> </plug-in> step 2:  Write the new client class which extends  OrderFacadeClient.Modified to send the value of field1 as part of the BOD request using userdata using field1  column public class ExtendedOrderFacadeClient extends OrderFacadeClient {      protected com.ibm.commerce.order.facade.datatypes.OrderType buildOrder(Map parameters,      String actionName)  throws Or

Debugging access control policy

Image
Complete flow http://www.ibm.com/developerworks/websphere/library/techarticles/0805_callaghan/0805_callaghan.html For a new view  Policy xml <Action Name="MyNewView"  CommandName="MyNewView">  </Action>  <ActionGroup Name="AllSiteUsersViews" OwnerID="RootOrganization">  <ActionGroupAction Name="MyNewView"/> </ActionGroup> By Query, you can check :  select ACACTION_ID from ACACTION where ACTION = 'MyNewView' select acactgrp_id from acactactgp where acaction_id in (select ACACTION_ID from ACACTION  where ACTION = 'MyNewView') select distinct acpolicy_id from acpolicy where acactgrp_id in (select acactgrp_id  from acactactgp where acaction_id  in (select ACACTION_ID from ACACTION where ACTION = 'MyNewView')) For Commands Policy File <ResourceCategory Name="com.yourcompany.MyOrderItemAddCmdCategory" 

Retrieve WebSphere Commerce Merchant Key

<%@ page import="com.ibm.commerce.util.nc_crypt" %>   <p>Encrypted Merchant Key: <%=com.ibm.commerce.server.WcsApp.configProperties.getValue("Instance/MerchantKey")%></p>   <p>Decrypted (Plain Text) Merchant Key: <%=nc_crypt.decrypt(com.ibm.commerce.server.WcsApp.configProperties.getValue("Instance/MerchantKey"), null)%></p>

IBM WCS Billing and Shiiping Address

IBM WCS Billing and Shiiping Address Billing  AddressId Till WCS 6.0 ORDERS table ADDRESS_ID column is used for storing Billing Address ID. From WCS 7.0  ADDRESS_ID is deprectaed from ORDERS table and the billing address is now "enctypted" and stored in PPCEXTDATA Table. In the PPCEXTDATA table billing data are stored in this manner: ATTRIBUTENAME: billto_firstname. DATAVALUE: ADfKQQr6evqFRf123XJlZw== (encrypted data). Shipping AddressId Shipping Addressid is fetched from ORDERITEMS table (ADDRESS_ID column). In WCS it is possible to ship different items to different shipping address. Retrieving Billing AddressId \Shipping Address ID OrderDataBean orderDataBean  = new OrderDataBean(); orderDataBean.setCommandContext(getCommandContext()); orderDataBean.setOrderId(OrderId.toString()); orderDataBean.populate(); String addressId = ""; EDPPaymentInstruction pi = odb.getPaymentInstructions()[0].getPaymentInstruction(); if (pi.getProtocolData().containsKey("b

WebSphere Commerce application layers

Image
WebSphere Commerce application layers Now that you have seen how the various software components related to WebSphere Commerce fit together, it is important to understand the application architecture. This will help you to understand which parts are foundation layers and which parts you can modify. The following diagram shows the various layers that compose the application architecture: Business models In WebSphere Commerce, a business model represents a sample business situation in which the WebSphere Commerce product may be used. A business model describes a scenario in which various parties use WebSphere Commerce to achieve their needs. The five business models provided by WebSphere Commerce are: B2B direct Consumer direct Demand chain Hosting Supply chain Within each business model, WebSphere Commerce provides one or more samples, referred to as starter stores, which may be used as a starting point to develop online sites. You can create other business models t

Types of SUBSYSTEMS IN WCS.

Types of SUBSYSTEMS IN WCS. Types of SUBSYSTEMS IN WCS. Catalog Subsystem. Order Subsystem. Trading Subsystem. Merchandising Subsystem. Marketing Subsystem. Member Subsystem. Payment Subsystem.

Data Bean, Access Bean and Entity Bean

Data Bean A data bean is a java bean that is used within a jsp page to provide dynamic contect to the jsp page. A data bean normally provides a simple representaion of a WebSphere Commerce Entity bean. There are 3 types of data beans:  1.Smart databean.  2.Command databean  3. Input data bean Smart data bean: When a smart data bean is activated, the data bean manager invokes the data bean's populate method. Using the populate method, the data bean can retrieve all attributes, except attributes from associated objects. Command data bean: A data bean implementing the CommandDataBean interface retrieves data from a data bean command. A data bean of this type is a lightweight object; it relies on a data bean command to populate its data. The data bean must implement the getCommandInterfaceName() method which returns the interface name of the data bean command. Input data bean: A data bean implementing the InputDataBean interface retrieves data from the URL parameters or attri

Imp Commands and Beans

Important Commands & DataBeans present in Catalog Subsystem Commands-- StoreCatalogDisplayCmdImpl- This command sets the view task that will display the Catalogs available to browse in the current Store. TopCategoriesDisplayImpl- This command sets the view task that will display the root Categories in a specified Catalog. CategoryDisplayCmdImpl- retrieves the configured display page for the specified category in the specified catalog. ErrorMissingAttributeCmd- This error task command is set when a Product to Item resolution fails due to missing product attributes. ErrorProductAttributeCmd- This error task command is set when a Product to Item resolution fails due to incorrect product attributes ProductDisplayCmdImpl- This command retrieves the configured Display Page for the specified CatalogEntry which will in turn be launched in order to display information about the CatalogEntry.This command first ensures that the CatalogEntry specified by

Order Subsystem

ORDER SUBSYSTEM Order Sub-system is a component of WCS that provides shopping carts, order capture, order fulfillment, inventory & payment function support. An order includes one or more products, billing & shipping addresses, payment details & the total cost including shipping charges   & taxes. From a customer persective an order is a list of selected products. Each product in a list is called an order item. From a store perspective an order is a list of order items. Orders are associated with a single store. An order profile is a special type of order that can be associated with either a store or a store group. The order profile holds default information about a customer such as payment information, shipping address, shipping mode & billing address. Ø   There are 4 inventory systems, they are: 1.   ATP inventory. 2.   Non-ATP inventory. 3.   No inventory. 4.   External inventory. ATP Inventory:  The ATP inventory model enables