%Atelier.REST
Class %Atelier.REST Extends %CSP.REST
This class implements a custom response format and serves as the basis for all Atelier REST APIs
Parameters
DOMAIN
Parameter DOMAIN = "%Utility";
%Atelier.REST classes are unlikely to actually define messages with $$$Text %Utility seems like a catch-all, and should have all languages defined, so the %session/%response language can be set properly.
Methods
Http500
ClassMethod Http500(pE As %Exception.AbstractException) As %Status
Use our special format Http500 handler
ReportHttpStatusCode
ClassMethod ReportHttpStatusCode(pHttpStatus, pSC As %Status = {$$$OK}) As %Status
User our special format handler for other status codes
GetClientServerHash
ClassMethod GetClientServerHash() As %String [ CodeMode = expression, Internal ]
Get the clients version of the server hash
SetClientServerHash
ClassMethod SetClientServerHash(pHash As %String)
Set the clients version of the server hash
ServeDoc
ClassMethod ServeDoc(pDocName As %String, pStatus As %Status, pMsgArray As %DynamicArray, ByRef pResArray As %String, pTimeStamp As %String = "", pUpToDate As %Boolean, pExtensionContent As %DynamicObject) As %Status
This private helper method server wraps the message and document and returns it to the caller
ServeXml
ClassMethod ServeXml(pDocName As %String, pStatus As %Status, pMsgArray As %DynamicArray, pStream As %Stream, pTimeStamp As %String = "") As %Status
This private helper method server wraps the message and document and returns it to the caller
RenderResponseBody
ClassMethod RenderResponseBody(pStatus As %Status, pMsgPart As %DynamicArray, pResPart As %DynamicObject) As %Status
Render the three-part Response Body which contains an status, console, and a result part
Page
ClassMethod Page(skipheader As %Boolean = 1) As %Status [ ProcedureBlock = 0 ]
Sets the response's localization domain (something that %CSP.REST should do, in theory) and then invokes default super class behavior