Skip to main content

%Api.Atelier.v4

class %Api.Atelier.v4 extends %Api.Atelier.v3

%Api.Atelier.v4 provides version 4 APIs for Atelier

Method Inventory

Methods

classmethod GetDoc(pNamespace As %String, pDocName As %String) as %Status
This method returns the text for the named document and namespace.

HTTP Codes returned:-

HTTP 200 if OK
HTTP 304 if the document has not been modified (see https://en.wikipedia.org/wiki/HTTP_ETag)
HTTP 400 if the named resource is not a valid document name
HTTP 404 if the document does not exist
HTTP 500 if an unxpected error occurs (details will be in status error array)

Return content will contain a document object.
Errors pertaining to the document will be in the status property of the document object. If source control hooks are enabled for the namespace any console output generated by the hook will be captured and returned as an array of lines in the 'console' array.

The result contains the name of the requested document, the database where it is stored, its timestamp and category (CLS - class, RTN - routine, CSP - csp, OTH - other), as well as the document contents which are returned in an array.

For text documents this will be an array of strings and the 'enc' json field will be set to false.
For binary documents this will be an array of base64 encoded chunks and the 'enc' field will be set to true.

The URL parameter ?binary=1 can be passed to force the document to be encoded as binary.

The URL parameter ?storageOnly=1 can be passed to return only the storage portion of a class.

The URL parameter ?format= can be passed to specify the source format. The choices are "udl" (the default), "udl-multiline" or "xml". Specifying "udl-multiline" will format method arguments on multiple lines.

If a 'soft' error occurs such as a 'document does not exist', additional information can be found in the 'status' field of the result. Examples of other soft errors are 'file is locked' etc.

Here is an example of the result of asking for %Activate.Enum.cls
{
  "status": {
    "errors": [],
    "summary": ""
  },
  "console": [],
  "result": {
    "name": "%Activate.Enum.cls",
    "db": "IRISLIB",
    "ts": "2016-01-04 14:00:04.000",
    "cat": "CLS",
    "status": "",
    "enc": false,
    "content": [
      "/// This class is the superclass for all enumerated types generated from",
      "/// a type library",
      "Class %Activate.Enum Extends %Integer [ Not ProcedureBlock, System = 3 ]",
      "{",
      "",
      "}",
      ""
    ]
  }
}

and here is the result with ?binary=1
{
  "status": {
    "errors": [],
    "summary": ""
  },
  "console": [],
  "result": {
    "name": "%Activate.Enum.cls",
    "db": "IRISLIB",
    "ts": "2016-01-04 14:00:04.000",
    "cat": "CLS",
    "status": "",
    "enc": true,
    "content": [
      "Ly8vIFRoaXMgY2xhc3MgaXMgdGhlIHN1cGVyY2xhc3MgZm9yIGFsbCBlbnVtZXJhdGVkIHR5cGVzIGdlbmVyYXRlZCBmcm9tCi8vLyBhIHR5cGUgbGlicmFyeQpDbGFzcyAlQWN0aXZhdGUuRW51bSBFeHRlbmRzICVJbnRlZ2VyIFsgTm90IFByb2NlZHVyZUJsb2NrLCBTeXN0ZW0gPSAzIF0KewoKfQo="
    ]
  }
}
classmethod Index(pNamespace As %String) as %Status
This method returns the indices for the all the specified documents in the namespace.
A list of documents to be indexed is passed in the body of the http request.
The request body is simply a JSON array of names of documents you want to index [ "%Activate.Enum.cls", ... ]

An optional label+offset location can be included at the end of a document name, delimited by a colon: [ "%Activate.Enum.cls:method+5", ... ]
If a location is provided for a document, the values in the "others" array in the response object will contain the
document name followed by a ':' and then the offset corresponding to the location in the requested document.

NOTE: Currently we only support the indexing of classes

HTTP Codes returned:-

HTTP 200 if OK
HTTP 415 if the we are not passed application/json as the content type
HTTP 500 if an error occurs (details will be in status error array)

Return content will be an array of index document objects. Errors pertaining to a document
will be in the status property of each document object. The index contains information relating
to the structure and documentation of documents on the server and will vary by the category to
which the document belongs. Below is an example for a class.
{
  "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\nand 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\ncannot be found an exception is thrown. The return value should be tested against\n$$$NULLOREF  in the usual manner to ensure that the object has been successfully\ncreated",
              "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\ncannot be found an exception is thrown. The return value should be tested against\n$$$NULLOREF  in the usual manner to ensure that the object has been successfully\ncreated.",
              "depr": false,
              "final": true,
              "internal": false,
              "private": false,
              "scope": "class",
              "returntype": "%Library.RegisteredObject",
              "args": [
                {
                  "name": "Moniker",
                  "type": "%Library.String"
                }
              ]
            }
          ],
          "parameters": [],
          "properties": []
        },
        "status": ""
      }
    ]
  }
}

Inherited Members

Inherited Methods

FeedbackOpens in a new tab