public void BuildRuleControlList(RESOClientSettings settings)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(settings.GetSetting(RESOClientLibrary.settings.rulescontrolfile));

            //XmlNode node = doc.DocumentElement.SelectSingleNode("/rulescontrol");
            RuleControl record = null;

            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {
                if (node.HasChildNodes)
                {
                    foreach (XmlNode childnode in node)
                    {
                        string name  = childnode.Name;
                        string value = childnode.InnerText;
                        if (name == "rulename")
                        {
                            if (record != null)
                            {
                                rulecontrol[value] = record;
                            }
                            record          = new RuleControl();
                            record.rulename = value;
                        }
                        if (name == "notes")
                        {
                            record.notes = value;
                        }
                        if (name == "cert_tr")
                        {
                            record.cert_tr = value;
                        }
                        if (name == "cert_impact")
                        {
                            record.cert_impact = value;
                        }
                        if (name == "ttt_testing_results")
                        {
                            record.ttt_testing_results = value;
                        }
                        if (name == "category")
                        {
                            record.category = value;
                        }
                    }
                }
                //string text = node.InnerXml;
                //string json = JsonConvert.SerializeXmlNode(node);
                //RuleControl record = JsonConvert.DeserializeObject<RuleControl>(json);
            }
        }
Beispiel #2
0
 protected override void AddData(string filename, string[] columns, int row)
 {
     if (row > 0)
     {
         if (rulecontrollist[columns[6] as string] == null)
         {
             RuleControl rule = new RuleControl();
             rule.notes                  = columns[0] as string;
             rule.cert_tr                = columns[1] as string;
             rule.cert_impact            = columns[2] as string;
             rule.ttt_testing_results    = columns[3] as string;
             rule.parameters             = columns[4] as string;
             rule.category               = columns[5] as string;
             rule.rulename               = columns[6] as string;
             rulecontrollist[columns[6]] = rule;
         }
     }
 }
Beispiel #3
0
        protected override void FinalizeData()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("<rulecontrols>\r\n");
            foreach (DictionaryEntry item in rulecontrollist)
            {
                string key = item.Key as string;
                //key = key.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;").Replace("'", "&apos;");
                RuleControl   value  = item.Value as RuleControl;
                StringBuilder record = new StringBuilder();
                record.Append("<rulecontrol>\r\n");
                record.Append("<rulename>" + value.rulename + "</rulename >\r\n");
                record.Append("<notes>" + value.notes + "</notes >\r\n");
                record.Append("<cert_tr>" + value.cert_tr + "</cert_tr >\r\n");
                record.Append("<cert_impact>" + value.cert_impact + "</cert_impact >\r\n");
                record.Append("<ttt_testing_results>" + value.ttt_testing_results + "</ttt_testing_results >\r\n");
                record.Append("<category>" + value.category + "</category >\r\n");

                record.Append("</rulecontrol>\r\n");
                sb.Append(record.ToString());
            }

            sb.Append("</rulecontrols>\r\n");

            if (File.Exists(outputpath + "\rulecontrol.xml"))
            {
                File.Delete(outputpath + "\rulecontrol.xml");
            }

            using (System.IO.StreamWriter file =
                       new System.IO.StreamWriter(outputpath + "\\rulecontrol.xml", false))
            {
                file.WriteLine(sb.ToString());
            }
        }
Beispiel #4
0
        public void BuildRuleControlList(RESOClientSettings clientsettings)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(clientsettings.GetSetting(RESOClientLibrary.settings.rulescontrolfile));

            //XmlNode node = doc.DocumentElement.SelectSingleNode("/rulescontrol");
            RuleControl record = null;

            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {
                if (node.HasChildNodes)
                {
                    foreach (XmlNode childnode in node)
                    {
                        string name  = childnode.Name;
                        string value = childnode.InnerText;
                        if (name == "rulename")
                        {
                            if (record != null)
                            {
                                rulecontrol[value] = record;
                            }
                            else
                            {
                                record             = new RuleControl();
                                record.rulename    = value;
                                rulecontrol[value] = record;
                            }
                        }
                        if (name == "notes")
                        {
                            record.notes = value;
                        }
                        if (name == "cert_tr")
                        {
                            record.cert_tr = value;
                        }
                        if (name == "cert_impact")
                        {
                            record.cert_impact = value;
                        }
                        if (name == "ttt_testing_results")
                        {
                            record.ttt_testing_results = value;
                        }
                        if (name == "category")
                        {
                            record.category = value;
                        }
                        if (name == "RESOVersion")
                        {
                            record.RESOVersion = value;
                        }
                        if (name == "Description")
                        {
                            record.Description = value;
                        }
                        if (name == "ErrorMessage")
                        {
                            record.ErrorMessage = value;
                        }
                        if (name == "ODataSpecification")
                        {
                            record.ODataSpecification = value;
                        }
                        if (name == "V4ODataSpecification")
                        {
                            record.V4ODataSpecification = value;
                        }
                        if (name == "V4Specification")
                        {
                            record.V4Specification = value;
                        }
                        if (name == "ODataVersion")
                        {
                            record.ODataVersion = value;
                        }
                        if (name == "PayloadType")
                        {
                            record.PayloadType = value;
                        }
                        if (name == "PayloadFormat")
                        {
                            record.PayloadFormat = value;
                        }
                        if (name == "HelpLink")
                        {
                            record.HelpLink = value;
                        }

                        /*
                         *  <rulename>Common.Core.1000</rulename>
                         *      <notes></notes>
                         *      <cert_tr></cert_tr>
                         *      <cert_impact>Should</cert_impact>
                         *      <ttt_testing_results></ttt_testing_results>
                         *      <category>CORE</category>
                         *      <RESOVersion></RESOVersion>
                         *      <Description>A data service SHOULD expose a conceptual schema definition language (CSDL) based metadata endpoint that describes the structure and organization of all the resources exposed as HTTP endpoints.</Description>
                         *      <ErrorMessage>A data service SHOULD expose a conceptual schema definition language (CSDL) based metadata endpoint that describes the structure and organization of all the resources exposed as HTTP endpoints.</ErrorMessage>
                         *      <ODataSpecification>2.2.3.7.2</ODataSpecification>
                         *      <V4ODataSpecification></V4ODataSpecification>
                         *      <V4Specification></V4Specification>
                         *      <ODataVersion></ODataVersion>
                         *      <PayloadType>Entry</PayloadType>
                         *      <PayloadFormat></PayloadFormat>
                         *      <HelpLink></HelpLink>
                         */
                    }
                }
                //string text = node.InnerXml;
                //string json = JsonConvert.SerializeXmlNode(node);
                //RuleControl record = JsonConvert.DeserializeObject<RuleControl>(json);
            }
        }
Beispiel #5
0
        public void BuildRuleControlList(string rulestorun, RESOClientSettings clientsettings)
        {
            XmlDocument doc = new XmlDocument();

            doc.Load(clientsettings.GetSetting(RESOClientLibrary.settings.rulescontrolfile));
            Hashtable hshrules = new Hashtable();

            string[] rulestorunarray = rulestorun.Split(',');
            for (int n = 0; n < rulestorunarray.Length; n++)
            {
                if (string.IsNullOrEmpty(rulestorunarray[n]))
                {
                    break;
                }
                hshrules[rulestorunarray[n]] = rulestorunarray[n] as string;
            }

            RuleControl record = null;

            foreach (XmlNode node in doc.DocumentElement.ChildNodes)
            {
                if (node.HasChildNodes)
                {
                    foreach (XmlNode childnode in node)
                    {
                        string name  = childnode.Name;
                        string value = childnode.InnerText;
                        if (hshrules != null && hshrules.Count > 0 && hshrules[value] == null)
                        {
                            continue;
                        }
                        if (name == "rulename")
                        {
                            if (record != null)
                            {
                                rulecontrol[value] = record;
                            }
                            else
                            {
                                record             = new RuleControl();
                                record.rulename    = value;
                                rulecontrol[value] = record;
                            }
                        }
                        if (name == "notes")
                        {
                            record.notes = value;
                        }
                        if (name == "cert_tr")
                        {
                            record.cert_tr = value;
                        }
                        if (name == "cert_impact")
                        {
                            record.cert_impact = value;
                        }
                        if (name == "ttt_testing_results")
                        {
                            record.ttt_testing_results = value;
                        }
                        if (name == "category")
                        {
                            record.category = value;
                        }
                        if (name == "RESOVersion")
                        {
                            record.RESOVersion = value;
                        }
                        if (name == "Description")
                        {
                            record.Description = value;
                        }
                        if (name == "ErrorMessage")
                        {
                            record.ErrorMessage = value;
                        }
                        if (name == "ODataSpecification")
                        {
                            record.ODataSpecification = value;
                        }
                        if (name == "V4ODataSpecification")
                        {
                            record.V4ODataSpecification = value;
                        }
                        if (name == "V4Specification")
                        {
                            record.V4Specification = value;
                        }
                        if (name == "ODataVersion")
                        {
                            record.ODataVersion = value;
                        }
                        if (name == "PayloadType")
                        {
                            record.PayloadType = value;
                        }
                        if (name == "PayloadFormat")
                        {
                            record.PayloadFormat = value;
                        }
                        if (name == "HelpLink")
                        {
                            record.HelpLink = value;
                        }
                    }
                }
            }
        }