コード例 #1
0
        }//GetIdByTitle

        public IsPageExistsResponse IsPageExists(IsPageExistsRequest request)
        {
            IsPageExistsResponse response = new IsPageExistsResponse();

            try
            {
                response.IsPageExistsResult =
                    new ConfluenceAPIMetodusok().IsPageExists(
                        request.URL
                        , request.PageId
                        , request.SpaceKey
                        , request.Username
                        , request.Password
                        );

                if (response.IsPageExistsResult.FailedResponse == null)
                {
                    response.Result = new Ac4yProcessResult()
                    {
                        Code = Ac4yProcessResult.SUCCESS
                    };
                }
                else
                {
                    response.Result = new Ac4yProcessResult()
                    {
                        Code = Ac4yProcessResult.FAIL, Message = "Nincs ilyen nevű oldal!"
                    };
                }
            }
            catch (Exception exception)
            {
                response.Result = (new Ac4yProcessResult()
                {
                    Code = Ac4yProcessResult.FAIL, Message = exception.Message, Description = exception.StackTrace
                });
            }
            return(response);
        }//IsPageExists
コード例 #2
0
        }//IsPageExists

        public IsPageExistsCompositeResponse IsPageExistsComposite(IsPageExistsCompositeRequest request)
        {
            IsPageExistsCompositeResponse response = new IsPageExistsCompositeResponse();

            try
            {
                GetIdByTitleResponse getIdByTitleResponse =
                    GetIdByTitle(new GetIdByTitleRequest()
                {
                    Password    = request.Password
                    , PageTitle = request.PageTitle
                    , Username  = request.Username
                    , URL       = request.URL
                    , SpaceKey  = request.SpaceKey
                });

                if (getIdByTitleResponse.Result.Success())
                {
                    IsPageExistsResponse isPageExistsResponse =
                        IsPageExists(new IsPageExistsRequest()
                    {
                        Password = request.Password
                        ,
                        Username = request.Username
                        ,
                        URL = request.URL
                        ,
                        SpaceKey = request.SpaceKey
                        ,
                        PageId = getIdByTitleResponse.GetIdByTitleResult.SuccessResponse.Results[0].Id.ToString()
                    });

                    response.isPageExistsResult = isPageExistsResponse.IsPageExistsResult;
                    if (isPageExistsResponse.IsPageExistsResult.FailedResponse == null)
                    {
                        response.Result = new Ac4yProcessResult()
                        {
                            Code = Ac4yProcessResult.SUCCESS
                        };
                    }
                    else
                    {
                        response.Result = new Ac4yProcessResult()
                        {
                            Code = Ac4yProcessResult.FAIL, Message = "Nincs ilyen nevű oldal!"
                        };
                    }
                }
                else
                {
                    response.Result = new Ac4yProcessResult()
                    {
                        Code = Ac4yProcessResult.FAIL, Message = "Nincs ilyen nevű oldal! Nincs ID!"
                    };
                }
            }
            catch (Exception exception)
            {
                response.Result = (new Ac4yProcessResult()
                {
                    Code = Ac4yProcessResult.FAIL, Message = exception.Message, Description = exception.StackTrace
                });
            }
            return(response);
        }//IsPageExistsComposite