Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CompanyLmsDTO"/> class.
 /// </summary>
 public CompanyLmsDTO()
 {
     roleMapping          = new LmsCompanyRoleMappingDTO[0];
     additionalLmsDomains = new string[0];
     Telephony            = new TelephonyDTO();
     enableAddGuest       = true;
     enableSetUserRole    = true;
     enableRemoveUser     = true;
 }
Esempio n. 2
0
        public CompanyLmsDTO(LmsCompany instance, LmsProvider provider, dynamic settings)
        {
            if (instance == null)
            {
                throw new ArgumentNullException(nameof(instance));
            }
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            this.id     = instance.Id;
            this.useFLV = instance.UseFLV;
            this.useMP4 = instance.UseMP4;
            this.enableMultipleMeetings = instance.EnableMultipleMeetings;
            this.acServer     = instance.AcServer;
            this.acUsername   = instance.AcUsername;
            this.companyId    = instance.CompanyId.Return(x => x, 0);
            this.consumerKey  = instance.ConsumerKey;
            this.createdBy    = instance.CreatedBy.Return(x => x, 0);
            this.modifiedBy   = instance.ModifiedBy.Return(x => x.Value, 0);
            this.dateCreated  = instance.DateCreated.ConvertToUnixTimestamp();
            this.dateModified = instance.DateModified.ConvertToUnixTimestamp();

            this.lmsProvider           = provider.Return(x => x.ShortName, string.Empty);
            this.sharedSecret          = instance.SharedSecret;
            this.lmsAdmin              = instance.AdminUser.With(x => x.Username);
            this.lmsAdminToken         = instance.AdminUser.With(x => x.Token);
            this.lmsDomain             = instance.LmsDomain.AddHttpProtocol(instance.UseSSL.GetValueOrDefault());
            this.primaryColor          = instance.PrimaryColor;
            this.title                 = instance.Title;
            this.useUserFolder         = instance.UseUserFolder.GetValueOrDefault();
            this.canRemoveMeeting      = instance.CanRemoveMeeting.GetValueOrDefault();
            this.canEditMeeting        = instance.CanEditMeeting.GetValueOrDefault();
            canStudentCreateStudyGroup = instance.GetSetting <bool>(LmsLicenseSettingNames.CanStudentCreateStudyGroup, true);
            this.isSettingsVisible     = instance.IsSettingsVisible.GetValueOrDefault();
            this.enableOfficeHours     = instance.EnableOfficeHours.GetValueOrDefault();
            this.enableStudyGroups     = instance.EnableStudyGroups.GetValueOrDefault();
            this.enableCourseMeetings  = instance.EnableCourseMeetings.GetValueOrDefault();

            this.enableVirtualClassrooms      = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableVirtualClassrooms, false);
            this.namedVirtualClassroomManager = instance.GetSetting <bool>(LmsLicenseSettingNames.NamedVirtualClassroomManager, true);
            this.labelVirtualClassroom        = instance.GetSetting <string>(LmsLicenseSettingNames.VirtualClassroomsLabel);

            this.showEGCHelp            = instance.ShowEGCHelp.GetValueOrDefault();
            this.showLmsHelp            = instance.ShowLmsHelp.GetValueOrDefault();
            this.addPrefixToMeetingName = instance.AddPrefixToMeetingName.GetValueOrDefault();
            this.userFolderName         = instance.UserFolderName;

            Uri portalUrl = new Uri((string)settings.PortalUrl, UriKind.Absolute);

            this.setupUrl = new Uri(portalUrl, $"content/lti-config/{provider.LmsProviderName}.xml").ToString();

            this.enableProxyToolMode = instance.EnableProxyToolMode ?? false;
            this.proxyToolPassword   = instance.ProxyToolSharedPassword;

            this.allowUserCreation      = !instance.DenyACUserCreation;
            this.showAuthToken          = !instance.LoginUsingCookie.GetValueOrDefault();
            this.acUsesEmailAsLogin     = instance.ACUsesEmailAsLogin.GetValueOrDefault();
            this.enableAnnouncements    = instance.ShowAnnouncements.GetValueOrDefault();
            this.useSynchronizedUsers   = instance.UseSynchronizedUsers;
            this.meetingNameFormatterId = instance.MeetingNameFormatterId;
            this.roleMapping            = instance.RoleMappings.Select(x =>
                                                                       new LmsCompanyRoleMappingDTO(x.LmsRoleName, x.AcRole, x.IsDefaultLmsRole, x.IsTeacherRole)).ToArray();
            this.isSandbox       = instance.GetSetting <bool>(LmsLicenseSettingNames.IsOAuthSandbox);
            this.oAuthAppId      = instance.GetSetting <string>(LmsLicenseSettingNames.OAuthAppId);
            this.oAuthAppKey     = instance.GetSetting <string>(LmsLicenseSettingNames.OAuthAppKey);
            this.supportPageHtml = instance.GetSetting <string>(LmsLicenseSettingNames.SupportPageHtml);
            this.isActive        = instance.IsActive;

            this.labelMeeting    = instance.GetSetting <string>(LmsLicenseSettingNames.LabelMeeting);
            this.labelOfficeHour = instance.GetSetting <string>(LmsLicenseSettingNames.LabelOfficeHour);
            this.labelStudyGroup = instance.GetSetting <string>(LmsLicenseSettingNames.LabelStudyGroup);

            this.enableMeetingReuse   = instance.EnableMeetingReuse;
            this.additionalLmsDomains = instance.AdditionalLmsDomains;

            this.showSummary  = instance.GetSetting <bool>(LmsLicenseSettingNames.ShowMeetingSummary);
            this.showTime     = instance.GetSetting <bool>(LmsLicenseSettingNames.ShowMeetingTime);
            this.showDuration = instance.GetSetting <bool>(LmsLicenseSettingNames.ShowMeetingDuration);

            this.canRemoveRecordings     = instance.CanRemoveRecordings;
            this.autoPublishRecordings   = instance.AutoPublishRecordings;
            this.forcedAddInInstallation = instance.GetSetting <bool>(LmsLicenseSettingNames.ForcedAddInInstallation);

            this.languageId = instance.LanguageId;

            this.mp4ServiceLicenseKey = instance.GetSetting <string>(LmsLicenseSettingNames.Mp4ServiceLicenseKey);
            this.mp4ServiceWithSubtitlesLicenseKey = instance.GetSetting <string>(LmsLicenseSettingNames.Mp4ServiceWithSubtitlesLicenseKey);

            this.showAudioProfile                 = instance.GetSetting <bool>(LmsLicenseSettingNames.ShowAudioProfile);
            this.audioProfileUnique               = instance.GetSetting <bool>(LmsLicenseSettingNames.AudioProfileUnique);
            this.enableSeminars                   = instance.GetSetting <bool>(LmsLicenseSettingNames.SeminarsEnable);
            this.labelSeminar                     = instance.GetSetting <string>(LmsLicenseSettingNames.SeminarsLabel);
            this.enableAuditGuestEntry            = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableAuditGuestEntry);
            this.HidePrivateRecordingsForStudents = instance.GetSetting <bool>(LmsLicenseSettingNames.HidePrivateRecordingsForStudents);
            useSakaiEvents          = instance.GetSetting <bool>(LmsLicenseSettingNames.UseSakaiEvents);
            enableMeetingSessions   = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableMeetingSessions);
            enableMyContent         = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableMyContent);
            enableAddGuest          = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableAddGuest, true);
            enableSetUserRole       = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableSetUserRole, true);
            enableRemoveUser        = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableRemoveUser, true);
            moodleCoreServiceToken  = instance.GetSetting <string>(LmsLicenseSettingNames.MoodleCoreServiceToken);
            moodleQuizServiceToken  = instance.GetSetting <string>(LmsLicenseSettingNames.MoodleQuizServiceToken);
            schoologyConsumerKey    = instance.GetSetting <string>(LmsLicenseSettingNames.SchoologyConsumerKey);
            schoologyConsumerSecret = instance.GetSetting <string>(LmsLicenseSettingNames.SchoologyConsumerSecret);
            haikuConsumerKey        = instance.GetSetting <string>(LmsLicenseSettingNames.HaikuConsumerKey);
            haikuConsumerSecret     = instance.GetSetting <string>(LmsLicenseSettingNames.HaikuConsumerSecret);
            haikuToken                    = instance.GetSetting <string>(LmsLicenseSettingNames.HaikuToken);
            haikuTokenSecret              = instance.GetSetting <string>(LmsLicenseSettingNames.HaikuTokenSecret);
            isPdfMeetingUrl               = instance.GetSetting <bool>(LmsLicenseSettingNames.IsPdfMeetingUrl);
            bridgeApiTokenKey             = instance.GetSetting <string>(LmsLicenseSettingNames.BridgeApiTokenKey);
            bridgeApiTokenSecret          = instance.GetSetting <string>(LmsLicenseSettingNames.BridgeApiTokenSecret);
            UseCourseSections             = instance.GetSetting <bool>(LmsLicenseSettingNames.UseCourseSections);
            UseCourseMeetingsCustomLayout = instance.GetSetting <bool>(LmsLicenseSettingNames.UseCourseMeetingsCustomLayout);
            EnableOfficeHoursSlots        = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableOfficeHoursSlots);
            EnableCanvasExportToCalendar  = instance.GetSetting <bool>(LmsLicenseSettingNames.EnableCanvasExportToCalendar);
            Telephony = new TelephonyDTO(instance);
        }