/// <summary> /// Assumptions: /// 1. The order of webs and subwebs in the config file follows the structure of SharePoint sites /// 2. No config element is present without their parent web already being defined in the config file, except the root web /// </summary> private void EnsureAndConfigureWebAndActivateFeatures(ClientContext context, Web parentWeb, GtWeb configWeb) { var webToConfigure = EnsureWeb(context, parentWeb, configWeb); FeatureManager.ActivateFeatures(context, webToConfigure, configWeb.SiteFeatures, configWeb.WebFeatures); ListManager.CreateLists(context, webToConfigure, configWeb.Lists); QuicklaunchManager.CreateQuicklaunchNodes(context, webToConfigure, configWeb.Quicklaunch); PropertyManager.SetProperties(context, webToConfigure, configWeb.Properties); foreach (GtWeb subWeb in configWeb.Webs) { EnsureAndConfigureWebAndActivateFeatures(context, webToConfigure, subWeb); } }
/// <summary> /// Will only activate site collection features or rootweb's web features /// </summary> public void ActivateContentTypeDependencyFeatures() { FeatureManager.ActivateFeatures(ClientContext, ClientContext.Web, _configurationWeb.SiteFeatures, _configurationWeb.WebFeatures, true); }