• 第二十四章 源代码文件 REST API 参考(六)


    第二十四章 源代码文件 REST API 参考(六)

    Compile

    此方法编译源代码文件。它允许一次编译多个源代码文件。它返回一个对应源代码文件对象的数组

    要编译的文件列表作为 JSON 数组在 http 请求的正文中传递。例如,[ "%Api.DocDB.cls", ... ]

    有关示例和其他详细信息,请参阅本手册教程章节中的编译文件。

    URL

    POST http://server:port/api/atelier/v1/namespace/action/compile

    此调用需要标头 Content-Type application/json

    URL Parameters

    • 可以传递 URL 参数“flags”(默认为“cuk”),该参数将传递给编译器。

    • 如果不希望返回已编译的源代码文件的源,则可以使用值 0 传递 URL 参数 'source'

    JSON Messages

    以下是编译 Atelier.NewClass1 时返回的内容:

    {
      "status": {
        "errors": [],
        "summary": ""
      },
      "console": [
        "Compilation started on 01/12/2016 17:44:00 with qualifiers 'cuk'",
        "Compiling class Atelier.NewClass1",
        "Compiling table Atelier.NewClass1",
        "Compiling routine Atelier.NewClass1.1",
        "Compilation finished successfully in 0.067s.",
        ""
      ],
      "result": {
        "content": [
          {
            "name": "Atelier.NewClass1.cls",
            "status": "",
            "content": [
              "Storage Default",
              "{",
              "",
              "",
              "%%CLASSNAME",
              "",
              "",
              "^Atelier.NewClass1D",
              "NewClass1DefaultData",
              "^Atelier.NewClass1D",
              "^Atelier.NewClass1I",
              "^Atelier.NewClass1S",
              "%Storage.Persistent",
              "}",
              ""
            ],
            "db": "IRISSYS",
            "ts": "2016-01-12 17:44:00.053",
            "enc": false,
            "flags": 1
          }
        ]
      }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43

    与源代码文件有关的错误将出现在每个源代码文件对象的状态属性中。

    如果编译持久类导致存储定义更改,则存储定义作为源代码文件对象的内容返回。否则结果内容将为空。

    HTTP Return Codes

    • HTTP 200 如果正常。
    • 如果资源名称是无效的源代码文件名,则返回 HTTP 400
    • 如果找不到资源,则返回 HTTP 404
    • 如果源代码文件被锁定,HTTP 423
    • HTTP 500 如果发生意外错误(详细信息将在状态错误数组中)。

    Index

    此方法返回指定源代码文件的摘要信息。应用程序可以使用此信息来创建源代码文件的索引。它返回一个索引源代码文件对象数组。

    要索引的源代码文件列表在 http 请求的正文中传递。请求正文是源代码文件名称的 JSON 数组。例如,[ "%Api.DocDB.cls", ... ]

    URL

    POST http://server:port/api/atelier/v1/namespace/action/index

    此调用需要标头 Content-Type application/json

    JSON Messages

    与源代码文件有关的错误位于每个源代码文件对象的状态属性中。返回的数组包含与服务器上源代码文件的结构和文档相关的信息。它会因源代码文件所属的类别而异。以下是一个类(类别 CLS)的示例。 (目前我们只支持类的索引。):

    {
      "status": {
        "errors": [],
        "summary": ""
      },
      "console": [],
      "result": {
        "content": [
          {
            "name": "%Activate.GenericObject.cls",
            "db": "IRISLIB",
            "ts": "2016-01-04 14:00:04.000",
            "gen": false,
            "others": [
              "%Activate.GenericObject.1.INT"
            ],
            "cat": "CLS",
            "content": {
              "desc": "This class provides functionality to create an ActiveX object, invoke its methods and Get/Set its properties by name.",
              "depl": false,
              "depr": false,
              "final": false,
              "hidden": false,
              "super": [
                "%Activate.IDispatch"
              ],
              "methods": [
                {
                  "name": "CreateObject",
                  "desc": "This method is used to create a generic object given only its progid. If the object cannot be found an exception is thrown. 
                           The return value should be tested against $$$NULLOREF  in the usual manner to ensure that the object has been successfully created",
                  "depr": false,
                  "final": true,
                  "internal": false,
                  "private": false,
                  "scope": "class",
                  "returntype": "%Library.RegisteredObject",
                  "args": [
                    {
                      "name": "Progid",
                      "type": "%Library.String"
                    }
                  ]
                },
                {
                  "name": "GetObject",
                  "desc": "This method is used to create a generic object from a moniker. If the object cannot be found an exception is thrown. 
                           The return value should be tested against $$$NULLOREF  in the usual manner to ensure that the object has been successfully created.",
                  "depr": false,
                  "final": true,
                  "internal": false,
                  "private": false,
                  "scope": "class",
                  "returntype": "%Library.RegisteredObject",
                  "args": [
                    {
                      "name": "Moniker",
                      "type": "%Library.String"
                    }
                  ]
                }
              ],
              "parameters": [],
              "properties": []
            },
            "status": ""
          }
        ]
      }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70

    HTTP 返回码

    • HTTP 200 如果正常。
    • 如果传递的内容类型不是 application/json,则 HTTP 415
    • HTTP 500 如果发生意外错误(详细信息将在状态错误数组中)。
  • 相关阅读:
    kubernetes之Deployment
    Flutter 教程之高效且精美的滚动组件Slivers (教程含源码)
    npm与Maven:前端与后端构建工具深度对比学习
    18.基于Consul的服务发现和ConsulManager管理
    Keras深度学习实战(16)——自编码器详解
    大数据可视化是什么?
    java计算机毕业设计小王防疫副食品配送商城源程序+mysql+系统+lw文档+远程调试
    伸缩升降料箱机器人HEGERLS A42T|灵活覆盖超广立体存储空间|大幅提升仓储利用率
    直通大厂!2022最新分布式、MySQL、JVM调优指南,助你实现大厂梦
    编程软件大全(下载+安装+破解)
  • 原文地址:https://blog.csdn.net/yaoxin521123/article/details/126296844