public static async Task <ApiStatusWithSco> ScoGenericOperation(AdobeConnectXmlAPI adobeConnectXmlApi, Sco sco, string operation) { var response = ApiStatusWithSco.FromApiStatus(await adobeConnectXmlApi.ProcessApiRequest(operation, Helpers.StructToQueryString(sco, true))); if (response.Code != StatusCodes.OK || response.ResultDocument == null) { return(response); } XElement scoNode = response.ResultDocument.XPathSelectElement("//sco"); if (scoNode == null) { return(response); } try { response.Sco = XmlSerializerHelpersGeneric.FromXML <Sco>(scoNode.CreateReader()); response.Sco.FullUrl = adobeConnectXmlApi.ResolveFullUrl(response.Sco.UrlPath); } catch (Exception ex) { response.Code = StatusCodes.Invalid; response.SubCode = StatusSubCodes.Format; response.InnerException = ex; throw ex.InnerException; } return(response); }
public static async Task <EnumerableResultStatus <Sco> > GetFolderContents(this AdobeConnectXmlAPI adobeConnectXmlApi, string folderId) { var s = await adobeConnectXmlApi.ProcessApiRequest("sco-contents", String.Format("sco-id={0}", folderId)); var result = Helpers.WrapBaseStatusInfo <EnumerableResultStatus <Sco> >(s); if (s.Code != StatusCodes.OK || s.ResultDocument == null) { return(result); } var scoList = s.ResultDocument.XPathSelectElements("//sco"); if (scoList == null) { return(result); } result.Result = scoList.Select(scoNode => { var sco = XmlSerializerHelpersGeneric.FromXML <Sco>(scoNode.CreateReader()); sco.FullUrl = adobeConnectXmlApi.ResolveFullUrl(sco.UrlPath); return(sco); }).ToList(); return(result); }
/// <summary> /// Provides information about a SCO on Connect Enterprise. The object can have any valid /// SCO Type. See Type for a list of the allowed SCO types. /// The response includes the account the SCO belongs to, the dates it was created and last /// modified, the owner, the URL that reaches it, and other data. For some types of SCOs, the /// response also includes information about a template from which this SCO was created. /// </summary> /// <param name="adobeConnectXmlApi">The adobe connect XML API.</param> /// <param name="scoId">Meeting id</param> /// <returns> /// <see cref="EnumerableResultStatus{T}" /> /// </returns> public static MeetingDetailStatus GetMeetingDetail(this AdobeConnectXmlAPI adobeConnectXmlApi, string scoId) { ApiStatus s = adobeConnectXmlApi.ProcessApiRequest("sco-info", String.Format("sco-id={0}", scoId)); var resultStatus = Helpers.WrapBaseStatusInfo <MeetingDetailStatus>(s); if (s.Code != StatusCodes.OK || s.ResultDocument == null) { return(resultStatus); } try { XElement nodeData = s.ResultDocument.XPathSelectElement("//sco"); if (nodeData == null || !nodeData.HasElements) { return(null); } resultStatus.Result = XmlSerializerHelpersGeneric.FromXML <MeetingDetail>(nodeData.CreateReader(), new XmlRootAttribute("sco")); resultStatus.Result.FullUrl = adobeConnectXmlApi.ResolveFullUrl(resultStatus.Result.UrlPath); return(resultStatus); } catch (Exception ex) { throw; } }