Ejemplo n.º 1
0
        protected override Clue MakeClueImpl([NotNull] AttendeeByMeeting input, Guid accountId)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            // TODO: Create clue specifying the type of entity it is and ID
            var id   = string.Format("GoToMeetingAttendee_{0}_{1}", input.name, input.attendeeEmail);
            var clue = _factory.Create(EntityType.Infrastructure.User, id, accountId);

            clue.ValidationRuleSupressions.Add(Constants.Validation.Rules.METADATA_002_Uri_MustBeSet);

            // TODO: Populate clue dat6a
            var data = clue.Data.EntityData;

            data.DisplayName = input.attendeeName;
            data.Name        = input.attendeeName;

            var vocab = new AttendeeVocabulary();

            data.Properties[vocab.Email] = input.attendeeEmail.PrintIfAvailable();

            _factory.CreateOutgoingEntityReference(clue, EntityType.Planning, EntityEdgeType.Attended, input.meetingId, input.meetingId.ToString());

            return(clue);
        }
Ejemplo n.º 2
0
        protected override Clue MakeClueImpl([NotNull] Attendee input, Guid accountId)
        {
            if (input == null)
            {
                throw new ArgumentNullException(nameof(input));
            }

            // TODO: Create clue specifying the type of entity it is and ID
            var id   = string.Format("GoToWebinarAttendee_{0}", input.Email);
            var clue = _factory.Create(EntityType.Infrastructure.User, id, accountId);

            clue.ValidationRuleSupressions.Add(Constants.Validation.Rules.METADATA_003_Author_Name_MustBeSet);
            clue.ValidationRuleSupressions.Add(Constants.Validation.Rules.METADATA_002_Uri_MustBeSet);

            // TODO: Populate clue data
            var data = clue.Data.EntityData;

            data.Name = string.Format("{0} {1}", input.FirstName, input.LastName);

            var vocab = new AttendeeVocabulary();

            var attendanceTime = TimeSpan.FromSeconds(input.AttendanceTimeInSeconds);

            data.Properties[vocab.AttendanceTime] = attendanceTime.ToString().PrintIfAvailable();
            data.Properties[vocab.Email]          = input.Email.PrintIfAvailable();
            data.Properties[vocab.FirstName]      = input.FirstName.PrintIfAvailable();
            data.Properties[vocab.JoinTime]       = input.Attendance?.FirstOrDefault().JoinTime.PrintIfAvailable();
            data.Properties[vocab.LastName]       = input.LastName.PrintIfAvailable();
            data.Properties[vocab.LeaveTime]      = input.Attendance?.FirstOrDefault().LeaveTime.PrintIfAvailable();
            data.Properties[vocab.RegistrantKey]  = input.RegistrantKey.PrintIfAvailable();
            data.Properties[vocab.SessionKey]     = input.SessionKey.PrintIfAvailable();

            var SessionId = string.Format("GoToWebinarSession_{0}", input.SessionKey);

            _factory.CreateOutgoingEntityReference(clue, EntityType.Discussion, EntityEdgeType.Attended, SessionId, SessionId);

            return(clue);
        }