Ejemplo n.º 1
0
        public void DeployIntranet(ClientContext context, Options options)
        {
            // pushing site model
            if (options.DeploySite)
            {
                var siteModel = new M2ProjectPrefixSiteModel();

                this.DeploySiteModel(context, siteModel.GetSiteFeaturesModel());
                this.DeploySiteModel(context, siteModel.GetUserCustomActionModel());
                this.DeploySiteModel(context, siteModel.GetSiteSecurityModel());

                this.DeploySiteModel(context, siteModel.GetFieldsAndContentTypesModel());
                this.DeploySiteModel(context, siteModel.GetSandboxSolutionsModel());
            }

            // pushing root web model
            if (options.DeployRootWeb)
            {
                var rootWebModel = new M2ProjectPrefixRootWebModel();

                this.DeployWebModel(context, rootWebModel.GetStyleLibraryModel());
                this.DeployWebModel(context, rootWebModel.GetModel());
            }

            // pushing 'How-tow' sub web
            if (options.DeployHowTosWeb)
            {
                var howTosWebModel = new M2ProjectPrefixHowTosWebModel();
                this.DeployWebModel(context, howTosWebModel.GetModel());
            }
        }
        public void CanProvisionIntranet_SiteModel()
        {
            WithCSOMContext(context =>
            {
                var siteModel    = new M2ProjectPrefixSiteModel();
                var rootWebModel = new M2ProjectPrefixRootWebModel();

                var provisionService = new CSOMProvisionService();

                // site
                provisionService.DeploySiteModel(context, siteModel.GetSiteFeaturesModel());
                provisionService.DeploySiteModel(context, siteModel.GetUserCustomActionModel());
                provisionService.DeploySiteModel(context, siteModel.GetSiteSecurityModel());

                provisionService.DeploySiteModel(context, siteModel.GetFieldsAndContentTypesModel());
                provisionService.DeploySiteModel(context, siteModel.GetSandboxSolutionsModel());

                // root web
                provisionService.DeployWebModel(context, rootWebModel.GetStyleLibraryModel());
                provisionService.DeployWebModel(context, rootWebModel.GetModel());
            });
        }