Exemple #1
0
 void SetContactInfo(string ContactUserKey, string FirstName, string LastName, string Email, bool MailLectureNotifications, string ApiUserKey, string AuthCode)
 {
     using (var clientData = new ClientDataProxy())
     {
         clientData.SetContactInfo(ContactUserKey, FirstName, LastName, Email, MailLectureNotifications, Util.GetUserKey(), Util.GetAuthCode());
     }
 }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Course currentCourse = AngelSession.CurrentAngelSession.Section;

                ProvisionLink.NavigateUrl = String.Format("{0}ProvisionCourse.aspx?id={1}", cNuggetRoot, currentCourse.CourseId);

                using (var clientData = new ClientDataProxy())
                {
                    List <CourseInfo> courses = new List <CourseInfo>(clientData.GetCourses(Util.GetUserKey(), Util.GetAuthCode()));

                    string panoptoCourseID = ConfigurationVariable.GetValue("PanoptoCourseID", null, null, null, currentCourse.CourseId, null);

                    if (String.IsNullOrEmpty(panoptoCourseID))
                    {
                        courses.Insert(0, new CourseInfo()
                        {
                            DisplayName = "-- Select an Existing Course --"
                        });
                    }

                    bool isProvisioned = false;
                    bool canSync       = false;

                    // Populate course drop down.
                    CoursesDropDown.Items.Clear();
                    foreach (CourseInfo course in courses)
                    {
                        ListItem item = new ListItem(course.DisplayName, course.PublicID.ToString());

                        // Select course if it matches the current Panopto course setting
                        if (course.PublicID.ToString() == panoptoCourseID)
                        {
                            item.Selected = true;
                        }

                        CoursesDropDown.Items.Add(item);

                        // Check for matching external ID indicating the course has already been provisioned
                        if (course.ExternalCourseID == Util.GetExternalCourseID(currentCourse.CourseId))
                        {
                            isProvisioned = true;

                            // If provisioned course is already selected, show "Sync users" link
                            if (course.PublicID.ToString() == panoptoCourseID)
                            {
                                canSync = true;
                            }
                        }
                    }

                    ProvisionPanel.Visible = (!isProvisioned || canSync);
                    ProvisionLink.Text     =
                        canSync
                            ? "Sync Users"
                            : "Add this course to Panopto";
                }
            }
        }
Exemple #3
0
 Guid CreateCourse(string ShortName, string LongName, string ExternalCourseID, string ApiUserKey, string AuthCode)
 {
     using (var clientData = new ClientDataProxy())
     {
         return(clientData.CreateCourse(ShortName, LongName, ExternalCourseID, Util.GetUserKey(), Util.GetAuthCode()));
     }
 }
Exemple #4
0
 void AddUsersToCourse(Guid CoursePublicID, AccessLevel Role, string[] UserKeys, string ApiUserKey, string AuthCode)
 {
     using (var clientData = new ClientDataProxy())
     {
         clientData.AddUsersToCourse(CoursePublicID, Role, UserKeys, Util.GetUserKey(), Util.GetAuthCode());
     }
 }
Exemple #5
0
 CourseInfo[] ProvisionCourses(CourseProvisioningInfo[] ProvisioningInfo, string ApiUserKey, string AuthCode)
 {
     using (var clientData = new ClientDataProxy())
     {
         return(clientData.ProvisionCourses(ProvisioningInfo, Util.GetUserKey(), Util.GetAuthCode()));
     }
 }
Exemple #6
0
 public static CourseInfo[] GetCourses()
 {
     using (var clientData = new ClientDataProxy())
     {
         return(clientData.GetCourses(Util.GetUserKey(), Util.GetAuthCode()));
     }
 }
Exemple #7
0
 public static SystemInfo GetSystemInfo()
 {
     using (var clientData = new ClientDataProxy())
     {
         return(clientData.GetSystemInfo());
     }
 }
Exemple #8
0
 public static DeliveryInfo[] GetCompletedDeliveries()
 {
     using (var clientData = new ClientDataProxy())
     {
         return(clientData.GetCompletedDeliveries(CoursePublicID, Util.GetUserKey(), Util.GetAuthCode()));
     }
 }
Exemple #9
0
        public static SessionInfo[] GetLiveSessions()
        {
            using (var clientData = new ClientDataProxy())
            {
                SessionInfo[] info = clientData.GetLiveSessions(CoursePublicID, Util.GetUserKey(), Util.GetAuthCode());

                return(info);
            }
        }
Exemple #10
0
        protected Guid Provision(CourseProvisioningInfo courseInfo)
        {
            Guid provisionedID = Guid.Empty;

            try
            {
                using (var clientData = new ClientDataProxy())
                {
                    CourseInfo provisionedCourse = clientData.ProvisionCourse(courseInfo, Util.GetUserKey(), Util.GetAuthCode());
                    if (provisionedCourse != null)
                    {
                        provisionedID = provisionedCourse.PublicID;
                    }
                }

                if (provisionedID != Guid.Empty)
                {
                    // Strip instance name and ":" to get Angel course ID
                    string courseID = Util.GetCourseIDFromExternalCourseID(courseInfo.ExternalCourseID);

                    Util.SetPanoptoCourseID(courseID, provisionedID);
                }
                else
                {
                    // Log
                    new FrameworkException("Error provisioning course: " + courseInfo.LongName, ExceptionSeverity.Warning);
                }
            }
            catch (Exception ex)
            {
                // Log
                new FrameworkException("Error provisioning course: " + courseInfo.LongName, ex, ExceptionSeverity.Warning);
            }

            return(provisionedID);
        }