ObixMod is an abstract base class that implements the standard plumbing for adding oBIX server side support. Standardized URIs handled by the base class:
{modBase}/xsl debug style sheet {modBase}/about about object {modBase}/batch batch operation
All other URIs to the mod are automatically handled by the following callbacks:
Slots
- aboutSource
-
virtual ObixObj about()
Get represenation of the About object. Subclasses should override this to customize their about. See make to customize vendor and product fields.
-
const private Str aboutProductName
-
const private Uri aboutProductUrl
-
const private Str aboutProductVer
-
const private Str aboutServerName
-
const private Str aboutVendorName
-
const private Uri aboutVendorUrl
- lobbySource
-
virtual ObixObj lobby()
Get represenation of the Lobby object. Subclasses can override this to customize their lobby.
- makeSource
-
new make(Str:Obj about := [Str:Obj][:])
Construct with the given map for
obix:About
parameters:- serverName: defaults to
Env.cur.host
- vendorName: defaults to "Fantom"
- vendorUrl: defaults to "http://fantom.org/"
- productName: defaults to "Fantom"
- productVersion: defaults to version of obix pod
- productUrl: defaults to "http://fantom.org/"
- serverName: defaults to
-
private Void onAbout()
- onInvokeSource
-
abstract ObixObj onInvoke(Uri uri, ObixObj arg)
Invoke the operation for the given URI and return the result. The URI is relative to the ObixMod base - see
web::WebReq.modRel
Throw UnresolvedErr if URI doesn't map to a valid operation. -
private Void onLobby()
- onReadSource
-
abstract ObixObj onRead(Uri uri)
Return the ObixObj representation of the given URI for the application. The URI is relative to the ObixMod base - see
web::WebReq.modRel
. Throw UnresolvedErr if URI doesn't map to a valid object. The resulting object must have its href set to the proper absolute URI according to 5.2 of the oBIX specification. - onServiceSource
-
override Void onService()
Overrides web::Weblet.onService
Doc inherited from web::Weblet.onService
Service a web request. The default implementation routes to onGet, onPost, etc based on the request's method.
- onWriteSource
-
abstract ObixObj onWrite(Uri uri, ObixObj val)
Write the value for the given URI and return the new representation. The URI is relative to the ObixMod base - see
web::WebReq.modRel
. Throw UnresolvedErr if URI doesn't map to a valid object. Throw ReadonlyErr if URI doesn't map to a writable object. -
private Void onXsl()
-
private ObixObj readReqObj()