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

网友投稿 578 2022-09-30

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

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

文章目录

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

​​URL​​​​`URL Parameters`​​​​jsON Messages​​​​HTTP Return Codes​​

​​Index​​

​​URL​​​​JSON Messages​​​​HTTP 返回码​​

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

Compile

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

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

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

URL

​​POST ​​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 } ] }}

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

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

HTTP Return Codes

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

Index

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

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

URL

​​POST ​​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. the object cannot be found an exception is thrown. 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. the object cannot be found an exception is thrown. 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": "" } ] }}

HTTP 返回码

​​HTTP 200​​ 如果正常。如果传递的内容类型不是​​application/json​​​,则​​HTTP 415​​。​​HTTP 500​​ 如果发生意外错误(详细信息将在状态错误数组中)。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:requestAnimationFrame实现浏览器动画
下一篇:分享几款常用的小程序开发框架(小程序的基本框架)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~