Microsoft.Protocols.TestSuites.MS_SITESS.MS_SITESSAdapter.ExportWeb C# (CSharp) Méthode

ExportWeb() public méthode

This operation is used to export the content related to a site into one or more content migration package files.
public ExportWeb ( string jobName, string webUrl, string dataPath, bool includeSubwebs, bool includeUserSecurity, bool overWrite, int cabSize ) : int
jobName string Specifies the operation.
webUrl string The URL of the site to export.
dataPath string The full path of the location on the server where the content migration package file(s) are saved.
includeSubwebs bool Specifies whether to include the subsite.
includeUserSecurity bool Specifies whether to include access control list (ACL), security group and membership group information.
overWrite bool Specifies whether to overwrite the content migration package file(s) if they exist.
cabSize int Indicates the suggested size in megabytes for the content migration package file(s).
Résultat int
        public int ExportWeb(string jobName, string webUrl, string dataPath, bool includeSubwebs, bool includeUserSecurity, bool overWrite, int cabSize)
        {
            // Check whether ExportWeb operation succeeds.
            int exportWebResult = 0;
            string exportUrl = webUrl;
            string sutComputerName = Common.GetConfigurationPropertyValue(Constants.SutComputerName, this.Site);

            // The server name in this URL must be in lowercase as specified in the Open Specification section 3.1.4.2.2.1.
            exportUrl = exportUrl.Replace(sutComputerName, sutComputerName.ToLower(System.Globalization.CultureInfo.CurrentCulture));

            // SharePoint services 2007 returns an error indicates the URL is not accessible if the transport portion is not in lowercase.
            if (exportUrl.StartsWith("HTTP:", StringComparison.CurrentCultureIgnoreCase))
            {
                exportUrl = exportUrl.Substring(5);
                exportUrl = "http:" + exportUrl;
            }
            else if (exportUrl.StartsWith("HTTPS:", StringComparison.CurrentCultureIgnoreCase))
            {
                exportUrl = exportUrl.Substring(6);
                exportUrl = "https:" + exportUrl;
            }

            exportWebResult = this.service.ExportWeb(jobName, exportUrl, dataPath, includeSubwebs, includeUserSecurity, overWrite, cabSize);

            // Verify the ExportWebResponse structure.
            this.VerifyExportWeb(exportWebResult);
            return exportWebResult;
        }