Member component message mapper configuration
The member component uses the message mapper infrastructure to determine which WebSphere Commerce command to call based on the request BOD. The message mapper infrastructure provides a way to flatten the values in the SDO noun into name-value pairs that the WebSphere Commerce command can process.
The message mapper configuration is in the following directory:
Person
- workspace_dir/WC/xml/messaging/component-services/PersonBODMapping.xml
Organization
- workspace_dir/WC/xml/messaging/component-services/OrganizationBODMapping.xml
If define our own mapping information, use the following file:
- workspace_dir/WC/xml/messaging/component-services/component-services-user-template.xml
Message flattener
In contrast with the database, nouns do not use abbreviations. For example, in the database, gender is stored as a single character: M (Male), F (Female) or N (Unspecified). In the Person noun, gender is a fixed enumeration type, with the following values: Male, Female, Unspecified. If the Service data object has a long-form, and the WebSphere Commerce command expects a short value, a message flattener class is called to convert between the external and internal values. This flattener is also used to add any missing parameter values required by the command. For example, when calling MemberFacadeClient.updateAddressForOrganization(), the underlying command requires the addressId parameter. If this is not provided as an input to the method, then the message flattener class, ECSAXOrgAddressComponentMessageFlattener, will derive and add addressId parameter to the requestProperties of the command based on the distinguishedName and nickName parameters.
Example
ECSAXUserRegistrationComponentMessageFlattener.java is called during the Process Person request, with action of Register.
/** * Processes parameter values that are going to be sent to a command to ensure that they are in a format * that the command can handle. * * 1. Converts parameters like addressType from long form (Shipping) to short form (S) * 2. Appends userId parameter if logonId is specified. * 3. Appends logonPasswordVerify parameter (with same value as logonPassword) * if logonPasswordVerify value does not exist. * 4. Extracts custom member attributes and formats as follows: * attributeName_storeName_action_number=value * 5. Converts boolean parameters to 1 or 0. */
The mapping between external and internal values (step 1 in the preceding example), is defined in the workspace_dir/WC/xml/config/com.ibm.commerce.member/wc-component.xml as shown in the following snippet.
<_wcf:valuemapping externalName="AddressType" internalName="AddressType"> <!-- Maps to ADDRESS.ADDRESSTYPE in database --> <_wcf:valuemap externalValue="Shipping" internalValue="S" /> <_wcf:valuemap externalValue="Billing" internalValue="B" /> <_wcf:valuemap externalValue="ShippingAndBilling" internalValue="SB" /> </_wcf:valuemapping>
Customizations to the default mapping should be made in the following file:
workspace_dir/WC/xml/config/com.ibm.commerce.member-ext\wc-component.xml
Related reference
Member services