Partager via


Commerce Foundation Metadata API Reference

This is the Microsoft Multi-Channel Commerce Foundation metadata CommerceQuery operation.

CommerceQuery<CommerceEntityDefinition, CommerceModelSearch<T>>

Request

This operation is used to retrieve metadata associated with a specific Microsoft Multi-Channel Commerce Foundation CommerceEntity. This operation supports the CommerceModelSearch criteria mechanism only. The CommerceModelSearch<T> only requires the type parameter to be specified. Nothing else within the search criteria is supported. Any search criteria parameters provided for this query, such as FirstItemIndex, NumberOfItemsToReturn, and SortProperties are ignored.

The type parameter T specified for the CommerceModelSearch<T> has the following effect:

  • If the T is the CommerceEntity class, then the query will return the metadata for all the Commerce Entity classes listed in the Metadata Repository. In this case the metadata query cannot contain related operation queries either for the CommercePropertyDefinition or the CommerceRelationshipDefinition.

  • If the T is any class registered in the Metadata Repository (other than the CommerceEntity class), then the query only returns the metadata for the specified class. When CommerceEntity is specified all the related operation queries are supported.

  • If the T is a class that is not registered in the Metadata Repository the system will throw a Microsoft.Commerce.Providers.Metadata.MetadataException.

Exceptions

A Microsoft.Commerce.Contracts.Faults.GeneralOperationFault exception may be thrown by the Microsoft Multi-Channel Commerce Foundation service during the processing of the metadata query operation, which may contain one of the following exceptions:

Exception

Cause

OperationNotSupportedException

  • If the Query model type is anything but the CommerceEntityDefinition class.

  • If the search criteria is not of the CommerceModelSearch type.

  • If the search criteria's model is not specified.

  • If the CommerceModelSearch<CommerceEntity> is used and the metadata query contains related operation queries for either the CommercePropertyDefinition or the RelationsipDefinition.

MetadataException

  • If the metadata query is issued for a Commerce Entity class that is not registered in the Metadata Repository.

  • If the Commerce Entity maps to more than one Commerce Server types, but the query does not contain CommerceServerArea value or contains an incorrect value.

  • If the Metadata Repository file is corrupted.

Operation Sequences

Operation Sequence Component

Description

RepositoryMetadataLoader

Loads the metadata definitions from the Metadata Repository and adds them to the query operation cache.

CatalogMetadataLoader

This class is responsible for adding the Catalog metadata to the Commerce Server metadata collection cached in the query operation cache.

ProfilesMetadataLoader

This class is responsible for adding the Profiles metadata to the Commerce Server metadata collection cached in the query operation cache.

OrdersMetadataLoader

This class is responsible for adding the Orders metadata to the Commerce Server metadata collection cached in the query operation cache.

MergedMetadataLoader

This class is responsible for merging the Repository and the Commerce Server Core System metadata and adding it to the query operation cache.

MetadataQueryProcessor

This class is responsible for processing the Microsoft Multi-Channel Commerce Foundation metadata queries.

SPListMetadataLoader

Loads the metadata related to SharePoint Lists.

Dd328457.alert_note(en-US,CS.90).gifNote:
This operation sequence component is only required when SharePoint Lists are being queried.

Related Operation

Description

CommerceQueryRelatedItem<EntityMapping>

Used to retrieve the entity mapping relationship to the CommerceEntityDefinition. This operation supports the CommerceModelSearch criteria mechanism only. The only valid property that can be specified in the search model is CommerceServerArea. It is required for the queries for the Commerce Entities that map to more than one Commerce Server types. Otherwise it is ignored.

CommerceQueryRelatedItem<DefinitionMapping>

Used to retrieve the definition mapping relationship to the EntityMapping. This operation supports the CommerceModelSearch criteria mechanism only. The only valid property that can be specified in the search model is DefinitionName. If no DefinitionName is provided in the search model then all definitions are returned. Otherwise only the requested definition will be returned.

CommerceQueryRelatedItem<CommercePropertyDefinition>

Used to retrieve the property definition relationship to the CommerceEntityDefinition or to the RelationshipTypeDefinition. The search criteria is ignored for this related query. This related query is not allowed for the metadata queries that retrieve the metadata for all the Microsoft Multi-Channel Commerce Foundation Commerce Entities - those that are specified as: CommerceQuery<CommerceEntityDefinition, CommerceModelSearch<CommerceEntity>>

CommerceQueryRelatedItem<EnumerationEntry>

Used to retrieve the enumeration entries relationship to the CommercePropertyDefinition. The search criteria is ignored for this related query.

CommerceQueryRelatedItem<ConstraintBase>

Used to retrieve the constraints relationship to the CommercePropertyDefinition. The search criteria is ignored for this related query.

CommerceQueryRelatedItem<CommerceRelationshipDefinition>

Used to retrieve the relationship definition relationship to the CommerceEntityDefinition. The search criteria is ignored for this related query. This related query is not allowed for the metadata queries that retrieve the metadata for all the Microsoft Multi-Channel Commerce Foundation Commerce Entities - those that are specified as: CommerceQuery<CommerceEntityDefinition, CommerceModelSearch<CommerceEntity>>

CommerceQueryRelatedItem<RelationshipTypeDefinition>

Used to retrieve the relationship type definition relationship to the CommerceRelationshipDefinition. The search criteria is ignored for this related query.

See Also

Other Resources

Working with Metadata in Commerce Foundation

Commerce Foundation Metadata

Commerce Foundation Property Metadata

Managing and Manipulating Metadata in Commerce Foundation

Commerce Foundation Metadata Flow Through Rules

Commerce Foundation Metadata Repository Design