Export (0) Print
Expand All
Expand Minimize

CSFLoadAdvertisements

Commerce Server 2002

Use this component with the CacheManager object to load advertising content from a database.

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

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

Configuration Values

The following table describes the CSFLoadAdvertisements configuration values.

BoxDescription
ConnectionStringThe connection string for the campaigns database.
QueryThe SQL query used to populate the cache of advertisements. 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 CSFContext dictionary.

Values Read

None.

Values Written

None.

Remarks

You can use the CSFLoadAdvertisements component with the CacheManager object to load advertising content for use later in your application.

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

The CSFLoadAdvertisements component first opens a connection to the database and gets the list of ads. The component uses a ContentListFactory object to populate a ContentList object with the data. The component then breaks the retrieved data into templates, target groups, and page groups.

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

Column NameTypeFlags
ad_typeshort (CLCOL_I2)1 (CLCOL_READONLY)
ad_weightInt (CLCOL_I4)1 (CLCOL_READONLY)
campaign_idInt (CLCOL_I4)1 (CLCOL_READONLY)
customer_idInt (CLCOL_I4)1 (CLCOL_READONLY)
date_enddate/time (CLCOL_DATE)1 (CLCOL_READONLY)
date_startdate/time (CLCOL_DATE)1 (CLCOL_READONLY)
days_of_weekshort (CLCOL_I2)1 (CLCOL_READONLY)
eff_date_startdate/time (CLCOL_DATE)1 (CLCOL_READONLY)
event_nameString (CLCOL_STRING)1 (CLCOL_READONLY)
events_scheduledInt (CLCOL_I4)1 (CLCOL_READONLY)
events_servedInt (CLCOL_I4)1 (CLCOL_READONLY)
exposure_limitInt (CLCOL_I4)1 (CLCOL_READONLY)
Heightshort (CLCOL_I2)1 (CLCOL_READONLY)
IndustryString (CLCOL_STRING)1 (CLCOL_READONLY)
invalid_nodBoolean (CLCOL_BOOL)0 (DEFAULT)
item_idInt (CLCOL_I4)1 (CLCOL_READONLY)
NameString (CLCOL_STRING)1 (CLCOL_READONLY)
need_of_deliveryreal (CLCOL_R4)0 (DEFAULT)
prev_events_servedInt (CLCOL_I4)1 (CLCOL_READONLY)
Scorereal (CLCOL_R4)6 (CLCOL_PRIVATE | CLCOL_SCORE_COLUMN)
SizeString (CLCOL_STRING)1 (CLCOL_READONLY)
target_groupsSafeArray (CLCOL_VARIANTARRAY)1 (CLCOL_READONLY)
TemplateString (CLCOL_STRING)1 (CLCOL_READONLY)
time_of_day_endshort (CLCOL_I2)1 (CLCOL_READONLY)
time_of_day_startshort (CLCOL_I2)1 (CLCOL_READONLY)
ValuesIDispatch (CLCOL_DISPATCH)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 for ContentListSchema.ColumnType.

If necessary, you can add additional custom fields into the ContentListFactory cache by overriding the default query for CSFLoadadvertisements. 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 GetAdQuery
        set oLoad = CreateObject("Commerce.CSFLoadAdvertisements")
        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, since 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.

Example

See the example in CacheManager Object.

Copyright © 2005 Microsoft Corporation.
All rights reserved.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft