Demo.REST.DirectoryService
class Demo.REST.DirectoryService extends EnsLib.REST.Service
This is a sample REST service implementing a directory of Person and Employee records. Not every Person is an Employee. The CRUD (Create,Retrieve,Update,Delete) interface is implemented via the REST/HTTP commands PUT,GET,POST,and DELETE respectively. Records of interest may be retrieved via type and key fields "name" and "ssn". Wildcards containing * and ? are supported. The resulting HTTP body of a successful GET query may be a partially or fully populated JSON object, depending on the field requested, or a JSON array of such JSON objects if a wildcard was used. Example REST URLs: GET /directory/employee/name/Q*/salary GET /directory/employee/name/Quentin, Fred A. GET /directory/employee/ssn/123-45-6789/*Method Inventory
Parameters
parameter ADAPTER = EnsLib.HTTP.InboundAdapter;
Inherited description: Name of the adapter class - override this to "" if you want to use only the regular HTTP mechanism and not the custom-port HTTP InboundAdapter.
parameter EnsServicePrefix = |directory;
Inherited description: This prefix will be removed from the beginning of the actual URL before matching it against the UrlMap.
If this prefix begins with '^' then the CSP Application will also be removed from the beginning of the URL if this service is being invoked via the CSP gateway.
If this prefix begins with '|' then the Ensemble Config Name for this service will be removed from the beginning of the URL, as well as the CSP Application if this service is being invoked via the CSP gateway.
Methods
classmethod OnErrorStream(pStatus As %Library.Status, pInstance As EnsLib.HTTP.Service)
Control the type and content of error returned to the REST caller
method createPerson(pInput As %Library.AbstractStream, Output pOutput As %Stream.Object, pPersonType As %String) as %Status
Create or replace
method deletePerson(pInput As %Library.AbstractStream, Output pOutput As %Stream.Object, pPersonType As %String, pKeyField As %String, pKeyVal As %String) as %Status
method retrievePerson(pInput As %Library.AbstractStream, Output pOutput As %Stream.Object, pPersonType As %String, pKeyField As %String, pKeyVal As %String, pGetField As %String = "") as %Status
Retrieve
method updatePerson(pInput As %Library.AbstractStream, Output pOutput As %Stream.Object, pPersonType As %String, pKeyField As %String, pKeyVal As %String) as %Status
Update: For given service, replaces primary Person or Person with given name
Inherited Members
Inherited Properties
- %AlertStartTime
- %ConfigName
- %ConfigQueueName
- %LastActionTime
- %LastHandledTime
- %LastReportedError
- %OutsideCreated
- %PreserveSession
- %ProcessInputCalled
- %QuitTask
- %RequestHeader
- %SessionId
- %SuperSession
- %SuperSessionCreatedBeforeSession
- %WaitForNextCallInterval
- %WarnedLatest
- %isShadow
- Adapter
- AlertGracePeriod
- AlertGroups
- AlertOnError
- ArchiveIO
- BusinessPartner
- CSPNoCharSetConvert
- EnableStandardRequests
- GenerateSuperSessionID
- IOLogEntry
- InactivityTimeout
- ThrottleDelay
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OnClose()
- %OnNew()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %SuperSessionSet()
- %ValidateObject()
- AcceptsContentType()
- AccessCheck()
- AdapterName()
- AssignOneSetting()
- CloseIOLogEntry()
- ConvertParameter()
- Decrypt()
- DispatchMap()
- DispatchRequest()
- DrawCSS3STYLE()
- DrawHEAD()
- DrawSTHEAD()
- DrawSTTitle()
- DrawSTYLE()
- DrawTitle()
- DrawTitleSection()
- Encrypt()
- EnumerateSettingsClose()
- EnumerateSettingsExecute()
- EnumerateSettingsFetch()
- Error()
- EscapeHTML()
- EscapeURL()
- ForceSessionId()
- GenerateSuperSession()
- GetDeferredResponseToken()
- GetProductionSettingValue()
- GetProductionSettings()
- GetPropertyConnections()
- GetSettings()
- GetShadowInstance()
- Http403()
- Http404()
- Http405()
- Http500()
- HyperEventCall()
- HyperEventHead()
- Include()
- InsertHiddenField()
- InsertHiddenFields()
- IsPrivate()
- JSONStreamToObject()
- JSONStreamToObjectArray()
- Link()
- Login()
- NewIOLogEntry()
- ObjectToJSONStream()
- OnAdapterHTTPResponse()
- OnError()
- OnErrorSetup()
- OnGenerateSuperSession()
- OnGetConnections()
- OnHTTPHeader()
- OnHandleCorsRequest()
- OnHandleOptionsRequest()
- OnInit()
- OnKeepalive()
- OnLoginPage()
- OnMonitor()
- OnPageError()
- OnPostHyperEvent()
- OnPreDispatch()
- OnPreHTTP()
- OnPreHyperEvent()
- OnProcessInput()
- OnProductionStart()
- OnProductionStop()
- OnSecurityTokenPage()
- OnTearDown()
- Page()
- PopulateSuperSession()
- QueueName()
- QuoteJS()
- ReportHttpStatusCode()
- ResolveTarget()
- RewriteURL()
- SaveIOLogEntry()
- SendAlert()
- SendDeferredResponse()
- SendRequestAsync()
- SendRequestSync()
- SetResponseHeaderIfEmpty()
- ShowError()
- StartTimer()
- StatusToJSON()
- StatusToProxyObject()
- StopTimer()
- SupportedVerbs()
- ThrowError()
- UnescapeHTML()
- UnescapeURL()
- findDataNotInQuery()
- restoreFormEncoded()
- restoreMultipart()