Ejemplo n.º 1
0
        private VaultClient connectPublicVault()
        {
            string         loginURL    = "http://ids.live.altium.com/?cls=soap";
            IDSClient      idsClient   = new IDSClient(loginURL);
            IDSLoginResult loginResult = idsClient.Login("*****@*****.**", "123456", false, LoginOptions.KillExistingSession);
            string         vaultURL    = "http://vault.live.altium.com/?cls=soap";
            VaultClient    vaultClient = new VaultClient(vaultURL);

            vaultClient.Login(loginResult.SessionId);
            Console.WriteLine("Session ID = " + vaultClient.SessionID);
            Console.WriteLine("Vault HRID = " + vaultClient.VaultInfo.HRID);
            Console.WriteLine("Vault Serivce URL = " + vaultClient.ServiceURL);

            return(vaultClient);
        }
Ejemplo n.º 2
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string vaultURL = this.txtBox.Text;
            string userName = this.txtBoxUserName.Text;
            string password = this.txtBoxPW.Text;

            var     parser = new FileIniDataParser();
            IniData config = parser.ReadFile("Config.ini");

            if (!config.Configuration.SectionRegex.Equals(vaultURL))
            {
                try
                {
                    if (vaultURL != "")
                    {
                        string loginURL;
                        if (vaultURL == "http://vault.live.altium.com")
                        {
                            loginURL = "http://ids.live.altium.com/?cls=soap";
                        }
                        else
                        {
                            loginURL = vaultURL + "/ids/?cls=soap";
                        }

                        IDSClient      idsClient   = new IDSClient(loginURL);
                        IDSLoginResult loginReuslt = idsClient.Login(userName, password, false, LoginOptions.KillExistingSession);

                        if (loginReuslt.SessionId != null)
                        {
                            config.Sections.AddSection(vaultURL);
                            config[vaultURL].AddKey("User Name", userName);
                            config[vaultURL].AddKey("Password", password);
                            parser.WriteFile("Config.ini", config);

                            main_form.addVaultToList(vaultURL);

                            this.Close();
                        }
                    }
                }

                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Ejemplo n.º 3
0
        public void loginVault(string vaultURL, string userName, string password)
        {
            IDSClient idsClient = new IDSClient(vaultURL + "/ids/?cls=soap");

            try
            {
                IDSLoginResult loginResult = idsClient.Login(userName, password, false);
                vaultClient = new VaultClient(vaultURL + "/vault/?cls=soap");
                vaultClient.Login(loginResult.SessionId);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Ejemplo n.º 4
0
        private VaultClient connectVault(string vaultAddress, string userName, string password)
        {
            string         loginURL    = vaultAddress + "/ids/?cls=soap";
            IDSClient      idsClient   = new IDSClient(loginURL);
            IDSLoginResult loginResult = idsClient.Login(userName, password, false);

            string      vaultURL    = vaultAddress + "/vault/?cls=soap";
            VaultClient vaultClient = new VaultClient(vaultURL);

            vaultClient.Login(loginResult.SessionId);

            Console.WriteLine("Session ID = " + vaultClient.SessionID);
            Console.WriteLine("Vault HRID = " + vaultClient.VaultInfo.HRID);
            Console.WriteLine("Vault Serivce URL = " + vaultClient.ServiceURL);

            return(vaultClient);
        }
Ejemplo n.º 5
0
        static void testVault()
        {
            string         loginURL    = "http://ids.live.altium.com/?cls=soap";
            IDSClient      idsClient   = new IDSClient(loginURL);
            IDSLoginResult loginResult = idsClient.Login("*****@*****.**", "123456", false, LoginOptions.KillExistingSession);
            string         vaultURL    = "http://vault.live.altium.com/?cls=soap";
            VaultClient    vaultClient = new VaultClient(vaultURL);

            vaultClient.Login(loginResult.SessionId);
            Console.WriteLine("Session ID = " + vaultClient.SessionID);
            Console.WriteLine("Vault HRID = " + vaultClient.VaultInfo.HRID);
            Console.WriteLine("Vault Serivce URL = " + vaultClient.ServiceURL);
            //VaultFolderList folderlist = vaultClient.GetAllFolders();

            try
            {
                VaultItemRevisionList itemRevisions = vaultClient.GetItemRevisions("COMMENT = 'RES-2'", new VaultRequestOptions()
                {
                    VaultRequestOption.IncludeAllChildObjects
                });
                if (itemRevisions.Count > 0)
                {
                    foreach (VaultItemRevision itemRevision in itemRevisions)
                    {
                        Console.WriteLine(itemRevision.Comment + " " + itemRevision.GUID);
                    }
                }
                else
                {
                    Console.WriteLine("not found");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }