Utilities used in the DeepSee rest services
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";
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.
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 classmethod %CreateObjectFromArray(ByRef pArray, pMetaData As %List, Output pObject) as %Status
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.
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" classmethod %ValidateRequest(pUrl As %String, pMethod As %String) as %Status
The remainder of the URL, if it exists, is returned in the pRemainder.
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.