~grubng-dev/grubng/tools-urlsdb

« back to all changes in this revision

Viewing changes to Config.cs

  • Committer: thindil
  • Date: 2009-10-07 09:37:05 UTC
  • Revision ID: thindil2@gmail.com-20091007093705-kp67qhweaxd1prmw
added process rename

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Config.cs
2
2
// 
3
 
// Copyright (C) 2009,2010,2011 Bartek Jasicki
 
3
// Copyright (C) 2008,2009 Bartek Jasicki
4
4
//
5
5
// This file is part of Grubng.
6
6
//
38
38
                /// </summary>
39
39
                public static void CreateConfig()
40
40
                {
41
 
                        using (XmlTextWriter xmlw = new XmlTextWriter("grub.xml", null))
42
 
                        {
43
 
                                xmlw.Formatting = Formatting.Indented;
44
 
                                xmlw.WriteStartDocument(false);
45
 
                                xmlw.WriteStartElement("configuration");
46
 
                                xmlw.WriteElementString("enablesolr", "Y");
47
 
                                xmlw.WriteElementString("solraddress", "http://soap.grub.org:8180/solr/");
48
 
                                xmlw.WriteElementString("solrusername", "user");
49
 
                                xmlw.WriteElementString("solrpassword", "password");
50
 
                                xmlw.WriteElementString("uploadaddress", "http://grub.silc.org.ua:8080");
51
 
                                xmlw.WriteElementString("uploadusername", "user");
52
 
                                xmlw.WriteElementString("uploadpassword", "password");
53
 
                                xmlw.WriteElementString("mysqlhost", "localhost");
54
 
                                xmlw.WriteElementString("mysqldb", "grub");
55
 
                                xmlw.WriteElementString("mysqluser", "user");
56
 
                                xmlw.WriteElementString("mysqlpassword", "password");
57
 
                                xmlw.WriteElementString("workunitsdirectory", "/home/thindil/workunits/wu/");
58
 
                                xmlw.WriteElementString("workunitspassword", "password");
59
 
                                xmlw.WriteElementString("useragent", "GrubNG 0.1 (http://grub.org)");
60
 
                                xmlw.WriteElementString("urlsamount", "250");
61
 
                                xmlw.WriteElementString("httpversion", "1.0");
62
 
                                xmlw.WriteElementString("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
63
 
                                xmlw.WriteEndElement();
64
 
                                xmlw.Flush();
65
 
                                xmlw.Close();   
66
 
                        }
 
41
                        XmlTextWriter xmlw = new XmlTextWriter("grub.xml", null);
 
42
                        xmlw.Formatting = Formatting.Indented;
 
43
                        xmlw.WriteStartDocument(false);
 
44
                        xmlw.WriteStartElement("configuration");
 
45
                        xmlw.WriteElementString("enablesolr", "Y");
 
46
                        xmlw.WriteElementString("solraddress", "http://soap.grub.org:8180/solr/");
 
47
                        xmlw.WriteElementString("solrusername", "user");
 
48
                        xmlw.WriteElementString("solrpassword", "password");
 
49
                        xmlw.WriteElementString("mysqlhost", "localhost");
 
50
                        xmlw.WriteElementString("mysqldb", "grub");
 
51
                        xmlw.WriteElementString("mysqluser", "user");
 
52
                        xmlw.WriteElementString("mysqlpassword", "password");
 
53
                        xmlw.WriteElementString("workunitsdirectory", "/home/thindil/workunits/wu/");
 
54
                        xmlw.WriteElementString("workunitspassword", "password");
 
55
                        xmlw.WriteElementString("useragent", "GrubNG 0.1 (http://grub.org)");
 
56
                        xmlw.WriteElementString("urlsamount", "250");
 
57
                        xmlw.WriteElementString("httpversion", "1.0");
 
58
                        xmlw.WriteElementString("accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
 
59
                        xmlw.WriteEndElement();
 
60
                        xmlw.Flush();
 
61
                        xmlw.Close();                   
67
62
                }
68
63
                
69
64
                /// <summary>
128
123
                {
129
124
                        XmlDocument doc = new XmlDocument();
130
125
                        doc.Load("grub.xml");
131
 
                        string[] nodes = new string[17] {"enablesolr", "solraddress", "solrusername", 
132
 
                                "solrpassword", "uploadaddress", "uploadusername", "uploadpassword", "mysqlhost", 
133
 
                                "mysqldb", "mysqluser", "mysqlpassword", "workunitsdirectory", "workunitspassword", 
134
 
                                "useragent", "urlsamount", "httpversion", "accept"};
135
 
                        string[] values = new string[17] {"Y", "http://soap.grub.org:8180/solr/", 
136
 
                                "user", "password", "http://grub.silc.org.ua:8080", "user", "password", "localhost", 
137
 
                                "grub", "user", "password",     "/home/thindil/workunits/wu/", "password", 
138
 
                                "GrubNG 0.1 (http://grub.org)", "250", "1.0", 
139
 
                                "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"};
 
126
                        string[] nodes = new string[14] {"enablesolr", "solraddress", "solrusername", 
 
127
                                "solrpassword", "mysqlhost", "mysqldb", "mysqluser", "mysqlpassword",
 
128
                                "workunitsdirectory", "workunitspassword", "useragent", "urlsamount",
 
129
                                "httpversion", "accept"};
 
130
                        string[] values = new string[14] {"Y", "http://soap.grub.org:8180/solr/", 
 
131
                                "user", "password", "localhost", "grub", "user", "password",
 
132
                                "/home/thindil/workunits/wu/", "password", "GrubNG 0.1 (http://grub.org)",
 
133
                                "250","1.0", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"};
140
134
                        XmlNode noder;
141
135
                        foreach (string node in nodes)
142
136
                        {