Skip to main content

%Document.Object

Class %Document.Object Extends (%Library.SerialObject, %XML.Adaptor) [ OdbcType = VARCHAR, StorageStrategy = custom, System = 3 ]

Properties

%changed

Property %changed As %ZEN.Datatype.boolean(XMLPROJECTION = "NONE") [ InitialExpression = 0, Internal, Transient ];

Internal property used to track if this object is modified.

%columnIndex

Property %columnIndex As %ZEN.Datatype.string(MAXLEN = "") [ Internal, MultiDimensional, Transient ];

%isList

Property %isList As %ZEN.Datatype.integer(XMLPROJECTION = "NONE") [ InitialExpression = 0, Internal, Transient ];

Internal property used to define this document as a simple document or a collection

%index

Property %index As %ZEN.Datatype.integer(XMLPROJECTION = "NONE") [ Internal, Transient ];

Internal property used to client index of this object.

"_data"

Property "_data" As %ZEN.Datatype.string [ Internal, MultiDimensional ];

Internal array of data values within the proxy, indexed by series and property name.

"_documentID"

Property "_documentID" As %Binary [ Internal ];

"_location"

Property "_location" As %String(MAXLEN = 512) [ Internal, Transient ];

Methods

%DispatchGetProperty

Method %DispatchGetProperty(pProperty As %String) [ Final, Internal ]

Property dispatch method to catch references to virtual properties.
This should not be called directly.

%DispatchSetProperty

Method %DispatchSetProperty(pProperty As %String, pValue As %String) [ Final, Internal ]

Property dispatch method to catch references to virtual properties.
This should not be called directly.

%OnNew

Method %OnNew(pObjectValue As %String(MAXLEN="") = "", pIsList As %Integer = 0) As %Status [ Private, ServerOnly = 1 ]

This callback method is invoked by the %New method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

%ValidateObject

Method %ValidateObject(force As %Integer) As %Status

Clear

Method Clear() As %Status

Clears the contents of the array.

Returns a %Status value indicating success or failure.

Count

Method Count() As %Integer [ ProcedureBlock = 1 ]

Returns the number of elements contained in the array.

Find

Method Find(element As %String, key As %String) As %String

Starting from, but not including, location key, finds the next element in the array with value equal to element.

If key is a null string (""), the search starts at the beginning of the array.

Find returns the key associated with the found element or null string ("") if no element is found.

GetAt

Method GetAt(key As %String = "") As %String [ CodeMode = expression, Final ]

Finds and returns the value of the element at position key in the list.

GetAt returns the value of the element at location key or null string ("") if no element is found.

GetNext

Method GetNext(ByRef key As %String) As %String

Finds and returns the value of the element at the location after key in the array. If key is a null string (""), it returns the value of the first element in the array.

The value of key, which is passed by reference, is updated to the key value of the returned element or null string ("") if key is at the end of the array.

GetPrevious

Method GetPrevious(ByRef key As %String) As %String

Finds and returns the value of the element at the location before key in the array. If key is a null string (""), it returns the value of the last element in the array.

The value of key, which is passed by reference, is updated to the key value of the returned element or null string ("") if key is at the beginning of the array.

Insert

Method Insert(element As %RawString) As %Status

Inserts an element with value element at the end of the list.

Returns a %Status value indicating success or failure.

InsertAt

Method InsertAt(element As %RawString, key As %Integer) As %Status

Inserts an element with value element at position key.

To make room for the new element, the elements previously at or following position key are moved up by one position.

key must be in the following range: 1 <= key <= Count() + 1 Returns a %Status value indicating success or failure.

InsertList

Method InsertList(inslist As %RawString) As %Status

Inserts a list with value inslist at the end of the list.

Returns a %Status value indicating success or failure.

InsertOrdered

Method InsertOrdered(element As %RawString) As %Status

Inserts an element with value element into the list at the correct ordered position. The elements in the list are shifted to accommodate the new element as necessary.

Returns a %Status value indicating success or failure.

IsDefined

Method IsDefined(key As %String) As %Boolean [ CodeMode = expression, Final ]

Returns true (1) if a value is defined at location key, otherwise false (0).

Next

Method Next(key As %String = "") As %String [ CodeMode = expression, Final ]

Previous

Method Previous(key As %String = "") As %String [ CodeMode = expression, Final ]

Finds and returns the key value of the element at the location preceding key in the array. If key is a null string (""), then Next returns the key value for the last element in the array.

RemoveAt

Method RemoveAt(key As %Integer) As %RawString

Removes the element at position key in the list. The elements following position key are moved to fill in the resulting gap.

RemoveAt returns the value of the removed element or null string ("") if no element was removed.

SetAt

Method SetAt(element As %RawString, key As %Integer) As %Status

Sets the value of the element at position key to element.

Returns a %Status value indicating success or failure.

BuildValueArray

ClassMethod BuildValueArray(serialized As %Binary, array As %Binary) As %Status

Constructs array(key)=value for each element in the serialval value.

Returns a %Status value indicating success or failure.

%GetSerial

Method %GetSerial(force As %Integer = 0) As %String [ Private ]

%SetSerial

Method %SetSerial(serialized As %String) As %Status [ Private ]

LogicalToOdbc

ClassMethod LogicalToOdbc(val As %String = "") As %String

Converts the serial state of this array object to a delimited string using the value of the ODBCDELIMITER parameter as a delimiter.

OdbcToLogical

ClassMethod OdbcToLogical(val As %String = "") As %String

Converts the value of an incoming delimited string to a serialized state using the value of the ODBCDELIMITER parameter as a delimiter.

%ToJSON

Method %ToJSON(pLevel As %Integer = 0) As %Status [ Internal ]

Write out the contents of this proxy object to the current device in JSON format.
This method is used a proxy object is used in conjunction with the %ZEN.Auxiliary.jsonProvider component.

%ToJSONStream

Method %ToJSONStream(ByRef pStream As %Stream.Object, pRewindStream As %Boolean = 0) As %Status [ ProcedureBlock = 0 ]

Write the document as JSON to a stream.

CSON

ClassMethod CSON(pObjectValue As %String(MAXLEN="")) As %Document.Object

XML

ClassMethod XML(pXML As %Binary = "") As %Document.Object

%Document.Object contructor that populates the document content from an XML source. pXML can either be a counted array of lines, a stream object, or...

loadXML

Method loadXML(pXMLNode As %XML.Node)

loadResultSet

Method loadResultSet(pResultSet As %SQL.IResultSet, pFieldName As %String(MAXLEN="") = "results")

deswizzle

Method deswizzle() As %String(MAXLEN="")

deswizzle serializes a %Document object into CSON format.

swizzle

Method swizzle(pObjectValue As %String(MAXLEN="") = "")

swizzle converts a CSON object value into the current object.

show

Method show(pLevel As %ZEN.Datatype.integer = 0)

Display the current object and all nested objects.

parse

ClassMethod parse(pLex As %String(MAXLEN="") = "", ByRef pToken As %String(MAXLEN=""), pDelimiter As %String = ",") [ Internal ]

Document string parser

DocumentExists

ClassMethod DocumentExists(pWhere As %ZEN.Datatype.string, pDocumentID As %ZEN.Datatype.string = "") As %ZEN.Datatype.boolean

DocumentExists() returns a boolean value indicate whether or not the documentID exists in the global/local variable reference (GLVN).

ParameterspWhereInputGlobal or local variable reference where documents are stored.
pDocumentIDInputThe document ID.

open

ClassMethod open(pWhere As %ZEN.Datatype.string, pDocumentID As %ZEN.Datatype.string, Output pStatus As %Status = "") As %Document.Object

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.

save

Method save(pWhere As %ZEN.Datatype.string, pDocumentID As %ZEN.Datatype.string = "", pUpdate As %Integer = 1) As %Status

Save the Document 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 an error %Status value is returned.

ParameterspWhereInputGlobal or local variable reference. This is the location where the %Document instance will be saved.
pDocumentIDInputThe document ID. This value must be unique within the GLVN specified in pWhere.

load

Method load(pWhere As %ZEN.Datatype.string, pDocumentID As %ZEN.Datatype.string, pObjectID As %ZEN.Datatype.integer, ByRef pOQ, ByRef pOREF) [ Internal ]