Software that simplifies putting up an internet storefront
Microsoft Site Server 3.0 Commerce Edition (SSCE) simplifies creating an Internet storefront by providing e-commerce Web developers with an extensive set of tools and capabilities, such as sample stores that you can use as models for your storefront. SSCE's wizards can generate your storefront site from scratch with basic mechanisms for gathering shopper and order information, database storage, and skeletal order processing. SSCE includes integrated advertising and promotion tools and management tools for storefront maintenance. These tools, combined with third-party snap-ins that calculate tax, shipping costs, and payment, make it easy to put up a simple storefront and start doing business.
However, to understand SSCE and use it to create a more sophisticated solution that integrates with existing systems and databases, you must roll up your sleeves and look under the hood. Upon closer examination, you find that SSCE contains several key technologies and structures: Active Server Pages (ASP), component object model (COM) objects, and Order Processing Pipeline (OPP). Most pages in an SSCE Web site are ASP containing server-side script, which manipulates a set of COM objects Microsoft provides with SSCE. The software uses these COM objects to collect information from the shopper,
retrieve data from and store data to the underlying database, and process the shopper's order through the OPP. In this article, I'll examine how the OPP works and how you can use the Scriptor tool to create your own OPP components that will customize the way SSCE processes orders.
OPP
Consider how you buy a product at a typical retail shop: You enter the store, find what you're looking for, and pay the checkout clerk for the item. In the same way, SSCE's OPP processes order information in a prescribed sequence. SSCE's Business to Consumer (B2C) OPPs go through steps similar to those of a sales clerk in a retail store. The B2C pipelines organize the order process into discrete stages, which the software executes in a well-defined sequence. At each stage in the order process, SSCE retrieves information from or adds information to the shopper's OrderForm. The OrderForm is a COM object SSCE provides to collect information about the shopper, about the items the shopper is purchasing, and about payment details. Table 1 outlines the standard B2C stages. SSCE also offers Business to Business (B2B) pipelines, which handle transactions in stages similar to B2C pipeline transaction stages.
SSCE stores OPP information in pipeline configuration files with .pcf extensions. You create these files with the Commerce Server Pipeline Editor. These .pcf files define which stages the software will carry out for a given pipeline transaction, and define which OPP COM objects SSCE will run within each stage. The OPP COM objects perform the work at each stage. SSCE offers three standard B2C templates you can use with the Pipeline Editor to create .pcf files (these templates have a .pct extension).
Product.pct. You use this template to create a .pcf file that runs OPP COM objects that compute price and discount information for individual products. This pipeline displays product and price information on the product.asp page. The resulting .pcf file defines the Product Info, Shopper Information, Item Price, Item Adjust Price, and Inventory stages.
Plan.pct. You use this template to create a .pcf file that runs OPP components that present the shopper with an order total. This order total includes all promotional discounts, taxes, shipping charges, and handling charges. SSCE uses this .pcf file to calculate an order total for the shopper to examine prior to payment processing. The resulting .pcf file defines the Product Info, Merchant Information, Shopper Information, Order Initialization, Order Check, Item Price, Item Adjust Price, Order Adjust Price, Order Subtotal, Shipping, Tax, Order Total, and Inventory stages.
Purchase.pct. This template creates a .pcf file that runs OPP components that validate the shopper's payment, perform the purchase transaction, and write an order to database storage. Optionally, you can customize this file to write the OrderForm contents to a receipt database. This .pcf file usually receives an OrderForm that the plan pipeline has processed for final payment and acceptance. This template creates a .pcf file that defines the Purchase Check, Payment, and Accept stages.
Screen 1 shows the plan pipeline template in the Commerce Server Pipeline Editor window. The software represents pipelines as plumbing pipes with each vertical section representing a stage and each horizontal section representing an OPP COM object that processes OrderForm information. You can use the Pipeline Editor to add, configure, or remove OPP COM objects in each stage. And, using expert mode, you can create new stages or remove existing ones.
You use the Pipeline Editor to configure each stage to carry out one or more OPP COM objects. If you don't designate an OPP COM object for a particular stage the software skips that stage. OPP COM objects interact with the OrderForm object to complete a transaction. SSCE provides simple prebuilt OPP COM objects you can use to process orders. For example, Table 2 shows prebuilt OPP COM objects for the Item Adjust Price stage. Also, you can purchase a variety of third-party COM objects that handle more complex operations. A third option is to create custom OPP COM objects for specialized processing on your site. You can use all of these OPP COM object types to provide the order processing your business requires.
How SSCE Runs a Pipeline
To run an OPP, you use ASP script to create a PipeContext object. Your SSCE ASP application initializes this object with information the OPP needs. You then create either the Commerce.MtsPipeline pipeline object or the Commerce.MtsTxPipeline pipeline object. Both of these pipeline objects perform the same function, but SSCE runs the Commerce.MtsTxPipeline object inside a Microsoft Transaction Server (MTS) transaction. You decide whether you need transactional integrity for the pipeline processing. Users typically run the purchase pipeline with the MtsTxPipeline object. After you've instantiated your pipeline object, you use your pipeline object's LoadPipe method to load the appropriate .pcf file. Finally, you use the pipeline objects' Execute method to run the pipeline. For more information about running the pipeline from your ASP, consult the SSCE documentation.
Creating a Custom Scriptor OPP Component
What makes a COM object an OPP COM object? The OPP COM object must support the COM interfaces necessary for the component to interact with the pipeline. If you're a COM developer, you can use your favorite COM object development tool (e.g., Visual C++ or Visual Basic--VB) to implement these interfaces. The SSCE documentation specifies how to do this implementation. However, if you're not an experienced COM object developer, you can use SSCE's Scriptor component to construct custom OPP COM objects. With Scriptor, you can write VBScript or JScript (Microsoft's version of JavaScript) to create OPP COM objects that manipulate the OrderForm and perform calculations or back-end processing that the standard components don't provide. The Scriptor component supports the interfaces necessary for interacting with the OPP; you just need to create the script.
vanhaast April 11, 2008 (Article Rating: