protected void selectConference()
        {
            //case 3: // Video session

            Guid   sessionGUID = new Guid();
            string agentName   = "";

            IncidentDS.IncidentDSDataTable dt = BllProxyIncident.SelectIncident(profileId);
            if (dt.Rows.Count != 0)
            {
                sessionGUID = dt[0].incident_guid;
                agentName   = dt[0].agent_full_name;
            }



            String conferenceName = sessionGUID.ToString();


            ConferenceStartupParameters parameters = ConferenceHelper.GetParametersForMultiVideo(conferenceName, "USER");


            string tempConferenceName = Convert.ToString(1000000 + profileId);

            parameters.ConferenceName = tempConferenceName;
            //VideoChatControl.Parameters = parameters;

            IncidentHelper.SetIncidentStateVideoSession(profileId);
        }
        public void ThenAllTheConferencesAreCreated()
        {
            var failureCollector = new ConcurrentBag <string>();

            Parallel.ForEach(slugs, s =>
            {
                var mConf = ConferenceHelper.FindConference(s);
                if (mConf == null)
                {
                    failureCollector.Add(string.Format("Conference with slug '{0}' not found in management repository.", s));
                    return;
                }
                var success = MessageLogHelper.CollectEvents <AvailableSeatsChanged>(mConf.Id, seatsInfo.Rows.Count);
                if (!success)
                {
                    failureCollector.Add(string.Format("Some seats were not found in Conference '{0}'", mConf.Name));
                }
            });

            if (failureCollector.Count > 0)
            {
                var sb = new StringBuilder();
                failureCollector.ToList().ForEach(s => sb.AppendLine(s));
                Assert.True(failureCollector.Count == 0, sb.ToString()); // raise error with all the failures
            }
        }
        protected void selectScreenCast()
        {
            //4:Screen cast

            Guid   guid      = new Guid();
            string agentName = "";

            IncidentDS.IncidentDSDataTable dt = BllProxyIncident.SelectIncident(profileId);
            if (dt.Rows.Count != 0)
            {
                guid      = dt[0].incident_guid;
                agentName = dt[0].agent_full_name;
            }

            String conferenceName = guid.ToString();


            ConferenceStartupParameters parameters = ConferenceHelper.GetParametersForScreenCast(conferenceName, agentName, true);


            //parameters.ShouldCreateConference = false;
            //parameters.ShouldStartAppShare = false;
            //parameters.UseJavascript = false;

            //string tempConferenceName = Convert.ToString(1000000 + profileId);
            //parameters.ConferenceName = tempConferenceName;


            IncidentHelper.SetIncidentStateScreenCast(profileId);
        }
        public ConferenceResponse Map(ConferenceDetailsResponse conference)
        {
            var response = new ConferenceResponse
            {
                Id                     = conference.Id,
                CaseName               = conference.CaseName,
                CaseNumber             = conference.CaseNumber,
                CaseType               = conference.CaseType,
                ScheduledDateTime      = conference.ScheduledDateTime,
                ScheduledDuration      = conference.ScheduledDuration,
                Status                 = ConferenceHelper.GetConferenceStatus(conference.CurrentStatus),
                Participants           = MapParticipants(conference),
                ClosedDateTime         = conference.ClosedDateTime,
                HearingVenueName       = conference.HearingVenueName,
                AudioRecordingRequired = conference.AudioRecordingRequired,
                HearingRefId           = conference.HearingId,
                Endpoints              = MapEndpoints(conference)
            };

            if (conference.MeetingRoom != null)
            {
                response.ParticipantUri       = conference.MeetingRoom.ParticipantUri;
                response.PexipNodeUri         = conference.MeetingRoom.PexipNode;
                response.PexipSelfTestNodeUri = conference.MeetingRoom.PexipSelfTestNode;

                ParticipantTilePositionHelper.AssignTilePositions(response.Participants);
            }

            return(response);
        }
        public void ShowVideoChat(Int32 incidentId, string conferenceName, string userToTransmit, string userToReceive)
        {
            ConferenceStartupParameters parameters1 = ConferenceHelper.GetParametersForTransmitter(conferenceName, userToTransmit);
            ConferenceStartupParameters parameters2 = ConferenceHelper.GetParametersForReceiver(conferenceName, userToReceive, userToTransmit);

            string tempConferenceName = Convert.ToString(1000000 + incidentId);

            if ((parameters1 != null) && (parameters2 != null))
            {
                LoadBase();

                parameters1.ScreenVideoWidth  = 240;
                parameters1.ScreenVideoHeight = 180;
                parameters1.ConferenceName    = tempConferenceName;

                parameters2.ScreenVideoWidth  = 240;
                parameters2.ScreenVideoHeight = 180;
                parameters2.ConferenceName    = tempConferenceName;

                this.Visible = true;

                UpdateVideoEvents(tempConferenceName);
                UpdateScreenEvents(tempConferenceName);
                UpdateAudioEvents(tempConferenceName, incidentId);
                UpdateVolumeSliderEvents();

                ViewChatControl.ConfSessionId   = conferenceName;
                ViewChatControl.ConfSessionUser = userToTransmit;
            }
            else
            {
                this.Visible = false;
            }
        }
Beispiel #6
0
 public void WhenTheseSeatTypesAreCreated(Table table)
 {
     seats = ConferenceHelper.CreateSeats(table);
     foreach (var seat in seats)
     {
         conferenceService.CreateSeat(conference.Id, seat);
     }
 }
Beispiel #7
0
        public void GivenTheListOfTheAvailableOrderItemsForTheCqrsSummit2012Conference(Table table)
        {
            // Populate Conference data
            conferenceInfo = ConferenceHelper.PopulateConfereceData(table);

            // Store for being used by external step classes
            ScenarioContext.Current.Set(conferenceInfo);
        }
 private void Given_That_The_Conference_Has_No_CalendarEntries_Recorded()
 {
     _conference = new Conference(1, "", "");
     _conference.AddToCalendar(ConferenceHelper.GetOpenVotingPeriod());
     _conference.AddToCalendar(ConferenceHelper.GetPastSubmissionPeriod());
     _conference.AddToCalendar(ConferenceHelper.GetFutureAgendaPublishingDate());
     _conference.AddToCalendar(ConferenceHelper.GetFutureRegistration());
 }
Beispiel #9
0
        public async Task <ActionResult <ConferenceResponseVho> > GetConferenceByIdVHOAsync(Guid conferenceId)
        {
            if (conferenceId == Guid.Empty)
            {
                _logger.LogWarning("Unable to get conference when id is not provided");
                ModelState.AddModelError(nameof(conferenceId), $"Please provide a valid {nameof(conferenceId)}");

                return(BadRequest(ModelState));
            }

            ConferenceDetailsResponse conference;

            try
            {
                conference = await _videoApiClient.GetConferenceDetailsByIdAsync(conferenceId);
            }
            catch (VideoApiException e)
            {
                _logger.LogError(e, $"Unable to retrieve conference: ${conferenceId}");

                return(StatusCode(e.StatusCode, e.Response));
            }

            var exceededTimeLimit = !ConferenceHelper.HasNotPassed(conference.CurrentStatus, conference.ClosedDateTime);

            if (exceededTimeLimit)
            {
                _logger.LogInformation(
                    $"Unauthorised to view conference details {conferenceId} because user is not " +
                    "Officer nor a participant of the conference, or the conference has been closed for over 30 minutes");

                return(Unauthorized());
            }

            // these are roles that are filtered against when lists participants on the UI
            var displayRoles = new List <Role>
            {
                Role.Judge,
                Role.Individual,
                Role.Representative,
                Role.VideoHearingsOfficer,
                Role.JudicialOfficeHolder
            };

            conference.Participants = conference
                                      .Participants
                                      .Where(x => displayRoles.Contains((Role)x.UserRole)).ToList();

            var conferenceResponseVhoMapper = _mapperFactory.Get <ConferenceDetailsResponse, ConferenceResponseVho>();
            var response = conferenceResponseVhoMapper.Map(conference);

            await _conferenceCache.AddConferenceAsync(conference);

            return(Ok(response));
        }
Beispiel #10
0
        public void BeforeEachTest()
        {
            _voteRepository = Substitute.For <IVoteRepository>();
            _voteRepository.HasVotedFor(Arg.Is(SessionId), Arg.Is(CookieId)).Returns(true);

            _conferenceLoader = Substitute.For <IConferenceLoader>();
            var conference = new Conference(1, "", "");

            conference.AddToCalendar(ConferenceHelper.GetOpenVotingPeriod());
            _conferenceLoader.LoadConference(Arg.Is(1)).Returns(conference);

            _handler = new DeleteVoteCommandHandler(_voteRepository, _conferenceLoader);
        }
        public void BeforeEachTest()
        {
            _voteRepository = Substitute.For <IVoteRepository>();
            _voteRepository.HasVotedFor(Arg.Any <int>(), Arg.Any <Guid>()).Returns(false);

            _conferenceLoader = Substitute.For <IConferenceLoader>();
            var conference = new Conference(1, "", "");

            conference.AddToCalendar(ConferenceHelper.GetOpenVotingPeriod());
            _conferenceLoader.LoadConference(Arg.Is(1)).Returns(conference);

            _handler = new RegisterVoteCommandHandler(_voteRepository, _conferenceLoader);
        }
        public void ThenTheNewSeatTypesWithThisInformationAreCreated(Table table)
        {
            var conferenceInfo = ConferenceHelper.FindConference(ScenarioContext.Current.Get <string>("slug"));
            var seats          = conferenceInfo.Seats.ToList();

            foreach (var row in table.Rows)
            {
                Assert.True(seats.Any(s => s.Name == row["Name"]));
                Assert.True(seats.Any(s => s.Description == row["Description"]));
                Assert.True(seats.Any(s => s.Quantity == int.Parse(row["Quantity"])));
                Assert.True(seats.Any(s => s.Price == decimal.Parse(row["Price"])));
            }
        }
Beispiel #13
0
        public async Task <ActionResult <ConferenceResponse> > GetConferenceByIdAsync(Guid conferenceId)
        {
            _logger.LogDebug("GetConferenceById");
            if (conferenceId == Guid.Empty)
            {
                _logger.LogWarning("Unable to get conference when id is not provided");
                ModelState.AddModelError(nameof(conferenceId), $"Please provide a valid {nameof(conferenceId)}");
                return(BadRequest(ModelState));
            }

            var username = User.Identity.Name.ToLower().Trim();

            ConferenceDetailsResponse conference;

            try
            {
                _logger.LogTrace($"Retrieving conference details for conference: ${conferenceId}");
                conference = await _videoApiClient.GetConferenceDetailsByIdAsync(conferenceId);
            }
            catch (VideoApiException e)
            {
                _logger.LogError(e, $"Unable to retrieve conference: ${conferenceId}");
                return(StatusCode(e.StatusCode, e.Response));
            }

            var exceededTimeLimit = !ConferenceHelper.HasNotPassed(conference.Current_status, conference.Closed_date_time);

            if (conference.Participants.All(x => x.Username.ToLower().Trim() != username) || exceededTimeLimit)
            {
                _logger.LogInformation(
                    $"Unauthorised to view conference details {conferenceId} because user is neither a VH " +
                    "Officer nor a participant of the conference, or the conference has been closed for over 30 minutes");
                return(Unauthorized());
            }

            // these are roles that are filtered against when lists participants on the UI
            var displayRoles = new List <Role>
            {
                Role.Judge,
                Role.Individual,
                Role.Representative
            };

            conference.Participants = conference.Participants
                                      .Where(x => displayRoles.Contains((Role)x.User_role)).ToList();

            var response = ConferenceResponseMapper.MapConferenceDetailsToResponseModel(conference);
            await _conferenceCache.AddConferenceAsync(conference);

            return(Ok(response));
        }
Beispiel #14
0
        public async Task <ActionResult <IEnumerable <ConferenceForIndividualResponse> > > GetConferencesForIndividual()
        {
            _logger.LogDebug("GetConferencesForIndividual");
            try
            {
                var username = User.Identity.Name;
                var conferencesForIndividual = await _videoApiClient.GetConferencesTodayForIndividualByUsernameAsync(username);

                conferencesForIndividual = conferencesForIndividual.Where(c => ConferenceHelper.HasNotPassed(c.Status, c.Closed_date_time)).ToList();
                var response = conferencesForIndividual
                               .Select(ConferenceForIndividualResponseMapper.MapConferenceSummaryToModel).ToList();
                return(Ok(response));
            }
            catch (VideoApiException e)
            {
                _logger.LogError(e, "Unable to get conferences for user");
                return(StatusCode(e.StatusCode, e.Response));
            }
        }
Beispiel #15
0
        public async Task <ActionResult <List <ConferenceForVhOfficerResponse> > > GetConferencesForVhOfficerAsync([FromQuery] VhoConferenceFilterQuery query)
        {
            _logger.LogDebug("GetConferencesForVhOfficer");
            try
            {
                var conferences = await _videoApiClient.GetConferencesTodayForAdminAsync(query.UserNames);

                conferences = conferences.Where(c => ConferenceHelper.HasNotPassed(c.Status, c.Closed_date_time))
                              .ToList();
                conferences = conferences.OrderBy(x => x.Closed_date_time).ToList();

                var responses = conferences.Select(ConferenceForVhOfficerResponseMapper
                                                   .MapConferenceSummaryToResponseModel).ToList();

                return(Ok(responses));
            }
            catch (VideoApiException e)
            {
                return(StatusCode(e.StatusCode, e.Response));
            }
        }
Beispiel #16
0
        public async Task <ActionResult <List <ConferenceForVhOfficerResponse> > > GetConferencesForVhOfficerAsync([FromQuery] VhoConferenceFilterQuery query)
        {
            _logger.LogDebug("GetConferencesForVhOfficer");
            try
            {
                var conferences = await _videoApiClient.GetConferencesTodayForAdminAsync(query.UserNames);

                var conferenceForVhOfficerResponseMapper = _mapperFactory.Get <ConferenceForAdminResponse, ConferenceForVhOfficerResponse>();
                var responses = conferences
                                .Where(c => ConferenceHelper.HasNotPassed(c.Status, c.ClosedDateTime))
                                .OrderBy(x => x.ClosedDateTime)
                                .Select(conferenceForVhOfficerResponseMapper.Map)
                                .ToList();

                return(Ok(responses));
            }
            catch (VideoApiException e)
            {
                _logger.LogError(e, "Unable to get conferences for vh officer");
                return(StatusCode(e.StatusCode, e.Response));
            }
        }
Beispiel #17
0
        //--------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------
        //--------------------------------------------------------------------------------
        public void Start()
        {
            //ConferenceStartupParameters parameters = new ConferenceStartupParameters();
            //parameters.ConferenceName = facilityGuid.ToString();
            //parameters.UserName = "******";
            //parameters.UserType = "Client";
            //parameters.ShouldCreateConference = false;
            //parameters.VideoWidth = 160;    // 160-->182 (Panel Width   [+22] )
            //parameters.VideoHeight = 120;   // 120-->162 (Panel Height  [+42] )
            //parameters.VideoFPS = 20;
            //parameters.VideoBandwidth = 56000;
            //parameters.VideoQuality = 80;
            //parameters.AppSharevideoWidth = 640;
            //parameters.AppSharevideoHeight = 480;
            //parameters.AppSharevideoFPS = 10;
            //parameters.AppSharevideoBandwidth = 0;
            //parameters.AppSharevideoQuality = 100;
            //parameters.ShouldStartAppShare = false;
            //parameters.UseJavascript = false;
            //parameters.ShowVideoSelection = false;
            //parameters.SendMicSound = false;
            //parameters.ReceiveSound = false;
            //parameters.ScreenVideoWidth = 160;    // 160-->182 (Panel Width   [+22] )
            //parameters.ScreenVideoHeight = 120;   // 120-->162 (Panel Height  [+42] )
            //parameters.VideoTransmitterMode = false;
            //parameters.VideoReceiverMode = false;
            //parameters.UseJavascript = true;
            //parameters.KeepAspectRatioForVideo = false;



            string conferenceName = facilityGuid.ToString();
            ConferenceStartupParameters parameters1 = ConferenceHelper.GetParametersForReceiver(conferenceName, "KIOSK", "");
            ConferenceStartupParameters parameters2 = ConferenceHelper.GetParametersForScreenCast(conferenceName, "KIOSK", false);

            //ConfVideo.Parameters = parameters1;
            //ScreenCast.Parameters = parameters2;
        }
Beispiel #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            object obj = Request.QueryString["id"];

            if (obj != null)
            {
                Int32 i = 0;
                if (Int32.TryParse(obj.ToString(), out i))
                {
                    this.incidentId = i;
                }
            }


            if (this.incidentId != 0)
            {
                string agentName      = "";
                string facilityName   = "";
                string conferenceName = "";

                IncidentDS.IncidentDSDataTable dt = BllProxyIncident.SelectIncident(incidentId);
                if (dt.Rows.Count != 0)
                {
                    conferenceName = dt[0].incident_guid.ToString();
                    facilityName   = dt[0].facility_name;
                    agentName      = dt[0].agent_full_name;
                }

                ConferenceStartupParameters parameters = ConferenceHelper.GetParametersForReceiver(conferenceName, agentName, facilityName);

                //ConfVideo.Parameters = parameters;
            }
            else
            {
                //BllProxyIncidentHelper.SetIncidentStatus(this.incidentId, 4);   // 4:Closed
                Response.Redirect("default.aspx");
            }
        }
        public ConferenceResponseVho Map(ConferenceDetailsResponse conference)
        {
            conference.Participants ??= new List <ParticipantDetailsResponse>();

            var participants = conference.Participants
                               .OrderBy(x => x.CaseTypeGroup)
                               .Select(_participantResponseVhoMapper.Map)
                               .ToList();

            var response = new ConferenceResponseVho
            {
                Id                = conference.Id,
                CaseName          = conference.CaseName,
                CaseNumber        = conference.CaseNumber,
                CaseType          = conference.CaseType,
                ScheduledDateTime = conference.ScheduledDateTime,
                ScheduledDuration = conference.ScheduledDuration,
                Status            = ConferenceHelper.GetConferenceStatus(conference.CurrentStatus),
                Participants      = participants,
                ClosedDateTime    = conference.ClosedDateTime,
                HearingVenueName  = conference.HearingVenueName
            };

            if (conference.MeetingRoom == null)
            {
                return(response);
            }

            response.AdminIFrameUri = conference.MeetingRoom.AdminUri;
            response.ParticipantUri = conference.MeetingRoom.ParticipantUri;
            response.PexipNodeUri   = conference.MeetingRoom.PexipNode;

            AssignTilePositions(conference, response);

            return(response);
        }
Beispiel #20
0
 public RegistrationProcessHardeningIntegrationSteps()
 {
     commandBus = ConferenceHelper.BuildCommandBus();
     eventBus   = ConferenceHelper.BuildEventBus();
 }
Beispiel #21
0
 public SelfRegistrationEndToEndWithIntegrationSteps()
 {
     commandBus = ConferenceHelper.BuildCommandBus();
 }
        public void Start()
        {
            string script = "window.resizeTo( 360, 650 )";

            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "SetLiveConnectSize", script, true);

            ltTimeSpan.Text   = "";
            lblAgentName.Text = "";

            Guid sessionGUID;

            IncidentDS.IncidentDSDataTable dt = BllProxyIncident.SelectIncident(incidentId);

            if (dt.Rows.Count != 0)
            {
                sessionGUID = dt[0].incident_guid;


                string facilityName = dt[0].facility_name;
                string agentName    = dt[0].agent_full_name;


                lblAgentName.Text = agentName;

                //----------------------------------------------------------------------------
                String conferenceName = sessionGUID.ToString();



                ConferenceStartupParameters parameters1 = ConferenceHelper.GetParametersForTransmitter(conferenceName, facilityName);
                ConferenceStartupParameters parameters2 = ConferenceHelper.GetParametersForReceiver(conferenceName, agentName, facilityName);
                this.parameters = ConferenceHelper.GetParametersForScreenCast(conferenceName, facilityName, false);



                Session[Utility.ConferenceStartupParametersSessionVariableName] = this.parameters;


                parameters1.ScreenVideoWidth  = 320;
                parameters1.ScreenVideoHeight = 240;


                string tempConferenceName = Convert.ToString(1000000 + incidentId);
                //string tempConferenceName = conferenceName;


                parameters1.ConferenceName = tempConferenceName;



                parameters2.VideoWidth  = 640;
                parameters2.VideoHeight = 480;

                parameters2.ScreenVideoWidth  = 640;    // 320;
                parameters2.ScreenVideoHeight = 480;    // 240;
                parameters2.ConferenceName    = tempConferenceName;

                parameters.ConferenceName = tempConferenceName;


                UpdateVideoEvents(tempConferenceName);
                UpdateScreenEvents(tempConferenceName);
                UpdateAudioEvents(tempConferenceName, incidentId);

                ViewChatControl.ConfSessionId   = conferenceName;
                ViewChatControl.ConfSessionUser = facilityName;

                //----------------------------------------------------------------------------
                startTime = DateTime.Now;
            }
            else
            {
                Response.Redirect("UcKioskConnect.aspx");
            }
        }
Beispiel #23
0
        public void Start()
        {
            ltTimeSpan.Text   = "";
            lblAgentName.Text = "";

            pnlDisconnect.Visible        = true;
            pnlDisconnectConfirm.Visible = false;


            pnlNew.Visible             = true;
            pnlContent.Visible         = false;
            pnlScreenCast.Visible      = false;
            pnlAppShareSend.Visible    = false;
            pnlAppShareReceive.Visible = false;



            Guid sessionGUID;

            IncidentDS.IncidentDSDataTable dt = BllProxyIncident.SelectIncident(incidentId);

            if (dt.Rows.Count != 0)
            {
                sessionGUID = dt[0].incident_guid;


                string facilityName = dt[0].facility_name;
                string agentName    = dt[0].agent_full_name;


                lblAgentName.Text = agentName;

                //----------------------------------------------------------------------------
                String conferenceName = sessionGUID.ToString();



                ConferenceStartupParameters parameters1 = ConferenceHelper.GetParametersForTransmitter(conferenceName, facilityName);
                ConferenceStartupParameters parameters2 = ConferenceHelper.GetParametersForReceiver(conferenceName, agentName, facilityName);
                this.parameters = ConferenceHelper.GetParametersForScreenCast(conferenceName, facilityName, false);



                Session[Utility.ConferenceStartupParametersSessionVariableName] = this.parameters;


                parameters1.ScreenVideoWidth  = 320;
                parameters1.ScreenVideoHeight = 240;


                string tempConferenceName = Convert.ToString(1000000 + incidentId);
                //string tempConferenceName = conferenceName;


                parameters1.ConferenceName = tempConferenceName;



                parameters2.VideoWidth  = 640;
                parameters2.VideoHeight = 480;

                parameters2.ScreenVideoWidth  = 640;    // 320;
                parameters2.ScreenVideoHeight = 480;    // 240;
                parameters2.ConferenceName    = tempConferenceName;

                parameters.ConferenceName = tempConferenceName;


                UpdateVideoEvents(tempConferenceName);
                UpdateScreenEvents(tempConferenceName);
                UpdateAudioEvents(tempConferenceName);


                //this.startVideoTransmitter(parameters1);      // !!!!!
                //this.startVideoReceiver(parameters2);
                //this.startCreenCast(this.parameters);



                //--
                //TextChatControl.ConfSessionId = conferenceName;
                //TextChatControl.ConfSessionUser = facilityName;
                ViewChatControl.ConfSessionId   = conferenceName;
                ViewChatControl.ConfSessionUser = facilityName;
                //--


                //----------------------------------------------------------------------------
                startTime = DateTime.Now;
            }
            else
            {
                Response.Redirect("UcKioskConnect.aspx");
            }
        }
 public SelfRegistrationReservationWithConcurrencyIntegrationSteps()
 {
     commandBus = ConferenceHelper.BuildCommandBus();
 }
Beispiel #25
0
 public ConferenceConfigurationIntegrationSteps()
 {
     conferenceService = new ConferenceService(ConferenceHelper.BuildEventBus());
 }
Beispiel #26
0
 public void GivenThisConferenceInformation(Table table)
 {
     conference = ConferenceHelper.BuildConferenceInfo(table);
 }
 public void StartConference(List<string> invitees)
 {
     ConferenceHelper helper = new ConferenceHelper(_appEndpoint);            
     helper.InitiateConference(invitees);
 }
        public void WhenTheBusinessCustomerProceedToCreateTheSeatTypes(Table table)
        {
            var slug = ScenarioContext.Current.Get <string>("slug");

            ConferenceHelper.CreateSeats(slug, table);
        }