REST.DocServer
class REST.DocServer extends %CSP.REST
Provide a REST interface to the document server service This UrlMap maps http requests to the classmethod to which it should be dispatched Example usages. In these examples please replace the host name and port with appropriate values for your situation.- Get the text of the class Samples/Sample.Person curl http://localhost:57772/csp/samples/docserver/class/samples/Sample.Person
- Get a list of namespaces on the target server (plain/text) curl http://localhost:57772/csp/samples/docserver/namespaces
- Get a list of namespaces on the target server (jason format) curl -H "Accept:application/json" http://localhost:57772/csp/samples/docserver/namespaces
- Display the contents of the http request ( shows how to manage cookies) Set the UseSession Parameter to 1 to enable CSP SESSIONS curl -v -b cookie.txt -c cookie.txt http://localhost:57772/csp/samples/docserver/request
- Echo the contents of a file sent to the server curl -v -X POST --data-binary @class.txt --header "Content-Type:text/plain" http://localhost:57772/csp/samples/docserver/echo
- Send the contents of a file representing the text of a class definition. Return a JSON encoded set of descriptors which define how the text should be syntax colored. curl -v -X POST --data-binary @class.txt --header "Content-Type:text/plain" -H "Accept:application/json" http://localhost:57772/csp/samples/docserver/colorclass
- Get a list of embedded languages for syntax coloring: curl -H "Accept:application/json" http://localhost:57772/csp/samples/docserver/languages
Method Inventory
Methods
classmethod ColorClass() as %Status
Given the source of a class as the request content (POST) return a representation of the
coloring for the class. If the client accepts json, then a json representation is returned as
an array. Each element of the array represents a line of source code. The element is itself an
array of coloring descriptors. Each descriptor is an object with containing the start (p)osition on
the line (zero based), the (c)ount of characters, the (l)anguage index and the (s)ymbol index. If
the client does not accept json then the tradicional CSV representation is returned.
Example:-
Input:
class ABC
{
Property XYZ;
}
Output:
[
[
{"p":0, "c":5, "l":3, "s":4},
{"p":5, "c":1, "l":3, "s":1},
{"p":6, "c":3, "l":3, "s":5}
],
[
{"p":0, "c":1, "l":3, "s":8}
],
[
{"p":0, "c":4, "l":3, "s":1},
{"p":4, "c":8, "l":3, "s":4},
{"p":12, "c":1, "l":3, "s":1},
{"p":13, "c":3, "l":3, "s":11},
{"p":16, "c":1, "l":3, "s":8}
],
[
{"p":0, "c":1, "l":3, "s":8}
]
]
classmethod Echo() as %Status
Return the posted data
This method returns the class text for the named cache class
classmethod GetColorLanguages() as %Status
This method is used to retrieve a list of languages
classmethod GetNamespaces() as %Status
This method returns a list of namespaces for this server
classmethod Request() as %Status
Return a dump of the request object
Inherited Members
Inherited Methods
- %ClassIsLatestVersion()
- %ClassName()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %New()
- %OriginalNamespace()
- %PackageName()
- %SetModified()
- AcceptsContentType()
- AccessCheck()
- ConvertParameter()
- Decrypt()
- DispatchMap()
- DispatchRequest()
- Encrypt()
- Error()
- EscapeHTML()
- EscapeURL()
- Http403()
- Http404()
- Http405()
- Http500()
- HyperEventCall()
- HyperEventHead()
- Include()
- InsertHiddenField()
- InsertHiddenFields()
- IsPrivate()
- Link()
- Login()
- OnHTTPHeader()
- OnHandleCorsRequest()
- OnHandleOptionsRequest()
- OnPage()
- OnPageError()
- OnPostHTTP()
- OnPostHyperEvent()
- OnPreDispatch()
- OnPreHTTP()
- OnPreHyperEvent()
- Page()
- QuoteJS()
- ReportHttpStatusCode()
- ResolveTarget()
- RewriteURL()
- SetResponseHeaderIfEmpty()
- ShowError()
- StartTimer()
- StatusToJSON()
- StatusToProxyObject()
- StopTimer()
- SupportedVerbs()
- ThrowError()
- UnescapeHTML()
- UnescapeURL()