Commerce Foundation User Profile

This Commerce Server 2009 commerce entity stores basic user related information, including the user’s login credentials. 

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="UserProfile">
    <DisplayName value="User Profile">
      <LanguageSpecific value="fr: User Profile" language="fr-CA"/>
    </DisplayName>
    <Description value="Commerce Entity that defines the User Profile">
      <LanguageSpecific value="fr: Commerce Entity that defines the User Profile" 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="UserObject">
        <PropertyMappings>
          <PropertyMapping property="Id" csProperty="GeneralInfo.user_id" />
          <PropertyMapping property="DateCreated" csProperty="ProfileSystem.date_created" />
          <PropertyMapping property="DateModified" csProperty="ProfileSystem.date_last_changed" />
          <PropertyMapping property="ModifiedBy" csProperty="ProfileSystem.user_id_changed_by" />
          <PropertyMapping property="AccountStatus" csProperty="AccountInfo.account_status" />
          <PropertyMapping property="Email" csProperty="GeneralInfo.email_address" />
          <PropertyMapping property="FirstName" csProperty="GeneralInfo.first_name" />
          <PropertyMapping property="LastName" csProperty="GeneralInfo.last_name" />
          <PropertyMapping property="Password" csProperty="GeneralInfo.user_security_password" />
        </PropertyMappings>
      </EntityMapping>
    </EntityMappings>
    <Properties>
      <Property name="Email" dataType="String">
        <DisplayName value="e-mail">
          <LanguageSpecific value="fr-CA: e-mail" language="fr-CA"/>
          <LanguageSpecific value="fr: e-mail" language="fr"/>
        </DisplayName>
        <Description value="User's e-mail address">
          <LanguageSpecific value="fr-CA: User's e-mail address" language="fr-CA"/>
          <LanguageSpecific value="fr: User's e-mail address" language="fr"/>
        </Description>
        <Constraints>
          <RequiredProperty>
        <Message value="E-mail address is required">
          <LanguageSpecific value="fr: E-mail address is required" language="fr-CA"/>
        </Message>
          </RequiredProperty>
          <RegularExpression>
        <Message value="E-mail address must follow the format somthing@someserver.com | firstname.lastname@mailserver.domain.com | username-something@some-server.">
          <LanguageSpecific value="fr: E-mail address must follow the format somthing@someserver.com | firstname.lastname@mailserver.domain.com | username-something@some-server." language="fr-CA"/>
        </Message>
        <Pattern value="^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$"  />
          </RegularExpression>
        </Constraints>
      </Property>
      <Property name="AccountStatus" dataType="Integer" isMultilingual="true">
        <DisplayName value="Account Status">
          <LanguageSpecific value="fr: Account Status" language="fr-CA"/>
        </DisplayName>
        <Description value="Account Status">
          <LanguageSpecific value="fr: Account Status" language="fr-CA"/>
        </Description>
        <DefaultValue value="1" />
        <EnumeratedValues>
          <EnumerationEntry value="0" >
        <DisplayName value="Inactive Account">
          <LanguageSpecific value="fr: Inactive Account" language="fr-CA"/>
        </DisplayName>
          </EnumerationEntry>
          <EnumerationEntry value="1" >
        <DisplayName value="Active Account">
          <LanguageSpecific value="fr: Active Account" language="fr-CA"/>
        </DisplayName>
          </EnumerationEntry>
          <EnumerationEntry value="2" >
        <DisplayName value="Requires Approval">
          <LanguageSpecific value="fr: Requires Approval" language="fr-CA"/>
        </DisplayName>
          </EnumerationEntry>
        </EnumeratedValues>
      </Property>
    </Properties>
    <Relationships>
      <Relationship name="Addresses" type="Relationship" modelName="Address" isMultipleItems="true">
        <DisplayName value="Addresses">
          <LanguageSpecific value="fr: Addresses" language="fr-CA"/>
        </DisplayName>
        <Description value="User's Addresses">
          <LanguageSpecific value="fr: User's Addresses" language="fr-CA"/>
        </Description>
      </Relationship>
      <Relationship name="CreditCards" type="Relationship" modelName="CreditCard" isMultipleItems="true" >
        <DisplayName value="Credit Cards">
          <LanguageSpecific value="fr: Credit Cards" language="fr-CA"/>
        </DisplayName>
        <Description value="User's Credit Cards">
          <LanguageSpecific value="fr: User's Credit Cards" language="fr-CA"/>
        </Description>
      </Relationship>
      <Relationship name="OrderHistory" type="Relationship" modelName="Basket" isMultipleItems="true" >
        <DisplayName value="Order History">
          <LanguageSpecific value="fr: Order History" language="fr-CA"/>
        </DisplayName>
        <Description value="User's Order History">
          <LanguageSpecific value="fr: User's Order History" language="fr-CA"/>
        </Description>
      </Relationship>
    </Relationships>
</CommerceEntity>

Properties

Property

Type

Description

AccountStatus

String

Indicates the status of this account. This will be an element defined in the SiteTerm by the same name.

DefaultShopperList

String

The Id of the default shopping list for this user.

DirectMailOptOut

bool?

A value indicating whether the user wishes to opt out of direct mail advertising campaigns.

Email

String

Specifies the e-mail address of the user.

FirstName

String

Specifies the first name of the user.

GeneralInfo.password_answer

String

The answer to the security question. The value of this property is hashed for security purposes. To validate the answer entered by the user, the ASP.NET Membership.ResetPassword should be used.

GeneralInfo.password_question

String

The security question that will be presented to the user when requesting a password reset.

LastDatePasswordCahgned

DateTime?

The date/time at which this user's password was last changed.

LastName

String

Specifies the last name of the user.

Password

String

Specifies the password for the user.

Dd451552.alert_note(en-US,CS.90).gifNote:
The service will never return this value during a query. You cannot update it through an Update operation. the ChangePassword commerce entity handles changing the password.

LiveID

String

Gets or sets the user's unique identifier for Windows Live ID.

Id

String

Specifies the unique ID of the user.

DateCreated

DateTime?

Indicates the date/time that this record was created.

DateModified

DateTime?

Indicates the date/time that this record was last modified.

ModifiedBy

String

Indicates the user that last changed this record.

ShouldChangePassword

bool?

A value indicating whether the user's password should be changed.

Relationships

Property

Description

Addresses

Relationship list that contains the Address commerce entities for this user.

CreditCards

Relationship list that contains the CreditCard commerce entities for this user.

PreferredAddress

The preferred address for this user.

PreferredCreditCard

The preferred credit card for this user.

PreferredShippingMethod

The preferred shipping method for this user.

OrderHistory

Relationship list that contains the order history for this user.

Supported Operations

The User Profile commerce entity supports the following operations:

Commerce Foundation UserProfile CommerceCreate

Commerce Foundation UserProfile CommerceDelete

Commerce Foundation UserProfile CommerceQuery

Commerce Foundation UserProfile CommerceUpdate

See Also

Other Resources

Developing with the Commerce Foundation Profiles System

Commerce Foundation UserProfile CommerceCreate

Commerce Foundation UserProfile CommerceDelete

Commerce Foundation UserProfile CommerceQuery

Commerce Foundation UserProfile CommerceUpdate