public static void parseProjectExecution(JSONResponse jresponse, ref RProjectExecutionDetails executionDetails, ref RProjectDetails projectDetails, RClient client)
        {
            List<RProjectFile> projectfiles = new List<RProjectFile>();
            List<RRepositoryFile> repositoryFiles = new List<RRepositoryFile>();
            List<RProjectResult> results = new List<RProjectResult>();
            List<String> warnings = new List<String>();
            List<RData> workspaceObjects = new List<RData>();
            JArray jvalues;
            JObject jrepo;

            if (!(jresponse.JSONMarkup["execution"] == null))
            {
                JObject jscriptexec = jresponse.JSONMarkup["execution"].Value<JObject>();

                String code = JSONUtilities.trimXtraQuotes(jscriptexec["code"].Value<string>());
                long timeStart = jscriptexec["timeStart"].Value<long>();
                long timeCode = jscriptexec["timeCode"].Value<long>();
                long timeTotal = jscriptexec["timeTotal"].Value<long>();
                String tag = JSONUtilities.trimXtraQuotes(jscriptexec["tag"].Value<string>());
                String console = JSONUtilities.trimXtraQuotes(jscriptexec["console"].Value<string>());
                String errorDescr = jresponse.ErrorMsg;
                int errorCode = jresponse.ErrorCode;
                String id = JSONUtilities.trimXtraQuotes(jscriptexec["execution"].Value<string>());
                Boolean interrupted = Convert.ToBoolean(jscriptexec["interrupted"].Value<string>());

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

                if (!(jscriptexec["artifacts"] == null))
                {
                    jvalues = jscriptexec["artifacts"].Value<JArray>();
                    foreach (var j in jvalues)
                    {
                        if (j.Type != JTokenType.Null)
                        {
                            projectfiles.Add(new RProjectFile(new JSONResponse(j.Value<JObject>(), true, "", 0), client, id));
                        }
                    }
                }

                if (!(jscriptexec["warnings"] == null))
                {
                    jvalues = jscriptexec["warnings"].Value<JArray>();
                    foreach (var j in jvalues)
                    {
                        if (j.Type != JTokenType.Null)
                        {
                            warnings.Add(j.Value<string>());
                        }
                    }
                }

                if (!(jscriptexec["repository"] == null))
                {
                    jrepo = jscriptexec["repository"].Value<JObject>();

                    if (!(jrepo["files"] == null))
                    {
                        jvalues = jrepo["files"].Value<JArray>();
                        foreach (var j in jvalues)
                        {
                            if (j.Type != JTokenType.Null)
                            {
                                repositoryFiles.Add(new RRepositoryFile(new JSONResponse(j.Value<JObject>(), true, "", 0), client));
                            }
                        }
                    }
                }

                workspaceObjects = JSONUtilities.parseRObjects(jresponse.JSONMarkup);
                parseProject(jresponse, ref projectDetails);

                executionDetails = new RProjectExecutionDetails(projectfiles, code, timeStart, timeCode, timeTotal, tag, console, errorDescr, errorCode, id, interrupted, null, results, warnings, workspaceObjects);

            }
        }
예제 #2
0
 private void parseScriptExecution(JSONResponse jresponse, ref RProjectExecutionDetails executionDetails, ref RProjectDetails projectDetails)
 {
     RProjectBaseImpl.parseProjectExecution(jresponse, ref executionDetails, ref projectDetails, m_client);
 }
 private void parseScriptExecution(JSONResponse jresponse, ref RProjectExecutionDetails executionDetails, ref RProjectDetails projectDetails)
 {
     RProjectBaseImpl.parseProjectExecution(jresponse, ref executionDetails, ref projectDetails, m_client);
 }
예제 #4
0
        static public void parseProjectExecution(JSONResponse jresponse, ref RProjectExecutionDetails executionDetails, ref RProjectDetails projectDetails, RClient client)
        {
            List <RProjectFile>    projectfiles     = new List <RProjectFile>();
            List <RRepositoryFile> repositoryFiles  = new List <RRepositoryFile>();
            List <RProjectResult>  results          = new List <RProjectResult>();
            List <String>          warnings         = new List <String>();
            List <RData>           workspaceObjects = new List <RData>();
            JArray  jvalues;
            JObject jrepo;

            if (!(jresponse.JSONMarkup["execution"] == null))
            {
                JObject jscriptexec = jresponse.JSONMarkup["execution"].Value <JObject>();

                String  code        = JSONUtilities.trimXtraQuotes(jscriptexec["code"].Value <string>());
                long    timeStart   = jscriptexec["timeStart"].Value <long>();
                long    timeCode    = jscriptexec["timeCode"].Value <long>();
                long    timeTotal   = jscriptexec["timeTotal"].Value <long>();
                String  tag         = JSONUtilities.trimXtraQuotes(jscriptexec["tag"].Value <string>());
                String  console     = JSONUtilities.trimXtraQuotes(jscriptexec["console"].Value <string>());
                String  errorDescr  = jresponse.ErrorMsg;
                int     errorCode   = jresponse.ErrorCode;
                String  id          = JSONUtilities.trimXtraQuotes(jscriptexec["execution"].Value <string>());
                Boolean interrupted = Convert.ToBoolean(jscriptexec["interrupted"].Value <string>());

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

                if (!(jscriptexec["artifacts"] == null))
                {
                    jvalues = jscriptexec["artifacts"].Value <JArray>();
                    foreach (var j in jvalues)
                    {
                        if (j.Type != JTokenType.Null)
                        {
                            projectfiles.Add(new RProjectFile(new JSONResponse(j.Value <JObject>(), true, "", 0), client, id));
                        }
                    }
                }

                if (!(jscriptexec["warnings"] == null))
                {
                    jvalues = jscriptexec["warnings"].Value <JArray>();
                    foreach (var j in jvalues)
                    {
                        if (j.Type != JTokenType.Null)
                        {
                            warnings.Add(j.Value <string>());
                        }
                    }
                }

                if (!(jscriptexec["repository"] == null))
                {
                    jrepo = jscriptexec["repository"].Value <JObject>();

                    if (!(jrepo["files"] == null))
                    {
                        jvalues = jrepo["files"].Value <JArray>();
                        foreach (var j in jvalues)
                        {
                            if (j.Type != JTokenType.Null)
                            {
                                repositoryFiles.Add(new RRepositoryFile(new JSONResponse(j.Value <JObject>(), true, "", 0), client));
                            }
                        }
                    }
                }

                workspaceObjects = JSONUtilities.parseRObjects(jresponse.JSONMarkup);
                parseProject(jresponse, ref projectDetails);

                executionDetails = new RProjectExecutionDetails(projectfiles, code, timeStart, timeCode, timeTotal, tag, console, errorDescr, errorCode, id, interrupted, null, results, warnings, workspaceObjects);
            }
        }