Compartilhar via


GetCatalogsForUser Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

Returns a collection of the catalogs for the current user.

Namespace:  Microsoft.CommerceServer.Runtime
Assembly:  Microsoft.CommerceServer.Runtime (in Microsoft.CommerceServer.Runtime.dll)

Syntax

'Declaration
Public Function GetCatalogsForUser As ReadOnlyStringCollection
'Usage
Dim instance As CommerceContext
Dim returnValue As ReadOnlyStringCollection

returnValue = instance.GetCatalogsForUser()
public ReadOnlyStringCollection GetCatalogsForUser()
public:
ReadOnlyStringCollection^ GetCatalogsForUser()
public function GetCatalogsForUser() : ReadOnlyStringCollection

Return Value

Type: Microsoft.CommerceServer.Runtime..::.ReadOnlyStringCollection
A collection of catalogs that are shown to a given user.

Exceptions

Exception Condition
CommerceException

The operation failed.

Remarks

GetCatalogsForUser reads the UserProfile property to access the current user's profile. This is a smart property that is set automatically if the Commerce Server authentication system is used for the application and the current user is authenticated. This property may alternatively be set by the application before calling the GetCatalogsForUser method. If the user profile object exists and the profile has a non-empty value for the AccountInfo.user_catalog_set, then the specified catalog set is returned.

If the user profile object exists but AccountInfo.user_catalog_set property does not contain a value, the OrganizationProfile property is used. If the profile exists, the GeneralInfo.org_catalog_set property is accessed and, If it contains a non-empty value, the specific catalog set is returned.

If the catalog set is given neither by the user profile or organization profile, the catalog set is assigned either by the configured default authenticated catalog set or the default anonymous catalog set, depending on whether or not the user is authenticated (as determined by querying the IsAuthenticated method of the AuthenticationInfo property).

The property names for the user catalog set and organization catalog set can be changed through configuration settings (refer to the profiles configuration reference section).

The user catalog set and organization catalog set properties must contain a GUID that is the ID of the catalog set.

The default authenticated catalog set and default anonymous catalog sets are specified through configuration settings (refer to the catalog configuration reference section).

Permissions

See Also

Reference

CommerceContext Class

CommerceContext Members

Microsoft.CommerceServer.Runtime Namespace