다음을 통해 공유


Defining the Schema for a Custom Resource

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

When a custom resource is added for management in Commerce Server Manager you must add new rows to the SystemProps and ExtendedProps tables in the Administration database (MSCS_Admin). New rows in the SystemProps table correspond to new resources. The columns in this table define the properties that are common to all resources.

New rows in the ExtendedProps table correspond to custom properties associated with the new resource. Columns in this table define the characteristics of custom properties associated with Commerce Server resources.

Call the Commerce Server stored procedure proc_insert_system_property to insert a new row into the SystemProps table to create the schema of a new type of resource. For example:

EXEC proc_insert_system_property
  @name               = N'',
  @className          = N'SampleClass',
  @resourceType       = N'SampleResourceType',
  @description        = N'Sample Resource',
  @resourceFlags      = 2,
  @pupFlags           = 0,
  @progidPUP          = N'Commerce.SamplePup'
GO

For more information about the columns of the SystemProps table, see SystemProps Table.

Call the Commerce Server stored procedure proc_insert_extended_property to insert a new row into the ExtendedProps table. The new row will define the schema of a new custom property to be associated with a new custom resource. For example:

EXEC proc_insert_extended_property
    @resourceType         = N'SampleResourceType',
    @propertyName         = N'connstr_db_SampleResource',
    @isConnectionString   = 1,
    @isHidden             = 0,
    @isSimpleList         = 0,
    @description          = N'Connection string for sample resource',
    @varType              = 8,
    @value                = N'',
    @displayName          = N'Sample resouce connection string'
GO

For more information about the columns of the ExtendedProps table, see ExtendedProps Table.

Bb219197.alert_caution(en-US,CS.70).gifImportant Note:

In these examples, the value "SampleResourceType" is assigned to the s_ResourceType column in both the SystemProps and ExtendedProps tables by using the resourceType parameter to the stored procedures. This value being the same in both tables is what ties the custom property that was defined in the latter table to the custom resource defined in the former table. If you define more than one custom property for your new custom resource, you must make sure that the resource type value of each custom property matches the resource type that you defined for your new custom resource.

See Also

Other Resources

SystemProps Table

ExtendedProps Table

Creating an Instance of a Custom Resource

Adding a Custom Resource