Skip to main content

%Api.Atelier.v7

class %Api.Atelier.v7 extends %Api.Atelier.v6

%Api.Atelier.v7 provides version 7 APIs for Atelier

Method Inventory

Methods

classmethod ExportToXMLFile(pNamespace As %String) as %Status
This method gets the text of one or more documents in a single legacy XML file.

The method expects a content body to be encoded in JSON and contain an
array of items (document names) to be exported. Note that items may also
use ? or * wild cards and if you wish to exclude items pass ' before the item name:
[ "User.Test.cls", "abc*.mac" ]

HTTP Codes returned:-

HTTP 200 if OK
HTTP 400 if the posted content is empty or not valid json
HTTP 415 if content type is not application/json
HTTP 500 if an error occurs (details will be in status error array)

Returned content is an array of lines of the legacy XML file:
{
  "status": {
    "errors": [],
    "summary": ""
  },
  "console": [],
  "result": {
    "content": [
      "<?xml version="1.0" encoding="UTF-8"?>",
      ...
    ]
  }
}
classmethod ListDocumentsInXMLFiles(pNamespace As %String) as %Status
This method gets the names and timestamps of documents contained in legacy XML files.

The method expects a content body to be encoded in JSON and contain an array of objects, one for each XML file. Each object must contain a string to identify the file (for example, its filesystem path) and a content array containing the lines of the file:
[
  {
    "file": "/path/to/file.xml",
    "content": [
      "<?xml version="1.0" encoding="UTF-8"?>",
      ...
    ]
  }
[

HTTP Codes returned:-

HTTP 200 if OK
HTTP 400 if the posted content is empty or not valid json
HTTP 415 if content type is not application/json
HTTP 500 if an error occurs (details will be in status error array)

Return content is an array of objects, one per XML file. Each object contains the identifier of the XML file, an array containing the names and timestamps of the documents, and a status string if an error occurred while processing it:
{
  "status": {
    "errors": [],
    "summary": ""
  },
  "console": [],
  "result": {
    "content": [
      {
        "file": "/path/to/file.xml",
        "status": "",
        "documents": [
          {
            "name": "User.Test.cls",
            "ts": "2016-01-04 14:00:04.000"
          }
        ]
      }
    ]
  }
}
NOTE: If you are experiencing timeouts using this method, consider calling method Load() in class %SYSTEM.OBJ from a terminal instead.
classmethod LoadXMLFiles(pNamespace As %String) as %Status
This method loads and optionally compiles the selected documents within legacy XML files.

The method expects a content body to be encoded in JSON and contain an array of objects, one for each XML file. Each object must contain a string to identify the file (for example, its filesystem path) and a content array containing the lines of the file. An array of specific documents to import may be provided. If omitted, all documents in the XML file are imported:
[
  {
    "file": "/path/to/file.xml",
    "content": [
      "<?xml version="1.0" encoding="UTF-8"?>",
      ...
    ],
    "selected": [
      "User.Test.cls"
    ]
  }
[

HTTP Codes returned:-

HTTP 200 if OK
HTTP 400 if the posted content is empty or not valid json
HTTP 415 if content type is not application/json
HTTP 500 if an error occurs (details will be in status error array)

The URL parameter ?flags=<string> can be passed to modify the load
behavior. The list of supported flags or qualifiers can be displayed with
'Do $system.OBJ.ShowQualifiers()' and 'Do $system.OBJ.ShowFlags()'.

Return content is an array of objects, one per XML file. Each object contains the identifier of the XML file, an array containing the names of all documents from that file that were successfully imported, and a status string if an error occurred while importing it:
{
  "status": {
    "errors": [],
    "summary": ""
  },
  "console": [],
  "result": {
    "content": [
      {
        "file": "/path/to/file.xml",
        "status": "",
        "imported": [
          "User.Test.cls"
        ]
      }
    ]
  }
}
NOTE: If you are experiencing timeouts using this method, consider calling method Load() in class %SYSTEM.OBJ from a terminal instead.
classmethod RunTerminal() as %Status

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab