Share via


Importing Data from the Package

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

You can develop a custom resource in such a way that it can include arbitrary data, in the form of one or more files, in a site package and have those files unpacked on a different computer. In order for this arbitrary set of files to be retrieved from a site package, a custom resource must include a Component Object Model (COM) object that implements the Import method of the IPuP interface. Commerce Server Site Packager calls this method, providing the name of a temporary file or folder where the Commerce Server Site Packager has put the file(s) to be unpacked. The Import method must do something with this file or files before it returns, such as moving them to another location or moving their contents into a database. Once the Import method returns, Commerce Server Site Packager will delete the file (or files) from the temporary location.

You must set the appropriate s_ProgidSnapIn value in the SystemProps table in the Administration database to the ProgID of the object that implements the IPuP interface. The ProgID is also added to the s_ProgIDSnapIn column of the Resources table when the SiteConfigFreeThreaded object is used to migrate configuration values. When Commerce Server Site Packager encounters this ProgID while unpacking the site, it will instantiate the corresponding object and call the Import method of its IPuP interface.

For more information about the Import method, see IPuP::Import.

If the custom resource being unpacked is a site-level reference to a global resource, the Commerce Server Site Packager will call the CreateGroupResource method of the same IPuP interface before it calls the Import method. This will enable the custom resource to create the global resource and return its name so that the site-level reference can refer to it. For more information about the CreateGroupResource method, see IPuP::CreateGroupResource.

See Also

Other Resources

Exporting Data to the Package

Packaging Other Data