Exemplo n.º 1
0
        /// <summary>
        /// Deploys and validates target site model.
        /// </summary>
        /// <param name="model"></param>
        public override void DeploySiteModel(ModelNode model)
        {
            if (!SiteUrls.Any())
            {
                throw new SPMeta2Exception("SiteUrls is empty");
            }

            foreach (var siteUrl in SiteUrls)
            {
                ContainerTraceUtils.WriteLine(string.Format("[INF]    Running on site: [{0}]", siteUrl));


                for (var provisionGeneration = 0;
                     provisionGeneration < ProvisionGenerationCount;
                     provisionGeneration++)
                {
                    WithO365Context(siteUrl, context =>
                    {
                        if (EnableDefinitionProvision)
                        {
                            _provisionService.DeployModel(SiteModelHost.FromClientContext(context), model);
                        }

                        if (EnableDefinitionValidation)
                        {
                            _validationService.DeployModel(SiteModelHost.FromClientContext(context), model);
                        }
                    });
                }
            }
        }
Exemplo n.º 2
0
        public override void DeploySiteModel(ModelNode model)
        {
            var scope = GetScopeHash();

            if (!SiteUrls.Any())
            {
                throw new SPMeta2Exception("SiteUrls is empty");
            }

            foreach (var siteUrl in SiteUrls)
            {
                //var siteUrl = GetTargetSiteCollectionUrl();

                ContainerTraceUtils.WriteLine(string.Format("[INF]    Running on site: [{0}]", siteUrl));

                for (var provisionGeneration = 0; provisionGeneration < ProvisionGenerationCount; provisionGeneration++)
                {
                    WithSSOMSiteAndWebContext(siteUrl, (site, web) =>
                    {
                        if (EnableDefinitionProvision)
                        {
                            _provisionService.DeployModel(SiteModelHost.FromSite(site), model);
                        }

                        if (EnableDefinitionValidation)
                        {
                            _validationService.DeployModel(SiteModelHost.FromSite(site), model);
                        }
                    });
                }
            }
        }