Пример #1
0
 private void CreateIISWebsite(CreateIISWebsiteActivity activity, string host)
 {
     try
     {
         var createIISwebsiteScript = new ScriptWithParameters();
         createIISwebsiteScript.Script = this.ActivityScriptMap.ExecutionScript;
         createIISwebsiteScript.Params = new Dictionary <string, object>();
         createIISwebsiteScript.Params.Add("websiteName", activity.WebsiteName);
         createIISwebsiteScript.Params.Add("bindings", activity.Bindings);
         createIISwebsiteScript.Params.Add("physicalPath", activity.LocalPhysicalPath);
         createIISwebsiteScript.Params.Add("override", activity.OverrideIfExists);
         var response = _shellManager.ExecuteCommands(host, new List <ScriptWithParameters> {
             createIISwebsiteScript
         }, true);
     }
     catch (RemoteException rEx)
     {
         logger.Error(rEx.Message);
         HandleException(rEx, activity);
     }
     catch (ApplicationException appEx)
     {
         logger.Error(appEx.Message);
         HandleException(appEx, activity);
     }
 }
Пример #2
0
        private string VerifyCreateIISWebsite(CreateIISWebsiteActivity activity, string host)
        {
            var status = string.Empty;

            try
            {
                var verifyScript = new ScriptWithParameters();
                verifyScript.Script = this.ActivityScriptMap.VerificationScript;
                verifyScript.Params = new Dictionary <string, object>();
                verifyScript.Params.Add("websiteName", activity.WebsiteName);
                verifyScript.Params.Add("bindings", activity.Bindings);
                verifyScript.Params.Add("physicalPath", activity.LocalPhysicalPath);
                verifyScript.Params.Add("override", activity.OverrideIfExists);
                var result = _shellManager.ExecuteCommands(host, new List <ScriptWithParameters> {
                    verifyScript
                }, true);
                status = result.FirstOrDefault() != null ? result[0].ToString() : "0";
            }
            catch (ApplicationException appEx)
            {
                logger.Error(appEx.Message);
                HandleException(appEx, activity);
            }

            return(status);
        }
Пример #3
0
        private bool ContainsParamsFromActivity(ScriptWithParameters scriptWithParams, CreateIISWebsiteActivity createIISWebsitesActivity)
        {
            var parameters    = scriptWithParams.Params;
            var bindingsParam = parameters["bindings"] as Hashtable;

            return
                (createIISWebsitesActivity.WebsiteName.Equals(parameters["websiteName"].ToString(), StringComparison.CurrentCultureIgnoreCase) &&
                 createIISWebsitesActivity.Bindings.Count == bindingsParam.Count &&
                 createIISWebsitesActivity.LocalPhysicalPath.Equals(parameters["physicalPath"].ToString(), StringComparison.CurrentCultureIgnoreCase) &&
                 createIISWebsitesActivity.OverrideIfExists == (bool)parameters["override"] &&
                 !string.IsNullOrWhiteSpace(scriptWithParams.Script) &&
                 parameters.Count == 4);
        }