Friday, August 19, 2011

All about Registry in WCS

How to create your own Registry
 -Create a classfile which implements com.ibm.commerce.registry.Registry
 --public abstract interface Registry
 --public abstract void initialize()
 --public abstract void refresh()
What are the methods required in side the Registry
 -initialize() --call refresh method
 -refresh() --load the values

what is the  registry Entry in side the  wc-server.xml ?
<Registries>
 <registry  name="BipinRegistry" regClassName="com.xxx.BipinRegistry" />
</Registries>

How to invoke the registry from controller command
 -MyNewRegistry myregsty= MyNewRegistry (RegistryManager.singleton().getRegistry(MyNewRegistryname ));

When registry will load
 -While starting the server ,registry will initialize

If the data in the tables associated with a registry is changed, you will need to refresh that registry for the change to take effect. For example, if a new entry is added to the Struts Configuring, the UrlRegistry has to be refreshed. Otherwise, the WebSphere Commerce runtime environment will not recognize the new URL.

Most commonly using registry: URLRegistry, Promotion Regisry

Wednesday, August 17, 2011

WebSphere Commerce business models



  • Direct sales
    • Consumer direct (B2C)
    • Business to business direct (B2B)
  • Scalable direct sales
    • Extended Sites
  • Value chain
    • Demand chain
    • Supply chain

Sunday, August 7, 2011

Catalog - MasterCatalog. SalesCatalog. and all

Catalog
The catalog subsystem is a component of the WebSphere Commerce Server that 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

Different between product and item?
A product, however, is a group of items that exhibit the same attributes.
For example, a hammer is a product, while the 15 inch hammer with a wooden handle is an item
An item is a tangible unit of merchandise that has a specific name, part number, and price.
For example, a 15 inch hammer with a wooden handle (part number 15) is an item.
Although items do not need to be related to any product, and can exist independently in the catalog, each item should be associatedto one product to maintain a consistent view when using the Product Management tools in the WebSphere Commerce AcceleratorA parent product is not required for each item. However, this is necessary in order to use the Product Management tools.Also, pricing and discounts will not be able to default to the parent product level, meaning that all items must have their own prices and discounts,
if applicable

About Master Catalog:
The master catalog is the central location to manage your store's merchandise.
Everything you need in your store is contained within the master catalog. It is the single catalog containing all products, items, relationships, and standard prices for everything that is for sale in your store
You can share the master catalog across stores and define as many stores as needed.

About Sales Catalog
A sales catalog is a subset of the merchandise and services found in the master catalog.
A sales catalog has a flexible display structure that allows you to associate products to more than one category,to suit the requirements of your store.Sales catalogs can be used in conjunction with the master catalog and contracts to control which products display for a particular customer


Loading the catalog:
-Product Management tools in the WebSphere Commerce Accelerator
-loading utilities to mass load the catalog

Catalog entries
Catalog entries represent orderable merchandise in an online catalog. The entries typically have a name or part number, a description,one or more prices, images, and other details. A catalog entry can be a product, item, bundle, package, static kit, or dynamic kit.If necessary, you can create new catalog entry types that do not fit into one of the six existing models. More information about each type of catalog entry is available below.

Products
A product is a type of catalog entry. A product acts as a template for a group of items (or SKUs) that exhibit the same attributes. For example, a shirt is a product in your catalog. After adding attributes and attribute values to the shirt, each variation becomes an item, such as a small black shirt.

Items
An item is a tangible unit of merchandise that has a specific name, part number, and price.
For example, a small black shirt is an item while a shirt is a product. All items related to a particular product exhibit the same set of attributes and are distinguished by their attribute values.
Note: For WebSphere Commerce Accelerator users, the terms items and SKUs are considered synonymous.
When using the Product Management tools in the WebSphere Commerce Accelerator, the orderable item is called a SKU. In the WebSphere Commerce database schema, this particular type of catalog entry is called an item.

Bundles
A bundle is a collection of catalog entries to allow customers to buy multiple items at once.
For example, a bundle for a computer might be composed of a central processing unit, a monitor, a hard drive, and a CD-ROM drive. A bundle is a grouping of items, or a combination of products, items, and fully resolved packages. If you select a bundle which only contains items, the bundle is decomposed into separate orderable SKUsthat are added individually to the shopping cart. However, if you select a bundle which contains products, these products need tobe resolved into items through SKU resolution before they can be added to a shopping cart. In either case, once a bundle is decomposed and its component items are added to a shopping cart, you can modify or remove each item.

Packages
A package is an atomic collection of catalog entries. For example, a computer package might contain a specific central processing unit, monitor, and hard drive that cannot be sold separately. Similar to a product, a package has defining attributes and is a container for fully resolved packages. A fully resolved package is comparable to a SKU. A package has its own price and is an actual orderable SKU that can be added to a shopping cart.You cannot decompose or modify a package either during navigation or after the package has been placed in the shopping cart.
Note: For WebSphere Commerce Accelerator users, packages and prebuilt kits are considered synonymous. When using the Product Management tools in the WebSphere Commerce Accelerator, a package is known as a prebuilt kit.In the WebSphere Commerce database schema, this particular type of catalog entry is called a package.

Dynamic kits
A dynamic kit is a type of catalog entry which can be dynamically configured by the customer.
This configuration (or grouping) of products is based on the customer's requirements and is sold as a single unit.The components of a dynamic kit are controlled by an external product configurator through a set of predefined rules and user interaction,and supplied at order entry time. Adding a dynamic kit to an order is similar to adding a package.Like a package, the individual components of a dynamic kit cannot be modified and the entire configuration must be fulfilled as a whole.However, you may change the dynamic kit components by reconfiguring it using an external product configurator.

Static kits
A static kit is a group of products that are ordered as a unit. The information about the products contained in a static kit is predefined and controlled within WebSphere Commerce. The individual components within the order cannot be modified and must be fulfilled together.A static kit will backorder if any of its components are unavailable.A static kit is first created as a package, then configured by an administrator.

Product sets
Product sets are associated with published catalog entries.
A product set provides a mechanism to partition your catalog into logical subsets.
This partitioning allows you to show different parts of your catalog to different users.
You can create a contract and specify that the participants of the contract are only entitled to purchase products that fall into a predefined product set.WebSphere Commerce provides tools to create and manage contracts and entitlement filtering rules on the master catalog.

Attributes
Attributes are properties of products in an online store. There are two types of attributes:
--Defining attributes are properties, such as color or size. Attribute values are the property of an attribute such as a specific color
(blue or yellow) or size (medium). You must predefine attribute values before assigning them to items. Attribute values are implicitly related
to their attributes. Each possible combination of attributes and attribute values equals a new item. After creating attributes and their values,
you can update information such as name, description, and type (text, whole numbers, or decimal numbers). Defining attributes are used for SKU resolution,
where each possible combination of attributes and attribute values defines an item.

--In contrast, descriptive attributes simply provide additional descriptions. For example, some pieces of clothing should only be dry
cleaned, never washed, and a descriptive attribute can specify this dry clean only condition. Note that descriptive attributes are not
used for SKU resolution and are meant to enhance product descriptions, or to provide easy customization for your business specific information.

Attribute values
Attribute values are properties of an attribute such as a specific color (blue or yellow) or size (small, medium, or large).
You must predefine attribute values before assigning them to items. Each possible combination of defining attributes values defines an item.

Package attributes
Package attributes must be created from the attributes of the products that are contained within packages.
A package containing only items will have no package attributes.

Package attribute values
Package attribute values are the values assigned to package attributes. Package attribute values must be created from the attribute
values of the products that are contained within packages


Tables
STORECAT     -store to catalog
CATTOGRP    -catalog to group
CATGRPREL    -group to group
CATGPENREL    -group to parent
CATENTREL    -group to praent
CATENTREL    -parent to item


URLS---
StoreCatalogDisplay
TopCategoriesDisplay
CategoryDisplay
ProductDisplay

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 the
ProductId can be displayed in the current store, if published, and is not marked for delete.

ResolveSkuCmd-Certain catalog entries may need further processing before being added to an order.
An example is resolving a product into an item through SKU resolution, performed by the ResolveSkuCmd task command.


DataBeans--
StoreDataBean--extends StoreAccessBean ->salesCatalogs()
CatalogDataBean-extends CachedCatalogAccessBean ->getTopCategories()
CategoryDataBean-extends CachedCatalogAccessBean ->getSubCategories()
CatalogEntryDataBean-extends CachedCatalogEntryAccessBean
ProductDataBean-extends CachedProductAccessBean

Example
<wcbase:useBean id="catalog" classname="com.ibm.commerce.beans.CatalogDataBean" />


JSP
StoreCatalogDisplay.jsp
Index.jsp
    -parameters.jspf
    -nocache.jspf
TopCategoriesDisplay.jsp
    -LayoutContainerTop.jspf
        -HeaderDisplay.jspf
            -CachedHeaderDisplay
    -CachedTopCategoriesDisplay.jsp
    -LayoutContainerBottom.jspf

and more...




































Saturday, August 6, 2011

More about TypedProperty

   TypedProperty
  • Which extends HashTable
  •  Implements Serializable
  •  com.ibm.commerce.datatype.TypedProperty
  •  TypedProperty(),
  • TypedProperty(int initialCapacity),
  • TypedProperty(int initialCapacity, float loadFactor)
  • TypedProperty(Hashtable hTP) are constructors
  • example
  • TypedProperty rspProp = getRequestProperties();
  • rspProp.put("catalogId","10051");
  • Located in Enablement-BaseComponentLogic.jar

All about Organization Structure

About wcs Organization Structure:
The WebSphere Commerce organization structure provides a framework for the actors, or entities, in your business scenario. This framework is organized in a hierarchical structure, which mimics typical organizational hierarchies with entries for organizations and organizational units and users.The organization structure and the access control model, are closely related, in that the access control model applies access control policies to organizations rather than to individual entities (stores, customers, administrators and so on).The policies that apply to an entity (or resource) are applied to the organizations that own the entity or resource.

The basic organization structure is
(Root organization)  --> (Default Organiation)
(site administrator)         (customer)

Root organization:
The root organization is the top level organization and is its own parent. All organizations in the WebSphere Commerce organization structure are descendents of the root organization. The site administrators are owned by the root organization.

Default organization:
The default organization is owned by the root organization.
All guest customers and all customers in a consumer direct scenario belong to the default organization.
Customers in a B2B direct or B2B indirect scenarios should not be placed under the default organization,
but rather in the appropriate buyer organization. B2C users under the default organization can be managed by an administrator in WebSphere Commerce Accelerator.Business users outside of the default organization can be managed in the Organization Administration Console.Do no create stores under the default organization. Instead, create stores under a separate organization, such as the seller organization

Consumer Direct Organization structure
Root--Seller Organization--B2COrganization
Root--Default Org

B2B Direct Organization Structure
Root Organization -Default Organization
Root Organization - Buyer Organization
Root Organization - Seller Organization - B2B Organization
Both Default org and Buyer org will keep the customer data and Seller Organization will keep the store data
A child organizational unit (ou), B2B organization, is created under the seller organization to own the store (Business).
eg :

Extended Sites Organization Structure
Root org -Default Organization (customers who does NOT belogs to any body)
Root org -Buyer Organization (Buyers who represents organizations)
Root org -Seller Organization
  -B2C - Store A
  -B2B - Store B

Root Organization -Extended Sites Organization -
  -Extended Sites hub Organization (Channel adminstrators,Hub store)
  -Store directory Organization (Store Directory)
  -Asset Store Organization
   -Catalog Asset Store
   -Consumer direct storefront asset store
   -B2B direct storefront asset store

Thursday, August 4, 2011

All about BCS or Business Context Services

About Business Context in WCS
In previous releases, the context information was stored in the Command Context object.
With the introduction of Business Context in this release, this information are now stored in various business contexts. Command Context becomes a helper class that wraps on top of these business contexts.
One can directly retrieve the same piece of information by retrieving the appropriate business context by using the CommandContext.getContext(businessContextName) method.
Information that is not available from business contexts, remains available and local to the Command Context object.
A command can get the following key information from the command context
Or
Contextual informations are encapsulated in to different Business Contexts. Such as EntitlementContext, CommandContext etc
BCS(Business Context Services) manages information used by Business Contexts

What is Context?

What is Business Context Services? The business context service manages contextual information used by business components.
 The information is encapsulated within different types of business contexts.
 This process formalizes the context infrastructure and fosters reuse between different business models
What is Business Context

What is Command Context?
 Commands can obtain information using the command context.
 Examples of information available include the user's ID, the user object, the language identifier, and the store identifier. When writing a command, you have access to the command context by calling the getCommandContext() method of the command's superclass. The command context is set to the controller command when the command is invoked by the component facade.  A controller command should propagate the command context to any task or controller commands that are invoked during processing
 BaseContext baseContext = (BaseContext)getCommandContext().getContext(BaseContext.CONTEXT_NAME);
 baseContext.getRunAsId();
 baseContext.getStoreId()
 baseContext.getUserId()
 baseContext.getUser()
 baseContext.getStore()
 GlobalizationContext globalizationContext = (GlobalizationContext)getCommandContext().getContext(GlobalizationContext.CONTEXT_NAME);
 globalizationContext.getLanguageId();
 globalizationContext.getCurrency(); 
 getCurrentTradingAgreements()
 getCurrentTradingAgreements(CommandContext)


List all type of Business Context public interface Context
 public interface CommandContext
 public class PromotionContext
 public interface BaseContext

 BaseContext
 This context contains the basic attributes that an activity needs, such as store ID, caller ID, and the run-as ID.

 EntitlementContext
 Contains the contract information associated with the user
 This context holds information about entitlement criteria, such as reduced prices for gold club membership.

 GlobalizationContext
 Contains the globalization/locale information assosiated with the session
 This context helps components determine locale-specific information such as what language a message should be rendered in, or
 what currency should be used in the calculation of a price.

 ContentContext
 If Workspaces are enabled, this context determines the content or business objects that can be displayed or edited based on
 versioning information.

 TaskContext
 If Workspaces are enabled, this context determines which task an administrator is currently performing.

 AuditContext
 This context is usually provided by third party components. You might want to bridge the gap to the third party interface instead of programming to it directly. This context enables you to connect to a different vendor's implementation of the service in the future without the need to rewrite your component.

 PreviewContext
 The preview context is the attempt to solve both problems by allowing multi-users to validate independent content without influencing other users and ensuring the content does not required additional changes after validation. In order to achieve this, a context object will be associated with the preview operation that will represent the state information that will be used when deciding the content to preview along with other external events. By associating a preview context with an activity, operations can use this content state information as a basis to decide what content to display. To solve the date issue, the preview context will contain the preview date which will be used to render the content to be display. By having activities having a unique preview context, this will allow multiple users to preview independent content without having to change content data or global system state information.

 ExperimentContext
 ExperimentContext is used to store the result of all active experiments for individual users, where result is a
 system-generated number which determines the control or test element to be selected in the experiment.
 This information is persisted throughout the user session, so the same result will be used in
 the same session without re-generation of the number.

 CatalogContext
 This context contains information related to the catalog in the current session, such as the catalog ID, the catalog owner,
 and whether this is a master catalog or not.

 GiftRegistryContext
 This context contains gift registry information for a user in the current session, such as a list of gift registries that  the user has accessed, the relationship the user has to specific gift registries (gift giver, registrant or coregistrant), and the external ID of the gift registry the user is currently managing

BipinContext !!
No kidding.. It is possible You can create your own Context. Read the steps given below

Examples of Business Context and how to use it?

How to create new Business Context?

Business Context configuration file?
 Default business contexts are defined in the xml/config/businessContext.xml file.
 The location of the file is defined in the BusinessContextService/BusinessContextConfigFile attribute in
 WebSphere Commerce configuration file (xml/wc-server.xml).
 Multiple file locations separated by commas are allowed for this attribute to support component-based development. That is, when creating a new business context, instead of modifying the default configuration file, you can define it in a  separate file and append it to the end of the BusinessContextConfigFile attribute on the BusinessContextService element.
 This implementation allows for future upgrade to the businessContext.xml file without affecting the business context that you have registered.

Refer details here
http://www.ibm.com/developerworks/websphere/tutorials/0701_deluca/section6.html