Saturday, February 25, 2012

Using Contracts for eCommerce in Websphere Commerce

As per the request from one of the comments on the blog, this is a high level view on contracts using Websphere commerce and by no means a complete coverage of contracts as it's such a vast topic.

Contracts: This is one of the most interesting concepts when dealing with both B2B and B2C eCommerce systems. Every store published out of the box is associated with a default contract. Lot of clients use contracts on B2C site, if the requirements for a B2C site include using contracts or employment purchase programs using contracts. It is a best practice to use EliteStoreFront or if you are still using V 6.0 (Advance B2B).

Why are contracts required? These are good reasons.
1. If you want to use the same offer price lists as your regular customers but provide a percentage or fixed amount off of the same prices to a subset of customers such as Employees or Students.
2. If you want include or exclude a set of categories or products to a different set of customers.
3. In the case of B2B systems, contracts allow creating separate pricing tiers for different set of customers.
4. Contracts can extend existing contracts or new contracts to provide multi-tiered pricing.
5. You can also have separate shipping prices per contract.
6. Payment methods can also be setup per contract.

How do you create contracts? Essentials for creating a contract.
Organization->Account->Contract

1. Create organization--using orgadmin console.
2. Create Account --(Accelerator, sales-> accounts)
3. Create Contract --(Accelerator, sales->accounts->new contract)

Important concepts related to contracts:
Catalog Filter : Tooling to provide pricing and catalog filters.
Pricing: (Pricing percentage off/fixed amount off) can be used to increment or decrement the default offer price for a subset of customers.
This is provided in Accelerator and Management center. The one is management center is not restricted to a store and can be shared across stores and contracts.
Include/Exclude Catalog: Allows to include exclude catalog specific set of catalog entries by specifying which categories,catalog entries, attribute dictionary attributes.


Friday, February 17, 2012

Solution Faceted Search

Search is an integral part of every company with online presence and corpus data both structured and unstructured. The goal is always to navigate customer find the product/content in a fast efficient way to purchase or view.

What is a facet: As per the Google definition, it's a particular feature or an aspect of something. For those of us from SQL background think of facets as groupBy functionality. As we all understand to perform a groupBy is a complex performance operation from code. In world of searchandize, each facet is modeled as a Dimensions and Dimension Values using a Search engine(It could be any engine Endeca or SOLR or something else)

E.g. Dimensions: Color, Size, Price, Men's, Shirts
Dimensions Values: Red,Blue,Black, White
Ranges: In case where you have e.g. Authors on books or Price where we have a lot of values, it is a good idea to go with a range.

Faceted Search process:
Most of the Search engines have an ETL process to merge\Join data from various sources and massage\clean data, if you are data is not good (e.g. If a company sells USB drive, GB would be a facet but if the value is not clean as an G B or GB. or G.B for GB, it would translate to wrong facets in the front end). hence it is important to have good data.
Once you have get past cleaning data, the process is to build Attribute dictionary and map it to the data and build indices off it.
From the front end, the Navigation is driven by state N=0 that would provide all data from Search and as you drill to specific data, you change the Navigation state. Most of the times, the navigation state is encrypted for front end customers to make the URL smaller. There are other parameters such as Navigation filters.




Monday, February 13, 2012

Endeca | Programmer primer | Objects Query\Results\Connection

A lot of customers use Endeca or SOLR as their search engine in WCS world and this primer series on Endeca is to provide some basics:

Information Transformation Layer: Transforms the source data into indices for MDEX Engine. The transformation process does not change the original data but only it's representation within your Endeca Impl.

Query (Object ENEQuery or sub class UrlENEQuery): Endeca follows one query one page approach. The MDEX is designed to return all of the information required to build an entire page.The MDEX engine is specifically designed this way to reduce the number of queries. There are four kinds of queries:

  • Navigation (N) --setNavDescriptors(),
  • Endeca Record (R)- setERecSpec(), 
  • Dimension Search(D) --setDimSearchTerms(),
  • Aggregate Endeca Record (A, An, Au)--setAggrERecSpec.

e.g. ENEQuery nequery = new UrlENEQuery(request.getQueryString(), “UTF-8”);
     ENEQuery nequery = new ENEQuery();
    DimValIdList descriptors = new DimValIdList("123");
   nequery.setNavDescriptors(descriptors);


Query Search results as EnQueryResults object: For any given type of query such as navigation, record search, dimension search, .etc. The top level object returned is EnQueryResults and that could encapsulate other objects.

Endeca Record Object as ERec Object: It contains all the information regarding the Endeca record including Endeca Properties (name\value pairs) and Information about record's location within the dimension hierarchy.

Connectivity object HttpENEConnection: enables connections with MDEX engine.
     e.g. ENEConnection nec = new HttpENEConnection(eneHost, enePort);


Query Exceptions : There are multiple exceptions ENException, ENEConnectionException objects.


Sample code for retrieval of query results:

//Create an ENEConnection
ENEConnection nec = new HttpENEConnection(eneHost, enePort);
//Create a query from the browser request query string
ENEQuery nequery = new UrlENEQuery(request.getQueryString(),
“UTF-8”);
//Execute the MDEX Engine query
ENEQueryResults results = nec.query(nequery);

Wednesday, February 8, 2012

Endeca overview ---High level Architecture

Endeca is a very widely used search engine for Web and E-commerce applications and it is very popular with lot of WCS clients. High level architecture components of include:

MDEX Engine:  The MDEX engine is the indexing and querying engine that provides the core functionality for all Endeca. MDEX Engine is stateless and hence requires the query to have all the parameters to be provided each time.


Endeca Workbench: The Endeca workbench is a web based tools that allows business users to configure and administer an Endeca application for Merchandising, content spotlighting, search configuration and usage reporting. The main functions are as follows
Rule Manager: Add\Edit\Activate\Deactivate rules and preview using the preview application.
KeyWord Redirects: Create and manage keyword redirects.
There are multiple functions such as Resources Lock Page, Instance Configuration Page, Dimension Order, Stop Words Page, Phrases Page, Thesaurus, Daily Reports,User Management  and EAC settings, EAC Admin Console.

Endeca Platform Services:  This consists of mainly Endeca Information Transformation Layer and Endeca application controller (EAC).
EAC consists of EAC central server and agents. EAC centeral server manages all agents.
Data Foundry: consists of forget program and related components.
Presentation and logging API's: API's to MDEX Engine and Log Server.
Logging and Reporting system.
Reference Implementation: Sample developer studio project source data for multiple platforms.
emgr_update: Utility to update instance configuration to Endeca workbench.
Endeca Control System: The Job control Daemon (JCD) and the control Interpreter.
     Forging \ETL Server: Process of gather data from various sources and building the indices is Forging.
     Pipelines: Data handling components that transforms Raw data to Indices and Deploy them


Endeca Presentation API: provides interfaces to log server and MDEX Server. The API is available in 2 flavors for Unix and Windows.


Friday, February 3, 2012

Securing webserver 404/403 requests from fingerprinting

As a part of improving the security on a eCommerce site, it is always a good idea to turn off fingerprinting.

How to reproduce this: Go to any static asset on the site and change it to wrong file name and you will see a 404 or even 403 errors. It would print all the information regarding the web server, which could be potentially exploited.

IBM_HTTP_Server/X.X.X.X-PMX4623 Apache/2.1.97 (Unix) Server at host.com Port 80

In order to protect the site for security reasons, these values need to be changed in httpd.conf to make the environment more secure. Make this change and restart webserver for the change to reflect.

Test Environment:

ServerTokens Full

Production Env:
           
ServerTokens Prod


Test Environment:

ServerSignature On

Prod Environment:

ServerSignature Off