Exemplo n.º 1
0
        private CollectionResult <T> GetCollection <T>(string command, string args, string xmlRootName, string xmlElementName, Func <XmlNode, T> elementParser)
        {
            StatusInfo status;

            var doc = this.requestProcessor.Process(command, args, out status);

            return(ResponseIsOk(doc, status)
                       ? new CollectionResult <T>(status, GenericCollectionParser <T> .Parse(
                                                      doc.SelectSingleNode(xmlRootName), xmlElementName, elementParser))
                       : new CollectionResult <T>(status));
        }
Exemplo n.º 2
0
        //public EventCollectionResult ReportMyEvents(int startIndex = 0, int limit = 0)
        //{
        //    // act: "report-my-events"
        //    StatusInfo status;

        //    var doc = this.requestProcessor.Process(Commands.ReportMyEvents, string.Empty.AppendPagingIfNeeded(startIndex, limit).TrimStart('&'), out status);

        //    return ResponseIsOk(doc, status)
        //        ? new EventCollectionResult(status, EventInfoCollectionParser.Parse(doc))
        //        : new EventCollectionResult(status);
        //}

        public CollectionResult <TrainingItem> ReportMyTraining(string filter = "", int startIndex = 0, int limit = 0)
        {
            filter = filter
                     .AppendSortingIfNeeded("date-begin", SortOrder.Descending) //default sorting in AC, otherwise paging might be incorrect
                     .AppendPagingIfNeeded(startIndex, limit);

            var doc = this.requestProcessor.Process(Commands.ReportMyTraining, filter, out StatusInfo status);

            return(ResponseIsOk(doc, status)
                ? new CollectionResult <TrainingItem>(status, GenericCollectionParser <TrainingItem> .Parse(
                                                          doc.SelectSingleNode("//report-my-training"), "row", TrainingItemParser.Parse))
                : new CollectionResult <TrainingItem>(status));
        }
Exemplo n.º 3
0
        // https://helpx.adobe.com/adobe-connect/webservices/notification-list.html
        public CollectionResult <EventNotification> EventNotificationList(string eventScoId)
        {
            if (string.IsNullOrWhiteSpace(eventScoId))
            {
                throw new ArgumentException("Non-empty value expected", nameof(eventScoId));
            }

            var requestString = $"sco-id={eventScoId}&target-acl-id={eventScoId}";

            StatusInfo status;
            var        doc = this.requestProcessor.Process(Commands.Event.NotificationList, requestString, out status);

            return(ResponseIsOk(doc, status)
                ? new CollectionResult <EventNotification>(status, GenericCollectionParser <EventNotification> .Parse(doc.SelectSingleNode("//notification-list"), "notification", EventNotificationParser.Parse))
                : new CollectionResult <EventNotification>(status));
        }