Share via


Commerce Foundation TargetingContext

This Commerce Server 2009 commerce entity represents the profile of the same name in Commerce Server. Its purpose is to provide general information about the current site context to the Content Selection Framework (CSF). Unlike most commerce entities in Microsoft Multi-Channel Commerce Foundation, it only has meaning in the context of a model-based search. It cannot be retrieved; you can only use it to provide query information. In the base implementation, this commerce entity contains no strongly-typed members—it exists for the purposes of customization.

This commerce entity is open for extensibility, as it is common practice to extend the TargetingContext profile to supply additional information to the CSF. To simplify extensibility, the API maps all weakly-typed properties to the Commerce Server TargetingContext profile properties. In order for this automatic mapping to work, the weakly typed property name must be the same as the Commerce Server TargetingContext profile property name. If a weakly typed property exists that does not map to a Commerce Server profile property, the system will ignore the property allowing the pipeline execution to continue rather than throw an exception.

Model

This commerce entity can be modified, as required. This model, taken from the out-of-the-box site, is provided as an example.

<CommerceEntity name="TargetingContext">
    <DisplayName value="TargetingContext">
      <LanguageSpecific value="fr: TargetingContext" language="fr-CA"/>
    </DisplayName>
    <Description value="Targeting Context">
      <LanguageSpecific value="fr: Targeting Context" language="fr-CA"/>
    </Description>
      <EntityMappings>
         <EntityMapping csType="Microsoft.CommerceServer.Runtime.Profiles.Profile"  csAssembly="Microsoft.CommerceServer.Runtime, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"  csDefinitionName="TargetingContext"  csArea="Profiles">
        <PropertyMappings>
          <PropertyMapping property="Id" csProperty="unique_id"/>
          <PropertyMapping property="PageGroup" csProperty="pagegroup"/>
        </PropertyMappings>
         </EntityMapping>
      </EntityMappings>
      <Properties>
         <Property name="Id" dataType="String" />
         <Property name="PageGroup" dataType="String" />
      </Properties>
</CommerceEntity>

Properties

Property

Type

Description

Channel

String

The name of the channel being targeted.

Id

String

Unique ID for this targeting context.

PageGroup

String

The ID of the page group of the page that was the source of the event.

Relationships

None.

Supported Operations

Commerce Foundation ContentSelector CommerceQuery

Commerce Foundation ContentSelectorCollection CommerceQuery

Commerce Foundation Basket CommerceQuery

Commerce Foundation Basket CommerceUpdate

See Also

Other Resources

Developing with the Commerce Foundation Marketing System