This documentation is archived and is not being maintained.


Commerce Server 2002

Use this component with the CacheManager object to load discounts for the Content Selection Framework.

Ee783916.note(en-US,CS.20).gif Note

  • Although the CSFLoadDiscounts component implements two pipeline component interfaces (IPipelineComponent and IPipelineComponentAdmin), it is not a pipeline component, it does not appear in the Pipeline Editor, and cannot be used or configured in the Pipeline Editor.

Configuration Values

The following table describes the CSFLoadDiscounts configuration values.

ConnectionStringThe connection string for the campaigns database.
QueryThe SQL query used to populate the cache of discounts. Reading this property returns the default query unless it has been overridden with a custom query.
RedirectUrlIf specified, Commerce Server writes this value into the Cache dictionary unchanged.

You do not need to set RedirectUrl in Commerce Server 2002, as Commerce Server 2002 takes the value for RedirectUrl from the Cache dictionary.

Values Read


Values Written



You can use the CSFLoadDiscounts component with the CacheManager object to load discounts for use later in your application.

When run by the CacheManager object, the CSFLoadDiscounts component uses two pipeline dictionaries (Order and Context) to determine how to run and how to return information to the CacheManager object.

The CSFLoadDiscounts component first opens a connection to the database and gets the list of discounts. The component uses a ContentListFactory object to populate a ContentList object with the data. The component then extracts templates, target groups, and page groups from the retrieved information.

The following table describes the columns in the ContentList object returned by the CSFLoadDiscounts component. Column names appear in alphabetical order.

Column NameTypeFlags
award_exprint (CLCOL_I4)1 (CLCOL_READONLY)
award_maxint (CLCOL_I4)1 (CLCOL_READONLY)
campaign_idint (CLCOL_I4)1 (CLCOL_READONLY)
click_requiredBoolean (CLCOL_BOOL)1 (CLCOL_READONLY)
condition_basisint (CLCOL_I4)1 (CLCOL_READONLY)
condition_exprint (CLCOL_I4)1 (CLCOL_READONLY)
condition_mny_minCurrency (CLCOL_CY)1 (CLCOL_READONLY)
condition_qty_minint (CLCOL_I4)1 (CLCOL_READONLY)
date_enddate/time (CLCOL_DATE)1 (CLCOL_READONLY)
date_modifieddate/time (CLCOL_DATE)1 (CLCOL_READONLY)
date_startdate/time (CLCOL_DATE)1 (CLCOL_READONLY)
descriptionString (CLCOL_STRING)1 (CLCOL_READONLY)
disc_idint (CLCOL_I4)1 (CLCOL_READONLY)
disjointBoolean (CLCOL_BOOL)1 (CLCOL_READONLY)
exposure_limitint (CLCOL_I4)1 (CLCOL_READONLY)
expressions_used_for_displayBoolean (CLCOL_BOOL)1 (CLCOL_READONLY)
heightshort (CLCOL_I2)1 (CLCOL_READONLY)
item_idint (CLCOL_I4)1 (CLCOL_READONLY)
offer_typeint (CLCOL_I4)1 (CLCOL_READONLY)
offer_valueCurrency (CLCOL_CY)1 (CLCOL_READONLY)
order_levelBoolean (CLCOL_BOOL)1 (CLCOL_READONLY)
special_offer_typeString (CLCOL_STRING)1 (CLCOL_READONLY)
widthshort (CLCOL_I2)1 (CLCOL_READONLY)

Abbreviations in the table are enumerated values for the ContentList object. For more information, see the Remarks section in ContentListSchema.ColumnType.

If necessary, you can add additional custom fields into the ContentListFactory cache by overriding the default query for CSFLoadDiscounts. Overriding the query is an advanced programming technique, and requires that you have detailed knowledge of SQL queries. Because the default query for CSFLoadAdvertisements is large and complex, you should use the following steps to avoid accidential changes to the query.

To modify the SQL query for CSFLoadAdvertisements

  1. In Visual Studio .NET, query the component for the default SQL query. The following code describes how to query a component for the default SQL query:
    function GetDiscountQuery
        set oLoad = CreateObject("Commerce.CSFLoadDiscounts")
        set dictConfig = oLoad.GetConfigData()
        GetAdQuery = dictConfig.Query
    end function
  2. Save the query to a file.
  3. Modify the saved copy of the query.

    You can add columns to the query. However, you should not remove existing columns, as removing existing columns may cause the advertising selection pipeline to fail. The query also contains placeholder strings such as "?" and "##GUIDGUIDGUIDGUIDGUIDGUIDGUIDGUIDGUID", which you should not alter or remove.

  4. Load the modified query from the file to the component at runtime. One way to load the query would be to use the Scripting.FileSystemObject object.
  5. Use the SetConfigData method from IPipelineComponentAdmin to set the new query property.


See the example in CacheManager Object.

Copyright © 2005 Microsoft Corporation.
All rights reserved.