Share via


Run Time Services

.NET-based Commerce Server applications require two types of run time services — application services and page services. Application services are the services and data used by the entire application and globally available to all user sessions, such as the Profiling system and the Product Catalog System. Page services are the services and data used only by an individual page and available only within the scope of a user's visit to a site, such as the user's profile.

Application Services

Page Services

Application Services

The Commerce Server Application Runtime simplifies the development of .NET-based Commerce Server applications. The Commerce Server Application Runtime configures Commerce Server application services based on configuration information in the web.config file and makes them easily accessible at run time.

This topic describes the application services provided by the Commerce Server Application Runtime.

Site Resource Settings

Authentication

Address Mapping

Cache Management

Catalog Retrieval

Commerce Event Logging

Creation of Content Selection Applications

Pipeline Management

Profile Retrieval

Resource Localization

Site Resource Settings

A site resource is an entity that provides functionality to the applications in a Commerce Server site. The Web pages of an application use these resources. Site resource configuration settings are available and stored globally within the Commerce Server Application Runtime, and can be accessed through the CommerceContext.Current.Resources property. For more information about the CommerceContext.Resources property, see CommerceContext.Resources Property (BCL)

Authentication

During the OnBeginRequest event, if detection is enabled in the authentication tag of the web.config file, the CommerceAuthenticationModule class automatically detects whether the client supports cookies. The CommerceAuthenticationModule automatically adds a test cookie, creates an instance of the AuthenticationInfo class, and sets the appropriate values for the AuthenticationInfo.SupportsPersistentCookies and AuthenticationInfo.SupportsSessionCookies properties. If cookie detection is not enabled, the value of the AuthenticationInfo.SupportsPersistentCookies and AuthenticationInfo.SupportsSessionCookies properties keep their default value of False.

Use the QueryStringBuilder class, which is available from the CommerceContext class, to build your URLs. The QueryStringBuilder class puts the authentication ticket and/or profile ticket information into the query string if cookieless mode is enabled. You use the QueryStringBuilder.BuildUrl method in any place where you want to append the ticket to the URL in a cookieless scenario. If this is not done, the ticket is not passed on to the next request. If the CommerceAuthenticationModule is enabled in the web.config file, it automatically detects whether the browser supports cookies and populates the query string appropriately.

Note that on the first request to the site, there is no auto-redirect for cookie detection and the default setting for the QueryStringBuilder.CookieSupport property is False, so it is assumed that the browser does not support cookies.

For more information about the CommerceAuthenticationModule, see Commerce Modules and CommerceAuthenticationModule.

Address Mapping

The Commerce Server Order System and the Profiling System store address data in two different formats. This is due to how the two systems represent the data in their run-time objects. The Commerce Server Application Runtime provides a method of automatically mapping data stored in the Profiling System to the Order System, and provides a unified representation of that data at run time. This mapping is configured in the web.config file. For more information about address mapping, see Configuration Services and addressMap Tag.

Cache Management

Commerce Server applications are dependent on the CacheManager object for caching data from the Targeting and Product Catalog systems. The Commerce Server Application Runtime provides access to the CacheManager object services for configuration during the run-time operation of the application. For more information about configuring caches stored within the Commerce Server Application Runtime, see Configuration Services, CommerceCache, Caching.CommerceCacheCollection, and CommerceContext.Current.

Catalog Retrieval

The CatalogContext object (Microsoft.CommerceServer.Runtime.Catalog.CatalogContext) is used for global access in the application, for retrieving individual catalogs, and for performing searches in the Product Catalog System. The CatalogManager object is available globally from the Commerce Server Application Runtime. No special configuration is required for this service.

In addition, the Commerce Server Application Runtime makes it possible to configure a single catalog in the Product Catalog System so that the data is automatically available at run time.

For more information about catalog classes, see Microsoft.CommerceServer.Runtime.Catalog.

Commerce Event Logging

The Base Class Library includes the BaseCommerceEvent object that enables you to create your own Commerce event managed-code objects. When you create a custom Commerce event, the event information is appended to the Web log file query string. These events can then be tracked and used in reports.

For more information about the BaseCommerceEvent class, see Base Commerce Event Class.

Creation of Content Selection Applications

A Content Selection Application is a collection of caches and pipelines that correspond to a particular type of Content Selection operation. For example, the Advertising Content Selection application consists of a cache of target-based content, a pipeline for selecting the content, a pipeline for recording events, and a URL used as the link between the advertisement and the area to which the advertisement corresponds.

In Commerce Server 2002, the Commerce Server Application Runtime enables you to configure these elements in a single location. The Commerce Server Application Runtime automatically ties them together at run time and makes them available to the Content Selection process when content is requested from a particular Content Selection Application.

For more information about the ContentSelector class, see ContentSelector Class (BCL).

Pipeline Management

The functionality of a pipeline is based on three parts: pipeline components, pipeline configuration files, and the pipeline objects used to invoke the pipeline components and configuration files. When running pipelines in a .NET-based Commerce Server application, only a few configuration properties need to be set to in the web.config file to enable the Commerce Server Application Runtime to call the correct components, pipeline configuration files, and objects.

For more information about the pipelines, see Microsoft.CommerceServer.Runtime.Pipelines or pipelines tag.

Profile Retrieval

The ProfileContext object is stored globally in the application, and is used for retrieving individual profile instances. The ProfileContext object is available globally from the Commerce Server Application Runtime. The configuration of the Profile Service and its usage within an ASP.NET application is limited to mapping the properties implemented by the schema representing users and the schema representing organizations. This is specifically required by the Catalog class library to enable Catalog Sets functionality. For more information about profile retrieval, see profiles Tag.

Resource Localization

The MessageManager object was originally designed for use by pipeline components to insert status and error messages into an OrderForm object. The Commerce Server 2000 Solution Sites use a specialized XML document, rc.xml, for setting the MessageManager object. The Commerce Server .NET Application Framework contains a new method for localizable resource creation and management. This method has a schema similar to the rc.xml document, but with much richer support for localizable resources, including strings and bitmaps.

The Commerce Server Application Runtime relies on the Commerce Server .NET Application Framework localizable resource schema with one exception: the Order Processing pipeline, which remains dependent on the MessageManager object. The Commerce Server Application Runtime maps specific resources from a .resx file and loads them into the MessageManager object when the application starts, so that when the MessageManager object is required by the Order Processing pipeline, it has the data it needs to function correctly. For more information about configuring the MessageManager object, see Configuration Services. For more information about managing messages in the Commerce Server .NET Application Framework, see Using MessageManager.

Commerce Server Solution Sites are available at https://go.microsoft.com/fwlink/?linkid=6491.

Page Services

In addition to the global data required for a Commerce Server application to run, there is also data specific to each page, and potentially to each user, that is provided within the page services. Page services provide Commerce Server-specific data per HTTP request. This data is accessed through the CommerceContext class. The page services are:

  • Current user's profile. The current user's profile is available from the CommerceContext.Current.UserProfile property.
  • User catalogs. The list of catalogs to which the current user has access is available from the CommerceContext.GetCatalogsForUser method.
  • Targeting context. The current targeting context as required by the Content Selection Framework is available from the CommerceContext.TargetingSystem.TargetingContextProfile property.

See Also

.NET Class Reference

Configuration Services

CommerceContext

Copyright © 2005 Microsoft Corporation.
All rights reserved.