%Api.Atelier.v7
Class %Api.Atelier.v7 Extends %Api.Atelier.v6
%Api.Atelier.v7 provides version 7 APIs for Atelier
XDatas
UrlMap
XData UrlMap [ XMLNamespace = "http://www.intersystems.com/urlmap" ]
Methods
RunTerminal
ClassMethod RunTerminal() As %Status
ExportToXMLFile
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": [ "", ... ] } }
LoadXMLFiles
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": [ "", ... ], "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=
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.
ListDocumentsInXMLFiles
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": [ "", ... ] } [
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.