CatalogSet Class

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

An abstract class that contains properties and methods used to manage a catalog set in the catalog system.

Namespace:  Microsoft.CommerceServer.CatalogSets
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public MustInherit Class CatalogSet _
    Inherits CatalogObject
'Usage
Dim instance As CatalogSet
public abstract class CatalogSet : CatalogObject
public ref class CatalogSet abstract : public CatalogObject
public abstract class CatalogSet extends CatalogObject

Remarks

The CatalogSet class is an abstract base class which is used to store and manage a catalog set in the catalog system. The CatalogSets are arbitrary collections of catalogs which allow you to present different collections of catalogs to different users and organizations.

The following classes derive from this class:

  • StaticCatalogSet - A catalogset to which product catalogs are explicitly added and removed.

  • DynamicCatalogSet - A catalogset which has an expression associated with it.

Examples

// Creates a static catalog set
internal StaticCatalogSet CreateStaticCatalogSet(string catalogSetName, string description)
{
  try
  {
  // Create a catalog set
  StaticCatalogSet catalogSet = this.catalogSetsContext.CreateStaticCatalogSet(catalogSetName, description);
  catalogSet.Description = "new Description";
  /* Once created product catalogs can be added to the catalog set 
   * catalogSet.AddProductCatalog("catalog1");
   */
  // Finally call save to save the changes to the catalog system
  catalogSet.Save();
  // Iterating the catalogs in the catalog set
  foreach (ProductCatalog productCatalog in catalogSet.IncludedCatalogs)
  {
      Console.WriteLine(productCatalog.Name);
    }
    // Iterating the catalogs not in the catalog set
    foreach (ProductCatalog productCatalog in catalogSet.NotIncludedCatalogs)
    {
      Console.WriteLine(productCatalog.Name);
    }
    return catalogSet;
  }
  catch (EntityAlreadyExistsException ex)
  {
    Console.WriteLine(ex.Message);
    throw;
  }
}

Inheritance Hierarchy

System..::.Object
  Microsoft.CommerceServer.Catalog..::.CatalogObjectBase
    Microsoft.CommerceServer.Catalog..::.CatalogObject
      Microsoft.CommerceServer.CatalogSets..::.CatalogSet
        Microsoft.CommerceServer.CatalogSets..::.DynamicCatalogSet
        Microsoft.CommerceServer.CatalogSets..::.StaticCatalogSet

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

CatalogSet Members

Microsoft.CommerceServer.CatalogSets Namespace