/// <summary>
        /// Member to create a site collection
        /// </summary>
        /// <param name="siteRequest">The SiteRequest</param>
        /// <param name="template">The Template</param>
        public void CreateSiteCollection(SiteInformation siteRequest, Template template)
        {
            _siteprovisioningService.Authentication = new AppOnlyAuthenticationTenant();
            _siteprovisioningService.Authentication.TenantAdminUrl = template.TenantAdminUrl;

            ReflectionManager rm = new ReflectionManager();

            var siteUrlProvider = rm.GetSiteUrlProvider("SiteUrlProvider");

            if (siteUrlProvider != null)
            {
                var newUrl = siteUrlProvider.GenerateSiteUrl(siteRequest, template);
                if (!String.IsNullOrEmpty(newUrl))
                {
                    Log.Info("SiteProvisioningManager.CreateSiteCollection", "Site {0} was renamed to {1}", siteRequest.Url, newUrl);

                    SiteRequestFactory.GetInstance().GetSiteRequestManager().UpdateRequestUrl(siteRequest.Url, newUrl);
                    siteRequest.Url = newUrl;
                }
            }
            _siteprovisioningService.CreateSiteCollection(siteRequest, template);
            if (siteRequest.EnableExternalSharing)
            {
                _siteprovisioningService.SetExternalSharing(siteRequest);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// TODO
 /// </summary>
 /// <param name="siteRequest"></param>
 /// <param name="template"></param>
 public void CreateSiteCollection(SiteRequestInformation siteRequest, Template template)
 {
     _siteprovisioningService.Authentication = new AppOnlyAuthenticationTenant();
     _siteprovisioningService.Authentication.TenantAdminUrl = template.TenantAdminUrl;
     _siteprovisioningService.CreateSiteCollection(siteRequest, template);
     if (siteRequest.EnableExternalSharing)
     {
         _siteprovisioningService.SetExternalSharing(siteRequest);
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Member to create a site collection
        /// </summary>
        /// <param name="siteRequest">The SiteRequest</param>
        /// <param name="template">The Template</param>
        public void CreateSiteCollection(SiteInformation siteRequest, Template template)
        {
            _siteprovisioningService.Authentication = new AppOnlyAuthenticationTenant();
            _siteprovisioningService.Authentication.TenantAdminUrl = template.TenantAdminUrl;

            ReflectionManager rm = new ReflectionManager();

            var siteUrlProvider = rm.GetSiteUrlProvider("SiteUrlProvider");

            if (siteUrlProvider != null)
            {
                var newUrl = siteUrlProvider.GenerateSiteUrl(siteRequest, template);
                if (!String.IsNullOrEmpty(newUrl))
                {
                    Log.Info("SiteProvisioningManager.CreateSiteCollection", "Site {0} was renamed to {1}", siteRequest.Url, newUrl);

                    SiteRequestFactory.GetInstance().GetSiteRequestManager().UpdateRequestUrl(siteRequest.Url, newUrl);
                    siteRequest.Url = newUrl;
                }
            }



            // Check to see if the site already exists before attempting to create it
            bool siteExists = _siteprovisioningService.SiteExists(siteRequest.Url.ToString());

            if (!siteExists)
            {
                _siteprovisioningService.CreateSiteCollection(siteRequest, template);
                if (siteRequest.EnableExternalSharing)
                {
                    _siteprovisioningService.SetExternalSharing(siteRequest);
                }
            }
            else
            {
                Log.Info("SiteProvisioningManager.CreateSiteCollection", "Site already exists. Moving on to next provisioning step");
            }
        }