IPuP::Import
For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.
This method is call when Site Packager unpacks a Commerce Server Site Package. In order for your custom resource to make use of one or more files from this package, you must implement this method.
HRESULT Import(
BSTR szSiteName,
BSTR szResourceName,
BSTR szPath,
BOOL bSilent
);
Parameters
szSiteName
[in] A BSTR that contains the name of the site.szResourceName
[in] A BSTR that contains the name of the custom resource.szPath
[in] A BSTR that contains the path where the Site Packager has deposited one or more files packaged for this resource. For more information, see the Remarks section.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.
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
Site Packager calls this method, specifying either a file name or a folder name, based on the value of f_PupFlags column in the Resource table of the Administration database. This bit field column currently has only one bit defined for use: bit 1. If bit 1 is set to zero (0), the szPath parameter specifies a temporary file name, and if bit 1 is set to one (1), the szPath parameter specifies a temporary folder name.
If a file name is specified, this method is expected to retrieve the packaged data from a single file, named as specified by the szPath parameter. Before this method returns, the data must be retrieved from that file, or the file moved to some other location known only to the custom resource. After this method returns, Site Packager will delete the temporary file.
If a folder name is specified, this method is expected to retrieve the packaged data from one or more files, located within the folder specified by the szPath parameter. Before this method returns, the data must be retrieved from these files, or the files moved to some other location known only to the custom resource. After this method returns, Site Packager will delete the temporary files.
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.