private void btnParse_Click(object sender, EventArgs e)
        {
            try {
                StreamReader reader = new StreamReader(txtInputFile.Text);
                try {
                    string lineRead = string.Empty;
                    while (!string.IsNullOrEmpty((lineRead = reader.ReadLine()))) {

                        string[] splitLine = lineRead.Split(',');
                        ConfigurationObject confObject = new ConfigurationObject();
                        confObject.nickname =splitLine[3] ;
                        confObject.tpkNumber=splitLine[2].Split('.')[2];
                        confObject.branch =txtBranch.Text;
                        confObject.oldDumpId =splitLine[5];
                        confObject.newDumpId = splitLine[4];
                        //confObject.envNumber = GetEnvNumber(confObject.nickname,confObject.);

                        lbTpkList.Items.Add(confObject);
                    }
                } finally {
                    reader.Close();
                }
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
 private string[] GenerateLocalPath(ConfigurationObject confObject)
 {
     string[] localPaths = new string[4];
     // @0 tpk pub
     localPaths[0] = outputDir + @"\TPKpublic" + confObject.tpkNumber;
     // @1 tpk mur
     localPaths[1] = outputDir + @"\TPKmurex" + confObject.tpkNumber;
     if (confObject.hasEnv) {
         // @2 env pub
         localPaths[2] = outputDir + @"\ENVpublic" + confObject.envNumber;
         // @3 env mur
         localPaths[3] = outputDir + @"\ENVmurex" + confObject.envNumber;
     }
     return localPaths;
 }
        private string[] GenerateRemotePath(ConfigurationObject confObject)
        {
            string[] remotePaths = new string[4];
            // @0 tpk pub
            remotePaths[0] = "http://globalqa/svn/PAR/TPK/" + confObject.tpkNumber + "/" + confObject.branch + "/tpk/apps/fs/quality/public/conf/";
            // @1 tpk mur
            remotePaths[1] = "http://globalqa/svn/PAR/TPK/" + confObject.tpkNumber + "/" + confObject.branch + "/tpk/apps/fs/quality/murex/conf/";

            if (confObject.hasEnv) {
                // @2 env pub
                remotePaths[2] = "http://globalqa/svn/PAR/ENV/" + confObject.envNumber + "/" + confObject.branch + "/env/apps/fs/quality/public/conf/";
                // @3 env mur
                remotePaths[3] = "http://globalqa/svn/PAR/ENV/" + confObject.envNumber + "/" + confObject.branch + "/env/apps/fs/quality/murex/conf/";
            }

            return remotePaths;
        }
Esempio n. 4
0
 private ConfigFile SearchForNicknamesTpkOnly(ConfigurationObject configurationObject, bool searchForBase, out bool found)
 {
     ConfigFile confFile = new ConfigFile();
     found = false;
     confFile = MarshalConfigFile(configurationObject.tpkPublicConfigCheckedOutPath, configurationObject.nickname, searchForBase, out found);
     confFile.filePath = configurationObject.tpkPublicConfigCheckedOutPath;
     confFile.isEnv = false;
     confFile.isPublic = true;
     if (!found) {
         confFile = MarshalConfigFile(configurationObject.tpkMurexConfigCheckedOutPath, configurationObject.nickname, searchForBase, out found);
         confFile.filePath = configurationObject.tpkMurexConfigCheckedOutPath;
         confFile.isEnv = false;
         confFile.isPublic = false;
     }
     return confFile;
 }
Esempio n. 5
0
        private List<ConfigFile> ParseTPKWithEnvConfigFiles(ConfigurationObject configurationObject)
        {
            List<ConfigFile> configFiles = new List<ConfigFile>();
            bool found = false;
            ConfigFile configFileOriginal = SearchForNicknames(configurationObject, false, out found);
            //here we have the basic config file
            ConfigFile configFileOriginalBase;
            if (found) {
                if (!configFileOriginal.availableNickname.isBaseNickname) {
                    configurationObject.nickname = configFileOriginal.availableNickname.referenceNickname;
                    configFileOriginalBase = SearchForNicknames(configurationObject, true, out found);
                }

                configurationObject.nickname = configurationObject.nickname + "_ORA11_MIG";
                bool foundOra11Mig;
                ConfigFile configFileOra11Mig = SearchForNicknames(configurationObject, false, out foundOra11Mig);
                ConfigFile configFileOra11MigBase;
                if (foundOra11Mig) {// check for dump check tpk murex then go to env
                    if (!configFileOra11Mig.availableNickname.isBaseNickname) {
                        configurationObject.nickname = configFileOra11Mig.availableNickname.referenceNickname;
                        configFileOra11MigBase = SearchForNicknames(configurationObject, true, out foundOra11Mig);
                    }
                } else {
                    //create new

                }

                configurationObject.nickname = configurationObject.nickname + "_ORA11";
                bool foundOra11;
                ConfigFile configFileOra11 = SearchForNicknames(configurationObject, false, out foundOra11);
                ConfigFile configFileOra11Base;
                if (foundOra11) {//test parameters (tpk and env ) and bcps
                    if (!configFileOra11Mig.availableNickname.isBaseNickname) {
                        configurationObject.nickname = configFileOra11.availableNickname.referenceNickname;
                        configFileOra11Base = SearchForNicknames(configurationObject, true, out foundOra11);
                    }
                } else {
                    //create new

                }

            } else {
                // do nothing coz nickname not found
            }
            return configFiles;
        }
Esempio n. 6
0
        private List<ConfigFile> ParseTPKConfigFiles(ConfigurationObject configurationObject)
        {
            List<ConfigFile> configFiles = new List<ConfigFile>();
            bool found = false;
            ConfigFile configFileOriginal = SearchForNicknamesTpkOnly(configurationObject, false, out found);
            //here we have the basic config file
            ConfigFile configFileOriginalBase = new ConfigFile(); ;
            if (found) {
                string oldNickname = string.Empty;
                if (!configFileOriginal.availableNickname.isBaseNickname) {
                    oldNickname = configurationObject.nickname;
                    configurationObject.nickname = configFileOriginal.availableNickname.referenceNickname;
                    configFileOriginalBase = SearchForNicknamesTpkOnly(configurationObject, true, out found);
                    configurationObject.nickname = oldNickname;
                }
                //=====>>>  care here we need to keep the basic configurationObject.nickname intact
                configurationObject.nickname = configurationObject.nickname + "_ORA11_MIG";
                bool foundOra11Mig;
                ConfigFile configFileOra11Mig = SearchForNicknamesTpkOnly(configurationObject, false, out foundOra11Mig);
                ConfigFile configFileOra11MigBase = new ConfigFile();
                if (foundOra11Mig) {// check for dump check tpk murex then go to env
                    // case found here we have same reference nicknames ==> no work done on base config file
                    if (!configFileOra11Mig.availableNickname.isBaseNickname && string.Equals(configFileOra11Mig.availableNickname.referenceNickname, configFileOriginal.availableNickname.referenceNickname)) {
                        if (!string.IsNullOrEmpty(configFileOra11Mig.availableNickname.dumpId)) {
                            // we need to replace the dump if the dump was in public config
                            configFileOra11Mig.availableNickname.newXmlRepresentation = configFileOra11Mig.availableNickname.oldXmlRepresentation.Replace(configFileOra11Mig.availableNickname.dumpId, configFileOriginal.availableNickname.dumpId);
                        }
                        //they have different reference nicknames
                    }else if (!configFileOra11Mig.availableNickname.isBaseNickname) {
                        configurationObject.nickname = configFileOra11Mig.availableNickname.referenceNickname;
                        configFileOra11MigBase = SearchForNicknamesTpkOnly(configurationObject, true, out foundOra11Mig);
                        //get dump id and replace it ====> or here we get the databases tag entirely
                        if (configFileOra11MigBase.availableNickname.oldXmlRepresentation.Contains("Dump")) {
                            configFileOra11MigBase.availableNickname.newXmlRepresentation = configFileOra11MigBase.availableNickname.oldXmlRepresentation.Replace(configFileOra11MigBase.availableNickname.dumpId, configFileOriginalBase.availableNickname.dumpId);
                        } else if (configFileOra11Mig.availableNickname.oldXmlRepresentation.Contains("Dump")) {
                        }
                    }
                } else {
                    //create new

                }

                configurationObject.nickname = configurationObject.nickname + "_ORA11";
                bool foundOra11;
                ConfigFile configFileOra11 = SearchForNicknamesTpkOnly(configurationObject, false, out foundOra11);
                ConfigFile configFileOra11Base;
                if (foundOra11) {//test parameters (tpk and env ) and bcps
                    if (!configFileOra11Mig.availableNickname.isBaseNickname) {
                        configurationObject.nickname = configFileOra11.availableNickname.referenceNickname;
                        configFileOra11Base = SearchForNicknamesTpkOnly(configurationObject, true, out foundOra11);
                    }
                } else {
                    //create new

                }

            } else {
                // do nothing coz nickname not found
            }
            return configFiles;
        }
Esempio n. 7
0
        private List<ConfigFile> ParseConfigFiles(ConfigurationObject configurationObject)
        {
            List<ConfigFile> configFiles = new List<ConfigFile>(); ;
            if (configurationObject.hasEnv) {
                configFiles = ParseTPKWithEnvConfigFiles(configurationObject);
            } else if (!configurationObject.hasEnv) {
                configFiles = ParseTPKConfigFiles(configurationObject);
            }

            return configFiles;
        }
Esempio n. 8
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            try {

                outputDir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + @"\output";
                outputDir = outputDir.Replace(" ", "");
                if (!Directory.Exists(outputDir)) {
                    Directory.CreateDirectory(outputDir);
                }
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load("App.config");
                XmlNodeList TpksFromConfig = xmlDoc.DocumentElement.ChildNodes;
                for (int i = 0; i < TpksFromConfig.Count; i++) {
                    ConfigurationObject confObject = new ConfigurationObject();
                    confObject.tpkNumber = TpksFromConfig[i].Attributes["number"].Value;
                    confObject.nickname = TpksFromConfig[i].Attributes["nickname"].Value;
                    if (TpksFromConfig[i].HasChildNodes) {
                        confObject.hasEnv = true;
                        confObject.envNumber = TpksFromConfig[i].ChildNodes[0].Attributes["number"].Value;
                    }
                    lstTpks.Items.Add(confObject);
                }
            } catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }