예제 #1
0
        public void Can_Provision_Incrementally_With_SSOMFarmPropertyBagStorage()
        {
            var provisionRunner  = new SSOMProvisionRunner();
            var provisionService = provisionRunner.ProvisionService;

            var incrementalModelId = "m2.regression." + Guid.NewGuid().ToString("N");

            provisionRunner.WithSSOMFarmContext(farm =>
            {
                for (var i = 0; i < 3; i++)
                {
                    var incrementalProvisionConfig = new IncrementalProvisionConfig();
                    incrementalProvisionConfig.PersistenceStorages.Add(new DefaultSSOMFarmPropertyBagStorage(farm));

                    provisionService.SetIncrementalProvisionMode(incrementalProvisionConfig);

                    var model = SPMeta2Model.NewSiteModel(site =>
                    {
                    });

                    model.SetIncrementalProvisionModelId(incrementalModelId);

                    provisionService.DeployModel(SPMeta2.SSOM.ModelHosts.FarmModelHost.FromFarm(farm), model);
                }
            });
        }
예제 #2
0
        public void Can_Provision_Incrementally_With_AutoDetection_As_SSOM()
        {
            var provisionRunner  = new SSOMProvisionRunner();
            var provisionService = provisionRunner.ProvisionService;

            var incrementalModelId = "m2.regression." + Guid.NewGuid().ToString("N");

            provisionRunner.WithSSOMFarmContext(farm =>
            {
                for (var i = 0; i < 3; i++)
                {
                    var incrementalProvisionConfig = new IncrementalProvisionConfig();
                    incrementalProvisionConfig.AutoDetectSharePointPersistenceStorage = true;

                    provisionService.SetIncrementalProvisionMode(incrementalProvisionConfig);

                    var model = SPMeta2Model.NewFarmModel(site =>
                    {
                    });

                    model.SetIncrementalProvisionModelId(incrementalModelId);


                    provisionService.DeployModel(SPMeta2.SSOM.ModelHosts.FarmModelHost.FromFarm(farm), model);
                }
            });


            provisionRunner.WebApplicationUrls.ForEach(url =>
            {
                provisionRunner.WithSSOMWebApplicationContext(url, spWebApp =>
                {
                    for (var i = 0; i < 3; i++)
                    {
                        var incrementalProvisionConfig = new IncrementalProvisionConfig();
                        incrementalProvisionConfig.AutoDetectSharePointPersistenceStorage = true;

                        provisionService.SetIncrementalProvisionMode(incrementalProvisionConfig);

                        var model = SPMeta2Model.NewWebApplicationModel(site =>
                        {
                        });

                        model.SetIncrementalProvisionModelId(incrementalModelId);


                        provisionService.DeployModel(SPMeta2.SSOM.ModelHosts.WebApplicationModelHost.FromWebApplication(spWebApp), model);
                    }
                });
            });

            provisionRunner.SiteUrls.ForEach(siteUrl =>
            {
                provisionRunner.WithSSOMSiteAndWebContext((spSite, spWeb) =>
                {
                    for (var i = 0; i < 3; i++)
                    {
                        var incrementalProvisionConfig = new IncrementalProvisionConfig();
                        incrementalProvisionConfig.AutoDetectSharePointPersistenceStorage = true;

                        provisionService.SetIncrementalProvisionMode(incrementalProvisionConfig);

                        var model = SPMeta2Model.NewSiteModel(site =>
                        {
                        });

                        model.SetIncrementalProvisionModelId(incrementalModelId);


                        provisionService.DeployModel(SPMeta2.SSOM.ModelHosts.WebModelHost.FromWeb(spWeb), model);
                    }
                });
            });
        }