Skip to main content


class %DeepSee.REST.REST extends %CSP.REST

Utilities used in the DeepSee rest services

Method Inventory


parameter CHARSET = utf-8;
Specifies the default character set for the page. This can be overriden using the <CSP:CONTENT CHARSET=> tag, or by setting the %response.CharSet property in the OnPreHTTP() method. If this parameter is not specified, then for the default charset is utf-8.
parameter CONTENTTYPE = application/json;
Specifies the default content type for the page. This can be overriden using the <CSP:CONTENT TYPE=> tag, or by setting the %response.ContentType property in the OnPreHTTP() method. The default value if this parameter is not set is text/html.
parameter DOMAIN = %DeepSee;
Inherited description: Login page localization domain
parameter HandleCorsRequest = 1;
This parameter influences the CORS support. The default is an empty string meaning 'not specified'. If set to true (1) then CORS processing is ON. If set to false (0) then CORS processing is OFF. If left unset "" then the decision to process CORS is delegated to the setting on the URL map route.


classmethod %Array2JSON(ByRef array)
Converts an objectscript array that may have an arbitrary structure, to a JSON object array is the array to be converted
classmethod %ConstructResponseFromArray(ByRef pArray, pMetaData As %List = "", pNodeLabel="ListItems", pFetchStatus As %Status = 1, Output pResponseObj, Output pProvider) as %Status
This utility assists in constructing a standardized JSON response object from an array of lists, as commonly returned by %DeepSee utilities. The data in pArray must be organized in the form
pArray(index) = $LB(data1,data2,data3)
where the contents in each list are converted to name-value pairs using the list of labels provided in pMetaData. The array of objects is placed in the Result section of the dynamic object returned via pResponseObj. The specifc node within the Result section is labeled according to the string supplied in pNodeLabel.
For convenience, the method may return an instance of the %ZEN.Auxiliary.jsonMDXProvider used to augment the response object with more dynamic objects or arrays, as well as convert the object to JSON when the response object is complete.
classmethod %ConstructResponseObject(Output pInfoObj, Output pResultObj, Output pProvider) as %DynamicObject
Create a template response object
classmethod %ConvertErrorStatusToJSON(pStatus As %Status, ByRef statusAsJSONString As %String = "") as %Status
Converts a %Status object that contains an error, to a JSON string, but does not cause it to be output to the console (unlike %DeepSee.REST.REST.ErrorToJSON, thus allowing for it to be used as a string wherever required If a non-error status is passed in, an empty string will be returned becuase the underlying method tProvider.%StatusToDynamicObject does not convert $$$OK statuses to dynamic objects May need to be refactored if %Zen is phased out
classmethod %CreateObjectFromArray(ByRef pArray, pMetaData As %List, Output pObject) as %Status
This consumes an array and attempts to create a dynamic object out of it. This object can then be further augmented or pruned, and can be used as a facility for converting the content to JSON.
classmethod %ErrorToJSON(pStatus As %Status) as %Status
Convert a %Status object that contains an error into JSON for transmission back to the client. The error will be located in the same position within the object as with any JSON MDX resultset return. If there is a reported error, the existence of other properties within the return object is not guaranteed.
classmethod %ExtractDatasourceName(pUrl="", pType="", Output pRemainder As %String, Output pStatus As %Status) as %String
DeepSee REST APIs permit use of the "/" character in data source names and dimension specs. Given a piece of a pUrl that begins with a data source, this searches for the first valid data source name and returns it. This can be limited by type or a list of types in the comma-delimited list pType. Currently supported datasource types are "kpi" and "cube"
The remainder of the URL, if it exists, is returned in the pRemainder.
classmethod %SetRequestField(pPropertyName As %String, pCurrentInput, pDefaultValue, Output ans, pTargetClass As %String) as %Status
This method sets a request field to its current value as passed in the request.Content section of the POST request or, if that does not exist, sets it to its default value as specified in the method signature in CubeManager.Utils Example: SetRequestField is being invoked to set the value for the field %request.Content.myField pPropertyName is a string values containing the name of the field. For the above example,the pProperty is "myField" pCurrentInput is the current input value for the field in question. For the above example, the pCurrentInput is %request.Content.myField pDefaultValue is the default value for the field in question, as specified in the signature of the corresponding method that the API is designed to call. For the above example, the pDefaultValue could be "5" ans is the variable or object reference in which the populated value is stored pTargetClass is an optional argument that contains the name of the class, that ans should be an object of. This is only passed in when ans is expected to be an object and not a variable. An example of this is "%DeepSee.CubeManager.RegistryMapCube"
classmethod %ValidateRequest(pUrl As %String, pMethod As %String) as %Status
Perform specific validation for the service that will handle the request. This is used as a callback in each service that extends %DeepSee.REST
classmethod %WaitForProviderResults(pProvider As %ZEN.Auxiliary.jsonMDXProvider, pTimeout As %Integer) as %Status
Given an instance of the jsonMDXProvider, begin executing the query and wait for results. Quit early if the value supplied by pTimeout is reached.
classmethod OnPreDispatch(pUrl As %String, pMethod As %String, ByRef pContinue As %Boolean) as %Status
This method Gets called prior to dispatch of the request. Put any common code here that you want to be executed for EVERY request. If pContinue is set to 0, the request will NOT be dispatched according to the UrlMap. If this case it's the responsibility of the user to return a response.

Inherited Members

Inherited Methods


FeedbackOpens in a new tab