Пример #1
0
        public void WillGetAccountDetails()
        {
            //var login = "******";
            //var password = "******";
            // !! User should be an admin!
            var login             = "******";
            var password          = "******";
            var apiUrl            = new Uri("https://fiustg.adobeconnect.com");
            var connectionDetails = new ConnectionDetails(apiUrl);
            var provider          = new AdobeConnectProvider(connectionDetails);

            var         userCredentials = new UserCredentials(login, password, "965886535");
            LoginResult loginResult     = provider.Login(userCredentials);

            if (!loginResult.Success)
            {
                throw new InvalidOperationException("Invalid login");
            }

            var fakeLogger  = new FakeLogger();
            var service     = new AdobeConnectAccountService(fakeLogger);
            var principalId = loginResult.User.UserId;
            var proxy       = new AdobeConnectProxy(provider, fakeLogger, apiUrl, principalId);
            var details     = service.GetAccountDetails(proxy);
            var t           = 1;
        }
Пример #2
0
        public void WillUpdatePassword()
        {
            var login            = "******";
            var email            = login;
            var password         = "******";
            var acApiUrl         = "https://connectstage.esynctraining.com/";
            var adobeConnectRoot = new Uri(acApiUrl);
            var con        = new ConnectionDetails(adobeConnectRoot);
            var acProvider = new AdobeConnectProvider(con);
            var proxy      = new AdobeConnectProxy(acProvider, new FakeLogger(), adobeConnectRoot, String.Empty);

            proxy.Login(new UserCredentials("*****@*****.**", "Welcome1"));//admin

            var _adobeConnectAccountService = new AdobeConnectAccountService(new FakeLogger());
            //proxy.PrincipalUpdatePassword()

            var existingPrincipalsResult = proxy.GetAllByEmail(email);

            if (!existingPrincipalsResult.Success)
            {
                return;
            }

            var existingPrincipal = existingPrincipalsResult.Values.FirstOrDefault();

            var principalSetup = new PrincipalSetup
            {
                PrincipalId = existingPrincipal?.PrincipalId,
                Email       = email,
                Login       = email,
                FirstName   = "aaa",
                LastName    = "bbb",
                SendEmail   = true,
                HasChildren = false,
                Type        = PrincipalType.user
            };
            var updatePrincipalResult = proxy.PrincipalUpdate(principalSetup, existingPrincipal != null);

            var updateResult = proxy.PrincipalUpdatePassword(existingPrincipal?.PrincipalId, password);

            var userProxy = _adobeConnectAccountService.GetProvider(new AdobeConnectAccess(new Uri(acApiUrl), email, password), true);
        }
Пример #3
0
        public void WillTestHowBreezeSessionStored()
        {
            //var login = "******";
            //var password = "******";
            var serverAc = new Uri("https://fiustg.adobeconnect.com");
            //var apiUrl = "https://fiustg.adobeconnect.com";
            //var connectionDetails = new ConnectionDetails(apiUrl);
            //var provider = new AdobeConnectProvider(connectionDetails);

            var acConnect = new AdobeConnectAccountService(new FakeLogger());
            //var breeze = "na2breez22yvafwxdrmu8ov3";
            var breeze = "na2breezhcan5ks479qwvmsf";
            var result = acConnect.GetProvider2(new AdobeConnectAccess2(serverAc, breeze));

            //var userCredentials = new UserCredentials(login, password, "965886535");
            //LoginResult loginResult = provider.Login(userCredentials);
            //if (!loginResult.Success)
            //    throw new InvalidOperationException("Invalid login");

            var commonInfo = result.ReportMyMeetings();
        }
Пример #4
0
        public void WillGetAccountDetailsOnLocalAC()
        {
            var login             = "******";
            var password          = "******";
            var apiUrl            = new Uri("https://connect.fiu.edu");
            var connectionDetails = new ConnectionDetails(apiUrl);
            var provider          = new AdobeConnectProvider(connectionDetails);

            var         userCredentials = new UserCredentials(login, password);
            LoginResult loginResult     = provider.Login(userCredentials);

            if (!loginResult.Success)
            {
                throw new InvalidOperationException("Invalid login");
            }

            var fakeLogger  = new FakeLogger();
            var service     = new AdobeConnectAccountService(fakeLogger);
            var principalId = loginResult.User.UserId;
            var proxy       = new AdobeConnectProxy(provider, fakeLogger, apiUrl, principalId);
            var details     = service.GetAccountDetails(proxy);
            var t           = 1;
        }
Пример #5
0
        void RunUmdRecordingsReport()
        {
            var container = new WindsorContainer();

            WindsorIoC.Initialize(container);
            DIConfig.RegisterComponents(container);

            var logger         = IoC.Resolve <ILogger>();
            var accountService = new AdobeConnectAccountService(logger);
            //            IAdobeConnectProxy ac = accountService.GetProvider(new AdobeConnectAccess("https://webmeeting.umd.edu/", "*****@*****.**", "e$ync123UMD"), true);

            var apiUrl = new Uri("https://webmeeting.umd.edu");

            var         connectionDetails = new ConnectionDetails(apiUrl);
            var         provider          = new AdobeConnectProvider(connectionDetails);
            LoginResult loginResult       = provider.Login(new UserCredentials("*****@*****.**", "e$ync123UMD"));

            var recordings = provider.GetRecordingsList(null); //some id here

            //            var recordingsWithoutCreate = recordings.Values.Where(x => x.DateCreated == default(DateTime)).ToList();
            //            var recordingsWithoutCreateWithEnd = recordingsWithoutCreate.Where(x => x.EndDate != default(DateTime)).ToList();
            var recordingsWithoutEnd = recordings.Values.Where(x => x.EndDate == default(DateTime)).Select(x => x.ScoId);

            var result =
                recordings.Values.Where(x => recordingsWithoutEnd.All(r => r != x.ScoId) && x.ScoId != "2434849").ToList(); //2434849 - rec without start date, can't calculate duration
            double duration        = 0;
            double biggestDuration = 0;
            string biggestRecSco   = null;

            var recsAfter_20150601 = result.Where(x => x.DateCreated >= new DateTime(2015, 06, 01));

            foreach (var rec in recsAfter_20150601)
            {
                var      scoInfo = provider.GetScoInfo(rec.ScoId);
                var      rec1    = provider.GetRecordingsList(scoInfo.ScoInfo.FolderId, rec.ScoId);
                TimeSpan ts;
                if (TimeSpan.TryParse(rec1.Values.First().Duration, out ts))
                {
                    duration += ts.TotalMinutes;
                    if (ts.TotalMinutes > biggestDuration)
                    {
                        biggestDuration = ts.TotalMinutes;
                        biggestRecSco   = rec.ScoId;
                    }
                }
                else
                {
                    Console.WriteLine($"There was a problem with scoId={rec.ScoId} . Could not parse Duration={rec1.Values.First().Duration}");
                }
            }
            Console.WriteLine($"Total recordings count after 2015/05/31                   :{recsAfter_20150601.Count()}");
            Console.WriteLine($"Total recordings duration(in minutes) after 2015/05/31    :{duration}");
            Console.WriteLine($"The longest meeting duration(in minutes) after 2015/05/31 :{biggestDuration}, scoId={biggestRecSco}");
            var recsBefore20150601 = result.Where(x => x.DateCreated < new DateTime(2015, 06, 01));

            duration        = 0;
            biggestDuration = 0;
            foreach (var rec in recsBefore20150601)
            {
                var      scoInfo = provider.GetScoInfo(rec.ScoId);
                var      rec1    = provider.GetRecordingsList(scoInfo.ScoInfo.FolderId, rec.ScoId);
                TimeSpan ts;
                if (TimeSpan.TryParse(rec1.Values.First().Duration, out ts))
                {
                    duration += ts.TotalMinutes;
                    if (ts.TotalMinutes > biggestDuration)
                    {
                        biggestDuration = ts.TotalMinutes;
                        biggestRecSco   = rec.ScoId;
                    }
                }
                else
                {
                    Console.WriteLine($"There was a problem with scoId={rec.ScoId} . Could not parse Duration={rec1.Values.First().Duration}");
                }
            }
            Console.WriteLine($"Total recordings count before 2015/05/31                   :{recsBefore20150601.Count()}");
            Console.WriteLine($"Total recordings duration(in minutes) before 2015/05/31    :{duration}");
            Console.WriteLine($"The longest meeting duration(in minutes) before 2015/05/31 :{biggestDuration}, scoId={biggestRecSco}");
            Console.ReadLine();
        }