Modifying the Resource Instance Tables

When a new resource is being added for management within Commerce Server Manager it is necessary to add new rows to the ResourceProps, Resources, and SiteResources tables in the Administration database (MSCS_Admin). Taken together, new rows in these tables define a particular instance of a new resource, allowing Commerce Server Manager to display the new resource in the correct location within the scope-pane hierarchy.

These three tables should only be modified using the administration objects GlobalConfig and SiteConfig. Do not modify them directly in SQL Server Enterprise Manager or using SQL scripts.

For more information about the columns of the ResourceProps, Resources, and SiteResources tables, see ResourceProps TableResources Table, and SiteResources Table, respectively.

Depending on whether the new resource is a global resource or a site resource, a different mechanism is used to migrate values already added to the SystemProps and ExtendedProps tables into these three tables.

The Site Status sample in the Commerce Server 2000 Software Development Kit (SDK) includes a file named InstallSiteStatus.vbs. This file provides an example of how the SiteConfig object is used to migrate the table values, resulting in a new resource (and corresponding snap-in extension) appearing within the Site Resources folder of the named site ("Retail" in this example). The following code, modified slightly from how it appears in the file InstallSiteStatus.vbs, shows how to use the SiteConfig object in this way:

sSiteName = "Retail"
sResourceName = "Site Open/Close Applications"

' Initialize the SiteConfig to the selected site.
Dim oSiteCfg
Set oSiteCfg = CreateObject("Commerce.SiteConfig")
oSiteCfg.Initialize sSiteName

' Add the SiteStatus resource to the resource tables.
' Note: The string "MSCS_SDKSiteStatus" must match the
'       corresponding s_ClassName value in the SystemProps table.
oSiteCfg.CreateComponentConfig sResourceName, "MSCS_SDKSiteStatus"
oSiteCfg.Fields(sResourceName).Value.Fields("s_Description") = _
                                            "SDK Site Status Resource"
oSiteCfg.SaveConfig
Set oSiteCfg = Nothing

To add a new resource to the Global Resources within Commerce Server Manager, you only need to change the example as follows (significant changes are shown in bold font):

sResourceName = "Site Open/Close Applications"

' Initialize the GlobalConfig to the selected site.
Dim oGlobalCfg
Set oGlobalCfg = CreateObject("Commerce.GlobalConfig")
oGlobalCfg.Initialize  ' no site name

' Add the SiteStatus resource to the resource tables.
' Note: The string "MSCS_SDKSiteStatus" must match the
'       corresponding s_ClassName value in the SystemProps table.
oGlobalCfg.CreateServiceConfig sResourceName, "MSCS_SDKSiteStatus"
oGlobalCfg.Fields(sResourceName).Value.Fields("s_Description") = \
                                            "SDK Site Status Resource"
oGlobalCfg.SaveConfig
Set oGlobalCfg = Nothing


All rights reserved.