Esempio n. 1
0
        static public List <RProjectExecution> getHistory(RProjectDetails details, ProjectHistoryOptions options, RClient client, String uri)
        {
            StringBuilder data = new StringBuilder();

            //create the input String
            data.Append(Constants.FORMAT_JSON);
            data.Append("&project=" + HttpUtility.UrlEncode(details.id));
            if (!(options == null))
            {
                if (options.depthFilter < 1 || options.depthFilter > 500)
                {
                    options.depthFilter = 250;
                }
                data.Append("&filterdepth=" + options.depthFilter.ToString());
                data.Append("&filtertag=" + HttpUtility.UrlEncode(options.tagfilter));
                data.Append("&reversed=" + options.reversed.ToString());
            }
            else
            {
                data.Append("&filterdepth=250");
            }
            //call the server
            JSONResponse jresponse = HTTPUtilities.callRESTGet(uri, data.ToString(), ref client);

            List <RProjectExecution> returnValue = new List <RProjectExecution>();

            if (!(jresponse.JSONMarkup["history"] == null))
            {
                JArray jvalues = jresponse.JSONMarkup["history"].Value <JArray>();
                foreach (var j in jvalues)
                {
                    if (j.Type != JTokenType.Null)
                    {
                        returnValue.Add(new RProjectExecution(new JSONResponse(j.Value <JObject>(), true, "", 0), client));
                    }
                }
            }

            return(returnValue);
        }
        /// <summary>
        /// Retrieve execution history on project
        /// </summary>
        /// <param name="options">Options for returning the History</param>
        /// <returns>List of RProjectExecution objects</returns>
        /// <remarks></remarks>
        public List<RProjectExecution> getHistory(ProjectHistoryOptions options)
        {
            List<RProjectExecution>  returnValue = RProjectExecuteImpl.getHistory(m_projectDetails, options, m_client, Constants.RPROJECTEXECUTEHISTORY);

            return returnValue;
        }
        public static List<RProjectExecution> getHistory(RProjectDetails details, ProjectHistoryOptions options, RClient client, String uri)
        {
            StringBuilder data = new StringBuilder();

            //create the input String
            data.Append(Constants.FORMAT_JSON);
            data.Append("&project=" + HttpUtility.UrlEncode(details.id));
            if (!(options == null))
            {
                if (options.depthFilter < 1 || options.depthFilter > 500)
                {
                    options.depthFilter = 250;
                }
                data.Append("&filterdepth=" + options.depthFilter.ToString());
                data.Append("&filtertag=" + HttpUtility.UrlEncode(options.tagfilter));
                data.Append("&reversed=" + options.reversed.ToString());
            }
            else
            {
                data.Append("&filterdepth=250");
            }
            //call the server
            JSONResponse jresponse = HTTPUtilities.callRESTGet(uri, data.ToString(), ref client);

            List<RProjectExecution> returnValue = new List<RProjectExecution>();

            if (!(jresponse.JSONMarkup["history"] == null))
            {
                JArray jvalues = jresponse.JSONMarkup["history"].Value<JArray>();
                foreach (var j in jvalues)
                {
                    if (j.Type != JTokenType.Null)
                    {
                        returnValue.Add(new RProjectExecution(new JSONResponse(j.Value<JObject>(), true, "", 0), client));
                    }
                }
            }

            return returnValue;
        }
        /// <summary>
        /// Retrieve execution history on project
        /// </summary>
        /// <param name="options">Options for returning the History</param>
        /// <returns>List of RProjectExecution objects</returns>
        /// <remarks></remarks>
        public List <RProjectExecution> getHistory(ProjectHistoryOptions options)
        {
            List <RProjectExecution> returnValue = RProjectExecuteImpl.getHistory(m_projectDetails, options, m_client, Constants.RPROJECTEXECUTEHISTORY);

            return(returnValue);
        }