Thursday 28 February 2013

Develop new Task Command

In WCS - Command represents a java class.
Task Command represents a small piece of logic, i.e., it performs small tasks.

Below demonstration doesn't perform any logic, we just hardcode values and try to retrieve them from CommandControl class.

Steps to create a new Task Commnd:

1)OpenWebSphereCommerceServerExtensionsLogic->src->create package->com.myCompany.commands->finish
2)Create an Interface - Right click on package->New->Interface. give interface name as MyCatalogTaskCmd

3)Extend com.ibm.commerce.command.TaskCommand interface
4)Add a variable in the new Interface as below:
public static final String defaultCommandClassName = "com.myCompany.commands.MyCatalogTaskCmdImpl";
5)Save the interface code.
6)We need to write an implementation class for this interface, Right click on package->New->class->MyCatalogTaskCmdImpl.java
7)Make sure the above class extends com.ibm.commerce.command.TaskCommandImpl
8)And implements MyCatalogTaskCmd interface
9)Add few variables in the class :
    private String customerName;
    private String address;
    private String catalogId;
10)Right click the code and select Source->Generte Getters and Setters
11)Copy the all getter and setter methods from class and past it in Interface, remove implementation brackets and clear errors if any.
12)We need to add a sample values or the above setters in performExecute() method.
By default performExecute() doesn't show up, to make that appear follow below steps:
       a)right Click and select Source->Override/Implement Methods
       b)select performExecute() from the list and click OK.























13)Add the following code in performExecute() method:
    @Override
    public void performExecute() throws ECException {
        super.performExecute();
        setCustomerName("Ravi Garlapati");
        setAddress("India");
        setCatalogId("WCS 2013");
    }

14)This ends the task command code.

Wednesday 27 February 2013

Update Store Pages to include Price List(Cont...)


(1-5 steps Continue....)


6) That brings up all the products price list page as below, we will add the price list for AC-01 product:
















Below is the price list page for the product AC-01





















7) To add price list for this product we need to enter AC-01 in the text field and click on "Find and Add" button, that adds the blank price list as shown below:




















8) Enter Maximum Quantity and USD(price) values :

















9) Save and Close the page, to see the output of these changes go the product AC-01 price list page:


Update Store Pages to include Price List

We will see the use of Management Center to update the Price List of a particular product, then we can verify the same on Product Display page.

1) Login to Management Center and select Catalog Filter and Pricing option as shown below:

















2)On select of Catalog Filter and Pricing below screen is shown:












3)Select store as Life Style













4)Select Price List option from below screen:


















5) Right click on the first option and Open





















(Continue....6 to 9 steps)






Create a new JSP for WCS use



This is to demonstrate the steps involved to introduce a new JSP in WCS

1)Create a new JSP at \workspace\Stores\WebContent\ConsumerDirect\MyNewPage.jsp  folder






















The output of this page is just a simple text : This is my new page

jsp code:

<?xmlversion="1.0" encoding="UTF-8"?>
<!DOCTYPEhtml PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%@page
      language="java"contentType="text/html; charset=UTF-8"
      pageEncoding="UTF-8"%>
<htmlxmlns="http://www.w3.org/1999/xhtml">

<%@page isELIgnored="true"%>

<%@taglib uri="http://java.sun.com/jstl/fmt"prefix="fmt"%>
<%@taglib uri="http://java.sun.com/jstl/core"prefix="c"%>
<%@taglib uri="http://commerce.ibm.com/base"prefix="wcbase"%>
<%@taglib uri="flow.tld"prefix="flow" %>

<%@include file="include/JSTLEnvironmentSetup.jspf"%>

<head>
      <title>My New Page</title>
      <link rel="stylesheet"href='<c:out value="${jspStoreImgDir}${vfileStylesheet}"/>'
            type="text/css"/>

<metahttp-equiv="Content-Type" content="text/html; charset=UTF-8" />
<metaname="GENERATOR"
      content="Rational® Application Developer™for WebSphere® Software" />
</head>
<body>
<%@include file="include/LayoutContainerTop.jspf"%>

<p>This is my new page</p>

<%@include file="include/LayoutContainerBottom.jspf"%>
</body>
</html>

LayoutContainerTop.jspf 

 







LayoutContainerBottom.jspf



2) We need to provide access policies to this view, create an xml file as below at \xml\policies\xml folder, i have created as : MyNewPage.xml

and run the below command:
 acpload wcdev db2admin db2admin MyNewPage.xml db2admin

Actual syntax : acpload <database> <username> <password> <xml file name> <schema>

This command creates 2 more files as below xmltrans and idres:









Open idres file and go to end of the file, we should see as below:

<import>
                <acaction
                                ACACTION_ID="13401"
                                ACTION="MyNewPage"
                />
                <acactactgp
                                ACACTGRP_ID="10196"
                                ACACTION_ID="13401"
                />
</import>

This indicates policies are set properly.

3) Change struts-config-ext.xml file at \workspace\Stores\WebContent\WEB-INF\struts-config-ext.xml

<forward name="MyNewPage/10051" path="/MyNewPage.jsp" className="com.ibm.commerce.struts.ECActionForward">
</forward>
</global-forwards>

and

<action path="/MyNewPage" type="com.ibm.commerce.struts.BaseAction">
</action>
</action-mappings>

4) We need to restart the server to reflect the access policies and struts config changes.

If we just change struts config file, refresh the Registry in Admin console is sufficient - no need to restart the server - as shown below:







5)  To display this page we have already introduced a link in Home page of Consumer Direct in my previous topic: http://wcs-websphere-ecommerce.blogspot.in/2013/02/customize-storefront-pages-existing.html


On click of  "My New Page" we can see the output in new page.



Tuesday 26 February 2013

Customize Storefront Pages (Existing jsp)

Here we will see how to introduce a new link in an existing jsp page, for example, in the below image we will introduce a new link "My New Page"





Follow the below steps:

1)Open \workspace\Stores\WebContent\ConsumerDirect\include\styles\style1
             \CachedHeaderDisplay.jsp
2)Search for the string "End: GiftRegistryCode" and under that write the below code
3)Introduce the below code:
<td class="m_line">
          <img src="<c:out value="${jspStoreImgDir}${vfileColor}m_line.gif"/>" alt="" width="19"
                                                                                                            height="31" border="0"></td>
          <td class="m_top" height="31" id="WC_CachedHeaderDisplay_TableCell_41">
         <a href="<c:out value="${MyNewPageURL}"/>" class="m_top_link"   
                   id="WC_CachedHeaderDisplay_Link_2">
         <fmt:message key="MY_NEW_PAGE" bundle="${storeText}" /></a>&nbsp;&nbsp;&nbsp;
 </td>
4)Open \workspace\Stores\src\ConsumerDirect\storetext_en_US.properties
5)introduce a constant : MY_NEW_PAGE=My New Page
6)After the above steps, clean the project -> build->restart server->Add and remove WC project
7)Add and remove WC project is required because all the properties files are loaded at deployment time itself, so what ever entry me make in existing properties file or if we introduce a new properties file (it has to go in \workspace\Stores\src\<<project name>>) restart/republish of WC is required.

output looks like:





8)If we don't Add or remove project we see output as below:


Monday 25 February 2013

WCS Development Environment



WebSphereCommerceServerExtensionsLogic --> project has extended java related code, it can be anything.
WebSphereCommerceServerExtensionsData --> This has EJB related code, if any new ejb module has to be developed, we have to do changes in this project
WC --> This project has configuration files, i.e., xml files, mediator files (BOD related) etc
Stores --> This project has all stores related .properties files (resource bundle), jsp, css, js, images, etc. If any of the stores are published using Accelerator - a folder of that store is created in this project.
Rest --> Rest relted code has to be written here.


WebSphere Commerce workspace

WebSphere Commerce Developer provides a fully configured workspace for Rational Application Developer.

Initially, the workspace exposes only those projects that are necessary for customization, namely:

WC
    This server project contains the WebSphere Commerce EAR file.
CommerceAccelerator
    The Web module for the WebSphere Commerce Accelerator. The WebSphere Commerce Accelerator tools can be customized by creating and modifying assets in this Web module.
LOBTools
    IBM Management Center for WebSphere Commerce adds this Web project. The Web project contains the Management Center assets; these assets can be customized.
OrganizationAdministration
    The Web module for the Organization Administration Console. The Organization Administration Console can be customized by creating and modifying assets in this Web module.
SiteAdministration
    The Web module for the Administration Console. The Administration Console can be customized by creating and modifying assets in this Web module.
Stores
    The Web module for WebSphere Commerce stores. Stores can be customized by creating and modifying assets in this Web module.
WebSphereCommerceServerExtensionsData
    This EJB module is used to create custom enterprise beans.
WebSphereCommerceServerExtensionsLogic
    This Java project is initially empty and is used to create new Java classes.
WebServicesRouter
    This Web module is initially empty and is used to store custom web services.

If necessary, other projects such as WebSphere Commerce EJB modules can be imported into the workspace and subsequently customized.
Note: When customizing existing WebSphere Commerce code, issues arise when applying WebSphere Commerce fix packs or migrating to a new release of WebSphere Commerce. To retain the changes you need to reapply your customizations after applying a fix pack or migrating to a new release of WebSphere Commerce.

To work on several development projects at a time, multiple workspaces can be created by installing WebSphere Commerce Developer multiple times.

Wednesday 20 February 2013

Editions of Websphere Commerce

FeatureBenefitExpressProfessionalEnterprise
Starter stores for the consumer direct business models include Web 2.0, mobile, and Social Commerce featuresReduce costs in site development and deployment.
  • Feature Pack 5 Aurora starter store
  • Madisons starter store
  • Madisons mobile starter store
  • Consumer direct enhancements include:
    • Remote widgets
    • IBM Gift Center
    • Coshopping
    • Punch-out payment
    • Product ranking
    • Digital wallet
    • Social Commerce
    • WebSphere Commerce search
    • Social bridging
    • Subscription support
    • Dynamic kit configuration with Sterling Configurator
    • Coremetrics Intelligent Offer dynamic recommendations in starter stores
    • Feature Pack 4 Smart phone and tablet starter stores
    • Feature Pack 4 Facebook integration
    • Feature Pack 5 Bazaarvoice ratings and reviews
xxx
Starter stores for B2B direct and indirect business models:Reduce costs in site development and deployment.
  • Elite starter store
  • Extended Sites starter store
  • Demand chain business model
  • Supply chain business model
  • Enhancements include:
    • WebSphere Commerce search
    • Coremetrics Intelligent Offer dynamic recommendations in starter stores
    • WebSphere Commerce ProfessionalWebSphere Commerce EnterpriseIntroduced in Feature Pack 3 Dynamic kit configuration with Sterling Configurator
x
Globalization and localization supportThe WebSphere Commerce architecture is designed to support globalization. Globalization is the proper design and execution of systems, software, services, and procedures so that one instance of software, executing on a single server or end-user machine, can process multilingual data and present culturally correct data in a multicultural environment such as the Internet.
All starter stores are localized. In addition to globalization, these starter stores have additional features specific to a market.
  • Brazil starter store
  • MayUJoy starter store
xxx
MarketingMarketing Managers can use Web activities and Dialog activities to deliver brand or promotional messages to customers through various methods. Methods include: displaying the message on store pages, or sending a message with email or mobile text messaging.
Precision marketing capabilities allow marketers & merchandisers to create, manage, and deploy personalized marketing campaigns across direct and extended brand touch points according to customer behavior: Target customers with relevant marketing information based on their personal browsing and shopping habits. Other approaches include marketing experiments, targeted marketing, campaigns, and e-spots.
Introduced in Feature Pack 2 Coremetrics Intelligent Offer automatically generates personalized product recommendations for each visitor. Recommendations are based on current session and historical browsing, shopping, and purchasing data through a powerful set of proven and configurable algorithms. Marketers can create marketing campaigns to control when, where, and to which customers to display these relevant product recommendations.
x
Dialog activities excepted
xx
WebSphere Commerce search
Introduced in Feature Pack 2 WebSphere Commerce search provides enhanced search functionality in starter stores. The functionality provides enriched search engine capabilities such as automatic search term suggestions and spelling correction, while influencing store search results with search term associations, and search-based merchandising rules.
Feature Pack 5 WebSphere Commerce search provides faceted navigation support in the Aurora starter store. Business users can improve customer search results by selecting the product attributes for facet display.
xxx
PromotionsUsing promotions, you can offer customers incentives to purchase. WebSphere Commerce supports numerous types of promotions. Examples of price promotions include simple discounts; merchandise specials such as gifts with purchase and buy-one-get-one; and service promotions that include reduced shipping costs.xxx
Distributed Order Management (DOM) integrationThis integration provides comprehensive coverage of the order lifecycle across channels, from capture to fulfillment.
Introduced in Feature Pack 2 An integration module, supporting a subset of integration scenarios, is provided to enable the use of Sterling Commerce as a Distributed Order Management System that is compatible with WebSphere Commerce.
Feature Pack 5 Sterling Order Management integration offers further integration of IBM WebSphere Commerce and IBM Sterling Order Management Release 9.2. This order management-enabled commerce integration strengthens both products, providing a complete end-to-end solution.
xxx
Cross-channel order processing Provides cross-channel business processes to efficiently serve customers, contact-center representatives, gift registrants, distribution channel partners, and others. Interfaces integrate with external systems such as POS, kiosk, enterprise resource planning, (ERP) and fulfillment systems (multichannel order management). xx
Business user tools for managing catalogs, promotions, marketing activities, assets, workspaces, and managing stores.
IBM Management Center for WebSphere Commerce
The IBM Management Center for WebSphere Commerce, or Management Center, is a suite of tools to support store management, merchandising and marketing tasks for business users (Sellers, Marketing Managers, Product Managers, Catalog Managers and others).xxx
Business user tools for managing catalog filters, price lists, and price rules.
IBM Management Center for WebSphere Commerce
Introduced in Feature Pack 2 Business users can manage price lists and price rules in the Management Center with the Catalog Filter and Pricing tool. Price rules can be used to dynamically change prices based on the product, category, customer, and more. Price lists are used as data into price rules. Price rules can be assigned to contracts to support B2B, or to stores to support Extended Sites.
x
Business user tools for managing store page layouts.
IBM Management Center for WebSphere Commerce
Feature Pack 5 Business users can manage page layouts in the Management Center with the Page Layout tool. The Page Layout tool allows business users to view page layouts and assign layouts to several pages within the store.
x
Administration toolsThe Data Load utility provides an efficient data load solution for catalog, inventory, and pricing information into your WebSphere Commerce database.
Introduced in Feature Pack 2 The Web feed utility provides a new way to connect to Web feeds, such as a Content Management System, and harvest static, unstructured content.
xxx
Web-based framework tools called WebSphere Commerce Accelerator to manage business operations such as managing stores, inventory, fulfillment, orders, returns, payments, and auctions.
WebSphere Commerce Accelerator
With the WebSphere Commerce Accelerator you can maintain online stores, hubs, and catalogs by completing various store operations, from managing the presentation of your store to creating and maintaining orders to tracking store activities.xxx
Analytics and business intelligence using additional softwareWebSphere Commerce provides a framework and tools to simplify the process of setting up your site to use IBM Coremetrics, the industry leading hosted Web analytics solution. The framework is implemented as a tag library designed to act as an intermediary layer between WebSphere Commerce and Coremetrics. The tools include an auto tagging utility to place analytics tags in your store pages, and a utility to generate a file containing your catalog hierarchy for Coremetrics. This solution can significantly reduce the time required to deploy web analyticsxxx
Payments using a payments plug-in architectureThe Payments subsystem contains three main parts: Payment rules engine, Payment plug-in controller, and payment plug-ins.xxx
Open standards supportBuilt on accepted, industry standards like Java technology, JavaServer Pages, Enterprise JavaBeans, (EJB) and XML, WebSphere Commerce can be easily integrated to your existing middleware and systems.xxx
Developer toolsStandards-based, rapid application development environment that uses and extends IBM Rational Application Developer based development environment.
Key development areas include:
  • Web services and WebSphere Commerce
  • Feature Pack 4 REST services
xxx
Sales Center for WebSphere CommerceA separately ordered product that improves the productivity of call center employees. Gives call center representatives the functionality they need to service and up-sell cross-channel customers. xx
WorkspacesA workspace is an access-controlled work area where you can make and preview changes to managed assets, without affecting what is currently running on your site. Working in the context of a workspace is similar to having your own private copy of the managed assets. You can make and preview changes without affecting managed assets outside the workspace. You can commit the changes you make in a workspace to the production database, and see the effects of your changes on your site. xx
Auctions WebSphere Commerce provides an auctioning component that lets you sell products to the highest bidder. This component provides an ideal environment for implementing small to moderate-scale auctioning as part of your e-commerce solution, and for conducting auctions simultaneously. xx
Contracts and entitlementYou entitle customers to various aspects of a store such as what products they can purchase from a store, the price they pay for a product, and what payment methods a store will accept from customers.
Customer entitlement is controlled by the following WebSphere Commerce components:
  • Business accounts
  • Contracts
  • Business policies
Introduced in Feature Pack 2 The Catalog Filter and Pricing tool in Management Center can be used to filter by product, category, or product attribute. Filters can be assigned to contracts to support B2B, or to stores to support Extended Sites.