/// /// CREATE AN ACCOUNT FOR THIS INSTRUCTOR /// public void CreateAccount() { string url = @"principal-update&first-name=" + _first_name + "&last-name=" + _last_name + "&login="******"&password=byuitemp123&type=user&send-email=true&has-children=0&email=" + _email; string pid = ""; string url2 = @"group-membership-update&group-id=" + Program._xDoc.SelectSingleNode("//*[@id='_6']").InnerText + "&is-member=true&principal-id="; XmlDocument xmlDoc = API.GetXMLRequest(url); string attrVal = xmlDoc.SelectSingleNode("/results/status/@code").Value; if (attrVal != "ok") { LogInformation.AddLineToLogInformation("Error", "Error returned from Adobe Connect when creating an instructor account for " + _last_name + ", " + _first_name); AsyncTracker.EventDone(); return; } pid = xmlDoc.SelectSingleNode("/results/principal/@principal-id").Value; xmlDoc = API.GetXMLRequest(url2 + pid); CreateOffice(); }
/// /// PLACE PERMISSIONS ON THE MEETING AND THE INSTRUCTOR /// public void SetPermissions() { string url = @"permissions-update&principal-id=" + Program._xDoc.SelectSingleNode("//*[@id='_4']").InnerText + "&acl-id=" + _sco_id + "&permission-id=host"; string url2 = @"permissions-update&acl-id=" + _sco_id + "&principal-id=public-access&permission-id=view-hidden"; XmlDocument xmlDoc = API.GetXMLRequest(url); string attrVal = xmlDoc.SelectSingleNode("/results/status/@code").Value; if (attrVal != "ok") { LogInformation.AddLineToLogInformation("Error", "Error returned from Adobe Connect when setting the first permission (meeting host) for the instructor: " + _last_name + ", " + _first_name); AsyncTracker.EventDone(); return; } xmlDoc = API.GetXMLRequest(url2); attrVal = xmlDoc.SelectSingleNode("/results/status/@code").Value; AsyncTracker.EventDone(); if (attrVal != "ok") { LogInformation.AddLineToLogInformation("Error", "Error returned from Adobe Connect when setting the second permission (public access) for the instructor: " + _last_name + ", " + _first_name); return; } _bgw.ReportProgress(1); AsyncTracker.EventDone(); }
///////////////////////////// // SECTION LEVEL FUNCTIONS // ///////////////////////////// /// /// SECTION MEETING CREATION /// public void CreateSetMeetings(string course) { string set; if (_section_indicator.Length < 2) { set = "G00" + _section_indicator; } else if (_section_indicator.Length < 3) { set = "G0" + _section_indicator; } else { set = "G" + _section_indicator; } string name = course.Replace("_", "") + "_" + set + "_"; for (int i = 1; i <= _number_of_meetings; i++) { string tag; if (i < 10) { tag = name + "00" + i; } else if (i < 100) { tag = name + "0" + i; } else { tag = name + i; } string path = @"sco-update&type=meeting&name=" + tag.ToUpper() + "&folder-id=" + _folder_id + "&date-begin=" + DateTime.UtcNow.ToString("s") + "&date-end=" + DateTime.UtcNow.AddHours(1).ToString("s") + "&url-path=" + tag.ToLower() + "&principal-id=public-access&permission-id=view-hidden"; XmlDocument xmlDoc = API.GetXMLRequest(path); string attrVal = xmlDoc.SelectSingleNode("/results/status/@code").Value; if (attrVal != "ok") { LogInformation.AddLineToLogInformation("Error", "Error returned from Adobe Connect when creating section meetings for " + _section_indicator + " in " + course); AsyncTracker.EventDone(); return; } XmlNodeList item = xmlDoc.GetElementsByTagName("sco"); _meeting_id = item[0].Attributes["sco-id"].Value; EnrollInstructor(); _bgw.ReportProgress(1); AsyncTracker.EventDone(); } }
/// /// CREATE THE SECTION FOLDERS WITHIN THE COURSE FOLDER /// public void SetFolderCreation() { XmlDocument xmlDoc = API.GetXMLRequest(_set_url); string attrVal = xmlDoc.SelectSingleNode("/results/status/@code").Value; if (attrVal != "ok") { LogInformation.AddLineToLogInformation("Error", "Error returned from Adobe Connect when creating a section folder for the course: " + _name); AsyncTracker.EventDone(); return; } for (int i = 0; i < _sections.Count; i++) { bool valid = true; Section section = _sections[i]; string set = (section.GetSectionIndicator().Length < 2 ? "SET_0" : "SET_") + section.GetSectionIndicator(); XmlNodeList itemRefList = xmlDoc.GetElementsByTagName("sco"); foreach (XmlNode xn in itemRefList) { if (xn.FirstChild.InnerText == set) { LogInformation.AddLineToLogInformation("Error", "Section " + _sections[i].GetSectionIndicator() + " for " + _name + " already exists and was skipped."); for (int k = 0; k < _sections[i].GetNumberOfMeetings(); k++) { AsyncTracker.EventDone(); } valid = false; } } if (valid) { string path2 = @"sco-update&type=folder&name=" + (section.GetSectionIndicator().Length < 2 ? "SET_0" : "SET_") + section.GetSectionIndicator() + "&folder-id=" + _sco_id + "&depth=1"; xmlDoc = API.GetXMLRequest(path2); attrVal = xmlDoc.SelectSingleNode("/results/status/@code").Value; if (attrVal != "ok") { LogInformation.AddLineToLogInformation("Error", "Error returned from Adobe Connect when creating an section folder for the course: " + _name); AsyncTracker.EventDone(); return; } XmlNodeList item2 = xmlDoc.GetElementsByTagName("sco"); string folderId = item2[0].Attributes["sco-id"].Value; _sections[i].SetFolderId(folderId); _sections[i].CreateSetMeetings(_name); } } }
/// /// CREATE AN OFFICE FOR THIS INSTRUCTOR /// public void CreateOffice() { string officePath = _office_name.ToLower(); string url = @"sco-update&type=meeting&name=" + _office_name + "&folder-id=" + Program._xDoc.SelectSingleNode("//*[@id='_5']").InnerText + "&date-begin=" + DateTime.UtcNow.ToString("s") + "Z" + "&date-end=" + DateTime.UtcNow.AddHours(1).ToString("s") + "Z" + "&url-path=" + officePath + "&principal-id=public-access&permission-id=view-hidden"; XmlDocument xmlDoc = API.GetXMLRequest(url); string attrVal = xmlDoc.SelectSingleNode("/results/status/@code").Value; if (attrVal != "ok") { LogInformation.AddLineToLogInformation("Error", "Error returned from Adobe Connect when creating an instructor office for " + _last_name + ", " + _first_name); AsyncTracker.EventDone(); return; } _sco_id = xmlDoc.SelectSingleNode("results/sco/@sco-id").Value; SetPermissions(); }