Ejemplo n.º 1
0
 /// <summary>
 /// Returns Connectors
 /// </summary>
 /// <returns></returns>
 private FileConnectorBase GetProvisioningConnector()
 {
     ReflectionManager _helper = new ReflectionManager();
     FileConnectorBase _connectorInstance =  _helper.GetProvisioningConnector(ModuleKeys.PROVISIONINGCONNECTORS_KEY);          
     return _connectorInstance;
 }
Ejemplo n.º 2
0
        private ProvisioningTemplate GetProvTemplateAndMakeAdjustments(Web newWeb)
        {
            var _siteTemplateFactory = SiteTemplateFactory.GetInstance();
            var _tm = _siteTemplateFactory.GetManager();
            var _template = _tm.GetTemplateByName(listSites.SelectedItem.Text);
            //var templatePath = Server.MapPath(Path.Combine("~/Resources/SiteTemplates/ProvisioningTemplates", _template.ProvisioningTemplate));
            var _provisioningTemplate = _tm.GetProvisioningTemplate(_template.ProvisioningTemplate);

            ReflectionManager _helper = new ReflectionManager();
            _provisioningTemplate.Connector = _helper.GetProvisioningConnector(ModuleKeys.PROVISIONINGCONNECTORS_KEY);

            //MdlzCommonCustomizations.RemoveUnrequiredLocalizations(_provisioningTemplate, newWeb.Language);
            //MdlzCommonCustomizations.LocalizeElementsFix(newWeb, _provisioningTemplate);
            MdlzCommonCustomizations.AddCustomParametersToProvisioningTemplate(_provisioningTemplate);

            //Handle Custom actions


            foreach (var _webActions in _provisioningTemplate.CustomActions.WebCustomActions)
            {
                //IF ITS A SCRIPT SRC WE DO NOT WANT TO MODIFY
                if (!string.IsNullOrEmpty(_webActions.Url))
                {
                    var _escapedURI = Uri.EscapeUriString(newWeb.Url);
                    _webActions.Url = string.Format(_webActions.Url, _escapedURI);
                }
            }

            return _provisioningTemplate;
        }