Class Reference
EnsLib.EDI.XML.Document
Server:irisdocs2
Instance:IRISLATEST
User:UnknownUser
 
-
  [ENSLIB] >  [EnsLib] >  [EDI] >  [XML] >  [Document]
Private  Storage

persistent class EnsLib.EDI.XML.Document extends %Persistent, EnsLib.EDI.XML.Prop, %XML.SAX.EntityResolver, %XML.Adaptor

This class encapsulates an XML document stream and provides methods to interrogate and update it Two types of path strings can be used to identify a document node: a 'Property path' that is based in a particular XML schema definition (xsd), irrespective of any particular document instance, and a 'DOM path' that is based in the structure of a particular document irrespective of any XML schema. The DOM Path uses XPATH conventions; it always starts with '/' while a Property Path never does.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
6 10 58 2 2 1


Summary

Properties
%CalcCount %MaxCalcCache %PurgeIndex DocType
DocTypeCategory DocTypeName Format Identifier
IsMutable Name OriginalDocId RawContent
SchemaStatus Source TimeCreated TypeVersion
UserValues attributeCount attributeSub namespaceMapping
pDSubsList prevElem

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt
%CheckConstraints %CheckConstraintsForExtent %ClassIsLatestVersion
%ClassName %CompareContents %ComposeOid
%ConstructClone %Delete %DeleteExtent
%DeleteId %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified
%DispatchSetMultidimProperty %DispatchSetProperty %DrawHTMLForm
%DrawHTMLTable %Exists %ExistsId
%Extends %GUID %GUIDSet
%GetContentType %GetLock %GetParameter
%GetSwizzleObject %Id %InsertBatch
%IsA %IsModified %IsNull
%KillExtent %KillExtentData %LoadFromMemory
%LockExtent %LockId %New
%NormalizeObject %ObjectIsNull %ObjectModified
%Oid %OnBeforeAddToSync %OnDetermineClass
%OnTimeout %Open %OpenId
%OriginalNamespace %PackageName %PhysicalAddress
%ProcessSubmit %PurgeIndices %Reload
%RemoveFromSaveSet %ResolveConcurrencyConflict %RollBack
%Save %SaveDirect %SaveIndices
%SerializeObject %SetModified %ShowContents
%ShowContentsHead %SortBegin %SortEnd
%SyncObjectIn %SyncTransport %UnlockExtent
%UnlockId %ValidateIndices %ValidateObject
CommittedMode CopyValues DocTypeSet
DrawFormButtons DrawHTMLContentsForm DrawHTMLForm
DumpMaps EnumerateDocTypesClose EnumerateDocTypesExecute
EnumerateDocTypesFetch EnumerateTypeCategoriesClose EnumerateTypeCategoriesExecute
EnumerateTypeCategoriesFetch EnumerateVDocsClose EnumerateVDocsExecute
EnumerateVDocsFetch GetAlias GetContentArray
GetNewManagerLinks GetStatsDimension GetSubDocumentAt
GetValueAt GetValues GetValuesArray
IdentifierGet ImportFromDevice ImportFromFile
ImportFromIOStream ImportFromLibraryStream ImportFromString
IsMutableSet KillGlobals LocatePosition
Mask NameGet NormalizeElementNamespacePrefix
NormalizeNamespacePrefix OnPostParse OutputHTMLZen
OutputToDevice OutputToFile OutputToIOStream
OutputToLibraryStream OutputToString PokeDocType
PopHandler Purge PushHandler
RawContentGet SetMaxCalcCache SetSubDocumentAt
SetValueAt TotalCount TypeVersionGet
Validate XMLExport XMLExportToStream
XMLExportToString XMLNew XMLSchemaNamespace
XMLSchemaType choiceGetCount choiceGetIndex
endCDATA endDTD endDocument
endEntity error getTestNewArg
skippedEntity startCDATA startDTD
startDocument startEntity warning


Parameters

• parameter DEFSEARCHCLASS = "EnsLib.EDI.XML.SearchTable";
Name of the default SearchTable indexing class used in UI choices and MessageBank submissions
• parameter DOCCLASSFULLNAME = "XML Virtual Document";
Full descriptive name for this subclass of document
• parameter DOCCLASSNAME = "XML Document";
Compact descriptive name for this subclass of document
• parameter DOCSHORTNAME = "XML";
• parameter SCHEMACLASS = "EnsLib.EDI.XML.Schema:DS";
Name of the associated schema class and, after a colon, the schema class code that represents a DocType

Properties

• property Identifier as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Unique document identification string found in document content (none defined for a general XML document)
• property Name as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Raw type name of document as declared in document content
• property RawContent as %String(MAXLEN=10000) [ Calculated,Transient,ReadOnly ];
The raw text content of the document. Note that this is a truncated version suitable for use in SQL results and visual inspection, but not a complete or definitive representation of the document.
• property TypeVersion as %String(MAXLEN="") [ Calculated,Transient,ReadOnly ];
Raw type version of document if declared in document content

Methods

• method CommittedMode(pMode As %Boolean = 1) as %Status
Switch from keeping changes in memory to keeping them in storage. Allows for unlimited changes to a document without running out of memory. This mode is automatically in effect when the object is created by loading from a stored Id
• method CopyValues(pSource As EnsLib.EDI.XML.Document, pSourcePath As %String, pTargetPath As %String, pAction As %String, pKey As %String, pEmptyFieldAsNull As %Boolean = 0, pIgnoreMissingSource As %Boolean = 0) as %Status
Copy a whole set of values from source to target when iteration is implied between 2 VDocs pSourcePath contains the property path to the source set
pTargetPath contains the property path to the target set
pAction contains an action code: "set", etc..
pKey contains an optional key value or a set of comma-separated key values to be used as array indices where empty array index placeholders are present in pPropertyPath.
• method DumpMaps(pWhich As %String = "") as %Status
• classmethod EnumerateDocTypesClose(ByRef qHandle As %Binary) as %Status
• classmethod EnumerateDocTypesExecute(ByRef qHandle As %Binary, Category As %String, IncludeBase As %Boolean) as %Status
• classmethod EnumerateDocTypesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer) as %Status
• classmethod EnumerateTypeCategoriesClose(ByRef qHandle As %Binary) as %Status
• classmethod EnumerateTypeCategoriesExecute(ByRef qHandle As %Binary, Standard As %String = "") as %Status
• classmethod EnumerateTypeCategoriesFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer) as %Status
• classmethod GetContentArray(Output pContents, pMode As %String, pDocType As %String, pLevel As %Integer, pIncludeBase As %Boolean, pElem, pNodeAddr) as %Status
Returns array of properties that make up the contents of this object.
This method in implemented within the document class.
The content array is in the form:
pContents(n,"type")="%String"
pContents(n,"name")="Field"
pContents(n,"alias")=alias code
If pContents(n) is non-zero then the property is a composite type with
sub-properties. The sub-properties are indexed with a similar structure under
pContents(n,m) where m is the index of the subtype property.
• method GetSubDocumentAt(pPropertyPath As %String = "", Output pStatus As %Status) as EnsLib.EDI.XML.Document

Retrieve an XML virtual document constructed from the tree identified by pPropertyPath. This path may be either a "DOM Path" or a "Property Path". The Document instance is created using the supplied pPropertyPath as the root of the tree -- this is equivalent to calling the GetValueAt() with the "f" format flag specified.

A "DOM Path" is schema independent and starts from the document root with a '/' character and is delimited by the '/' character at each level of descent, and by square brackets '[' and ']' for repeating elements.

A "Property Path" is based on a simplified projection of the XML schema applied to the current document by way of its DocType property. It starts from the root element (one level down from the XML document root) and is delimited by the "." character and by parentheses '(' and ')' for repeating elements.

• method GetValueAt(pPropertyPath As %String = "", pFormat As %String, Output pStatus As %Status, pDummy As %Boolean) as %String
Retrieve the content value of the XML element or attribute identified by pPropertyPath. This path may be either a "DOM Path" or a "Property Path".

A DOM path is schema independent and starts from the document root with a '/' character and is delimited by the '/' character at each level of descent, and by square brackets '[' and ']' for repeating elements.

A Property path is based on a simplified projection of the XML schema applied to the current document by way of its DocType property. It starts from the root element (one level down from the XML document root) and is delimited by the "." character and by parentheses '(' and ')' for repeating elements.

The pFormat argument is an optional string comprised of a collection of single-character flag codes:

  • 1-9 : indent with this number of spaces (4 is the default with the 'i' format specifier)
  • a : attributes alphabetical
  • c : canonical ; ignores 'eintw'
  • e : close elements even when empty
  • f : full top element not just its contents
  • i : indent with 4 spaces unless 't' or 1-9
  • l : output schema information, schema uri and schema location, based on property stored in ..schemaLocation
  • n : newline (lf) after every text-free element
  • o : output unescaped - for instance don't change < to &lt;
  • p : suppress output of namespace prefixes
  • q : use double quotes to set off attribute values if possible
  • s : use stored indentation whitespace (ignores 'it1-9')
  • r : use stored returns / newlines (ignores 'nw')
  • t : indent with tab
  • u : declare prefixes as well as using them
  • w : Windows-style cr/lf newline after every text-free element
  • x : omit namespaces in output
• method GetValues(pPropertyPath As %String = "", pFormat As %String, pValSepString As %String = "<>", Output pStatus As %Status) as %String
Finds all values matching a PropertyPath string that contains zero or more () implicit iterators Supports PropertyPath values with (), (n) to choose a specific one of the given type, or just plain (same as path().
• method GetValuesArray(pPropertyPath As %String, pFormat As %String, ByRef pArray As %String, Output pStatus As %Status, ByRef pLongArray As %String)
• method IdentifierGet() as %String
This is a Get accessor method for the Identifier property.
• classmethod ImportFromDevice(Output pStatus As %Status, ByRef pConfigItem As %String) as EnsLib.EDI.XML.Document
• classmethod ImportFromFile(pFilename As %String, pDocNum As %Integer = 1, Output pStatus As %Status, pConfigItem As %String) as EnsLib.EDI.XML.Document
• classmethod ImportFromIOStream(pIOStream As %IO.I.CharacterStream, Output pStatus As %Status = $$$OK, ByRef pConfigItem As %String = "") as EnsLib.EDI.XML.Document
• classmethod ImportFromLibraryStream(pLibStream As %Stream.Object, Output pStatus As %Status, ByRef pConfigItem As %String) as EnsLib.EDI.XML.Document
• classmethod ImportFromString(pString As %String, Output pStatus As %Status, ByRef pConfigItem As %String) as EnsLib.EDI.XML.Document
• classmethod KillGlobals(Output pDeletedCount, pKeepExtentCount=0, pDisplayLog=1)
• method NameGet() as %String
This is a Get accessor method for the Name property.
• method OutputHTMLZen() as %Status
Display Document as HTML
• method OutputToDevice(pFormat As %String) as %Status
• method OutputToFile(pFilename As %String, pOverwrite As %Boolean, pFormat As %String) as %Status
• method OutputToIOStream(pIOStream As %IO.I.CharacterStream, pFormat As %String, pFlush As %Boolean = 1) as %Status
If pFormat contains a string of the form: C(encoding) then an XML charset declaration line will be output. If encoding is empty the IOStream's encoding will be used. If encoding starts with ! then the IOStream's encoding will be set to the given encoding.
• method OutputToLibraryStream(pLibStream As %Stream.Object, pFormat As %String) as %Status
• method OutputToString(pFormat As %String, Output pStatus As %Status) as %String
• classmethod Purge(Output pDeletedCount As %Integer, pDaysToKeep As %Integer = 7, pDummy As %Boolean = 0) as %Status
• method RawContentGet() as %String
This is a Get accessor method for the RawContent property.
• method SetMaxCalcCache(size As %Integer)
• method SetSubDocumentAt(pSubDocument As EnsLib.EDI.XML.Document = "", pPropertyPath As %String = "") as %Status
Insert the XML representation of pSubDocument into this document at the path specified by pPropertyPath.
• method SetValueAt(pValue As %String = "", pPropertyPath As %String = "", pAction As %String = "set", pKey As %String = "") as %Status
Set the value of the designated virtual property.
pValue contains the value to set.
pPropertyPath contains a text expression representing the address within the document of the value of interest.
pKey contains an optional key value or a set of comma-separated key values to be used as array indices where empty array index placeholders are present in pPropertyPath.
pAction contains an action code: "set", "clear", "append", etc.
• classmethod TotalCount() as %Integer
• method TypeVersionGet() as %String
Subclasses should override this if the version can be gotten from the document content
• method Validate(pValidationSpec As %String = "", pSSLConfig As %String = "", pHttpTimeout As %Numeric = "") as %Status
Validates the XML VDoc against the schema that is referenced in its DocType property. If the schema URL specifies https then you must provide an SSL configuration name in pSSLConfig that will work with the URL target server.

Queries

• query EnumerateDocTypes(Category As %String = "", IncludeBase As %Boolean = 0)
Selects Type As %String
Returns a list of available DocTypes for this document class.
The DocType is returned as the first column in the result set.
The Category parameter can be used to restrict the list.
If Category is:
0 - return only DocTypes in standard categories
+ - return only DocTypes in user-defined categories
empty - return DocTypes from all categories
a category name - return only DocTypes in the named category
a partial name suffixed with '%' - return only DocTypes in categories matching the partial category name
other - return nothing
If IncludeBase is:
0 - return only DocTypes defined in the current schema category itself
1 - return all DocTypes in the current schema category's base category in addition to those defined in the current category itself
• query EnumerateTypeCategories(Standard As %String = "")
Selects Category As %String, Description As %String, IsStandard As %Boolean, Base As %String
Returns a list of document type schema categories for the document class.
The Standard parameter can be used to restrict the list.
If Standard is: 0 - return only standard categories + - return only user-defined categories empty - return all categories a category name - return only the named category a partial name suffixed with '%' - return only categories matching the partial category name other - return nothing

Indices

•index (Extent on ) [Extent,Type = bitmap];
•index (OriginalDocId on OriginalDocId);

Triggers

•trigger OnDelete (BEFORE event DELETE)


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.