IPuP::CreateGroupResource
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
If your custom resource is a global resource, you must implement this method. Since the packaged site is, by definition, using your global resource, the site must be provided with a site-level object that refers to your global resource. This method must perform the necessary processing.
When the f_ResourceFlags column indicates a global resource (the corresponding bit mask constant is IS_REFTOGROUPRES), this method is called before the Import method is called. This method is not called for site resources.
Site Packager will call this method, indicating the site name and the name of the custom resource, as it is known at the site level. Your implementation must create the global resource, and then return its name. Site Packager can then create the link between the site-level representation of the global resource, and the actual global resource. Then Site Packager will call the Import method to import any data associated with the custom global resource.
HRESULT CreateGroupResource(
BSTR szSiteName,
BSTR szResourceName,
BSTR szConnStr,
BSTR szPath,
BOOL bSilent,
BSTR* szGroupResourceName
);
Parameters
szSiteName
[in] A BSTR that contains the name of the site being unpacked.szResourceName
[in] A BSTR that contains the name of the custom resource.szConnStr
[in] A BSTR that contains the connection string.szPath
[in] A BSTR that contains the path and name of a file for error logging.bSilent
[in] A BOOLEAN value used to indicate whether any user interaction is allowed. A value of TRUE suppresses user interaction, allowing for unattended operation.szGroupResourceName
[out, retval] A pointer to a BSTR to be used to return the name of the corresponding global resource.
Return Value
This method must return an HRESULT indicating whether it completed successfully. See the Error Values section for more details.
Error Values
This method must return S_OK (0x00000000) to indicate success and a COM HRESULT error value to indicate failure. For more information about the standard COM error values that can be used, see Standard COM Errors. Additional information may be made available using the global Err object, which can be accessed by the caller using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface can be called to retrieve a text description of the error, which you can supply.
Remarks
If this method is designed to allow user interaction, the user interface used to accomplish this interaction must be capable of being suppressed. The bSilent parameter is used to indicate whether such suppression should occur. If the bSilent parameter is set to TRUE the user interface must be suppressed. If the bSilent parameter is set to FALSE, it is permissible to display the user interface and seek user interaction. This aspect of the method invocation allows for unattended operation.
The connection string includes the Data Source Name (DSN), the database login ID, and the database password for the database used by this resource. Any custom database tables must be created by the implementation of this method. Since the resource may be sharing the database with other resources, unique table names should be chosen.