Ejemplo n.º 1
0
        public TelephonyProfileInfoResult TelephonyProfileUpdate(TelephonyProfileUpdateItem updateItem, bool isUpdate)
        {
            // act: "telephony-profile-update"
            if (updateItem == null)
            {
                throw new ArgumentNullException(nameof(updateItem));
            }

            var commandParams = QueryStringBuilder.EntityToQueryString(updateItem);

            if (updateItem.ProviderFields != null)
            {
                commandParams += updateItem.ProviderFields.ToQueryString();
            }

            StatusInfo status;
            var        doc = this.requestProcessor.Process(Commands.Telephony.ProfileUpdate, commandParams, out status);

            if (!ResponseIsOk(doc, status))
            {
                return(new TelephonyProfileInfoResult(status));
            }

            if (isUpdate)
            {
                return(this.TelephonyProfileInfo(updateItem.ProfileId));
            }

            // notice: no 'profile' will be returned during update!!
            //https://helpx.adobe.com/adobe-connect/webservices/telephony-provider-update.html
            var detailNode = doc.SelectSingleNode("results/telephony-profile");

            if (detailNode == null || detailNode.Attributes == null)
            {
                return(new TelephonyProfileInfoResult(status));
            }

            TelephonyProfile detail = null;

            try
            {
                detail = TelephonyProfileParser.Parse(detailNode);
            }
            catch (Exception ex)
            {
                TraceTool.TraceException(ex);
                status.Code    = StatusCodes.invalid;
                status.SubCode = StatusSubCodes.format;
                status.UnderlyingExceptionInfo = ex;
            }

            return(new TelephonyProfileInfoResult(status, detail));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates metadata for a SCO, or updates existing metadata describing a SCO.
        /// Call SCO-update to create metadata only for SCOs that represent content, including
        /// meetings. You also need to upload content files with either SCO-upload or Connect Enterprise Manager.
        /// You must provide a folder-id or a SCO id, but not both. If you pass a folder-id, SCO-update
        /// creates a new SCO and returns a SCO id. If the SCO already exists and you pass a
        /// SCO-id, SCO-update updates the metadata describing the SCO.
        /// After you create a new SCO with SCO-update, call permissions-update to specify which
        /// users and groups can access it.
        /// </summary>
        /// <typeparam name="T">
        /// Base update item.
        /// </typeparam>
        /// <param name="meetingUpdateItem">
        /// The meeting item.
        /// </param>
        /// <param name="isUpdate">
        /// Is Update.
        /// </param>
        /// <returns>
        /// Save Meeting Result.
        /// </returns>
        private ScoInfoResult ScoUpdate <T>(T meetingUpdateItem, bool isUpdate)
            where T : ScoUpdateItemBase
        {
            if (meetingUpdateItem == null)
            {
                return(null);
            }

            //if (string.IsNullOrEmpty(scoUpdateItem.FolderId))
            //{
            //    return new ScoInfoResult(CreateStatusInfo(StatusCodes.invalid, StatusSubCodes.format, new ArgumentNullException("scoUpdateItem", "FolderId must be set to create new item")));
            //}

            var commandParams = QueryStringBuilder.EntityToQueryString(meetingUpdateItem, isUpdate);

            StatusInfo status;
            var        doc = this.requestProcessor.Process(Commands.Sco.Update, commandParams, out status);

            if (!ResponseIsOk(doc, status))
            {
                return(new ScoInfoResult(status));
            }

            if (isUpdate)
            {
                return(this.GetScoInfo(meetingUpdateItem.ScoId));
            }

            // notice: no '/sco' will be returned during update
            var detailNode = doc.SelectSingleNode(ScoHome);

            if (detailNode == null || detailNode.Attributes == null)
            {
                return(new ScoInfoResult(status));
            }

            ScoInfo meetingDetail = null;

            try
            {
                meetingDetail = ScoInfoParser.Parse(detailNode);
            }
            catch (Exception ex)
            {
                TraceTool.TraceException(ex);
                status.Code    = StatusCodes.invalid;
                status.SubCode = StatusSubCodes.format;
                status.UnderlyingExceptionInfo = ex;
            }

            return(new ScoInfoResult(status, meetingDetail));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Performs login procedure.
        /// </summary>
        /// <param name="login">Valid Adobe Connect account name.</param>
        /// <param name="password">Valid Adobe Connect account password.</param>
        /// <param name="status">After successful login, <see cref="StatusInfo">status</see> contains session ID to be used for single-sign-on.</param>
        /// <param name="accountId"></param>
        /// <returns><see cref="bool"/>Success or not.</returns>
        private bool LoginInternal(string login, string password, string accountId, out StatusInfo status)
        {
            // action=login&[email protected]&password=football&session=
            // cookie: BREEZESESSION
            status = new StatusInfo();

            try
            {
                string parameters;
                if (string.IsNullOrEmpty(accountId))
                {
                    parameters = string.Format(
                        CommandParams.LoginParams,
                        UrlEncode(login),
                        UrlEncode(password));
                }
                else
                {
                    parameters = string.Format(
                        CommandParams.LoginWithAccountParams,
                        UrlEncode(login),
                        UrlEncode(password),
                        UrlEncode(accountId));
                }

                var doc = this.requestProcessor.Process(
                    Commands.Login,
                    parameters,
                    out status);

                return(ResponseIsOk(doc, status));
            }
            catch (InvalidSchemeException)
            {
                throw;
            }
            catch (Exception ex)
            {
                status.UnderlyingExceptionInfo = ex;
                TraceTool.TraceException(ex);
            }

            return(false);
        }