Поделиться через


messageManager Element

The messageManager element maps the resources required by the Order Processing pipeline (OPP) from a satellite assembly to the MessageManager object. You must specify the following:

  • Each language that you want to load into the MessageManager object in this configuration section.

  • Each individual resource identifier that you want to map from the .resx file to the MessageManager object.

You use the baseName attribute to specify the root name of the resources. For example, the root name for the resource file named "MyResource.en-US.resources" is "MyResource". You use the assembly attribute to specify the name of the assembly containing the localized resources.

For more information about message handling in the Commerce Server .NET Application Framework, see How to Use MessageManager.

The messageManager element contains the cultures and resources elements.

cultures Element

This element specifies a new Content Selection Application.

The following table lists and describes the attributes of the cultures element. This element is required.

Attribute

Data Type

Description

default

String

The MessageManager object default culture. This is the culture used when the OPP cannot locate a resource specific to the selected culture. The format of this string is identical to the "specific culture" format that the .NET Framework uses, which is the following:

neutral_culture-specific_culture

For example, the language for U.S. English is "en-US".

This attribute is required.

baseName

String

The type of the resource name.

To obtain the base name of your satellite assemblies, use one of the following methods:

  • If you are building the satellite assemblies by using the Microsoft Assembly Linker, then the base name will be the name of your resource file. For example, if you create a resource file named "MessageManagerResources.en-US.resources", then the base name will be "MessageManagerResources".

  • If you are using Visual Studio 2005 or Visual Studio 2008 to build your satellite assemblies, then perform the following steps to get the base name:

    1. Click Start, point to Programs, point to Microsoft Visual Studio 2005 or Visual Studio 2008, point to Visual Studio 2005 or Visual Studio 2008 Tools, and then click Visual Studio 2005 or Visual Studio 2008 Command Prompt.

    2. In the Visual Studio 2005 or Visual Studio 2008 Command Prompt window, type "ildasm <satellite assembly>.resources.dll".

    3. Click MANIFEST.

    You will see a section that looks like the following:

    .mresource public 'BaseName.en-US.resources'

    For example, if you see the section

    'CommerceWebApplication.MessageManagerResources.en-US.resources'

    then CommerceWebApplication.MessageManagerResources is the base name for your satellite assembly, and you must use this to edit the Web.config file.

    This attribute is required.

assembly

String

The name of the satellite assembly that contains the resources.

This attribute is required.

culture Element

The culture element specifies an instance of a culture that you want mapped into the MessageManager.

The following table lists and describes the attributes of the culture element. This element is required.

Attribute

Data Type

Description

id

String

Culture ID for this culture. The format of this string is identical to the specific culture format that the .NET Framework uses:

neutral_culture-specific_culture

For example, the language for U.S. English is "en-US".

This attribute is required.

resources Element

The resources element is a container for the resources that you intend to map from the .resx file into the MessageManager object.

The resources element has no attributes. This element is required.

resource Element

The resource element specifies a specific resource that you intend to map from the .resx file to the MessageManager object.

The following table lists and describes the attributes of the resource element. This element is optional.

Attribute

Data Type

Description

Id

String

Identifier assigned to the resource in the .resx file.

This attribute is required.

Example

<messageManager siteName="CSharpSite">
  <cultures 
     default="en-US" 
     baseName="CommerceMessageManager"
     assembly="CommerceMessageManager">
    <culture id="en-US"/>
    <culture id="fr-fr"/>
    <culture id="ja-JP"/>
    <culture id="de-DE"/>
  </cultures>
  <resources>
    <resource id="pur_badsku"/>
    <resource id="pur_badplacedprice"/>
    <resource id="pur_discount_changed"/>
    <resource id="pur_discount_removed"/>
  </resources>
</messageManager>

See Also

Other Resources

Web.Config Configuration Settings

How to Use MessageManager