Class Reference
IRIS for UNIX 2024.1.2
|
|
Private
Storage
|
The Zen Proxy class provides a way to assemble data that can be
conveniently passed between the web client and the server.
It works in conjunction with the zenProxy JavaScript class
defined in zenutils.js. The zenProxy class is
the client-side representation of the server-side %ZEN.proxyObject
class and vice versa.
The %ZEN.proxyObject class is useful for cases where
you do not know what run-time properties will exist when you are designing
your application (perhaps it is user-configurable).
The proxy class can be used in several ways. You can use it to send
an arbitrary set of data values from the client to a server-side method.
To do this, create an instance of zenProxy in a client-side JavaScript method:
// create instance of zenProxy var obj = new zenProxy(); obj.name = 'Smith'; obj.code = 'CRM114';
ClassMethod MyMethod(pProxy as %ZEN.proxyObject) As %Boolean [ZenMethod] { Set tName = pProxy.name Set tCode = pProxy.code Quit 1 }
var obj = new zenProxy(); obj.name = 'Smith'; obj.code = 'CRM114'; var ok = this.MyMethod(obj);
ClassMethod GetServerInfo() As %ZEN.proxyObject [ZenMethod] { Set tProxy = ##class(%ZEN.proxyObject).%New() Set tProxy.whatever = "Some server value" Quit tProxy }
var obj = this.GetServerInfo(); alert(obj.whatever);
Set myProperty = tProxy."my_property" Set tProxy."$$foo" = "bar"
|
|
|
Delete all properties and data currently in the proxy object.
Copy the values from a local array (subscripted by property name) into this proxyObject.
Copy the properties in this proxyObject into a local array subscripted by property name.
DeleteDocument will delete a document identified by ID from the specified global or local variable reference (GLVN). If a document with the specified ID does not exist in that GLVN then DeleteDocument will return an error in the returned %Status value.
Parameters pWhere Input Global or local variable reference. This is the location from where the proxyObject instance will be deleted.
pDocumentID Input The document ID.
DocumentExists() returns a boolean value indicate whether or not the documentID exists in the global/local variable reference (GLVN).
Parameters pWhere Input Global or local variable reference where documents are stored.
pDocumentID Input The document ID.
OpenDocument will retrieve a previously saved document from the specified global or local variable reference (GLVN) with the specified pDocumentID and return an oref referencing an instance of %ZEN.proxyObject. If a document with the specified ID does not exist in that GLVN then OpenDocument will return an error in the output pStatus parameter.
Parameters pWhere Input Global or local variable reference. This is the location where the proxyObject instance will be saved.
pDocumentID Input The ID of the document to be opened.
pStatus Output The returned %Status value, indicating success or failure.
OpenEmbeddedDocument will retrieve a document embedded in a previously saved document from the specified global or local variable reference (GLVN) with the specified pDocumentID and return an oref referencing an instance of %ZEN.proxyObject. If a document with the specified documentID does not exist in that GLVN then OpenDocument will return an error in the output pStatus parameter. If an embedded document with the specified objectID does not exist in that GLVN then OpenDocument will return an error in the output pStatus parameter.
Parameters pWhere Input Global or local variable reference. This is the location where the proxyObject instance will be saved.
pDocumentID Input The ID of the document containing the embedded document.
pObjectID Input The objectID of the document embedded in the specified pDocumentID.
pStatus Output The returned %Status value, indicating success or failure.
SaveDocument will save the proxyObject to a global or local variable reference (GLVN) with the specified pDocumentID. If a document with the same ID already exists in that GLVN then SaveDocument will return an error in the returned %Status value.
Parameters pWhere Input Global or local variable reference. This is the location where the proxyObject instance will be saved.
pDocumentID Input The document ID. This value must be unique within the GLVN specified in pWhere.