IRISLIB database
Exchange Class Reference

The <class>XML.Exchange</class> class provides an interface for managing XML representations of objects. More...

Inheritance diagram for Exchange:
Collaboration diagram for Exchange:

Static Public Member Functions

_.Library.Status AssignGUIDs ()
 This method will assign GUIDs to all Exchange Items of the system without a GUID.
 
_.Library.Status CheckGUIDs (_.Library.Boolean ApplyChange)
 This method looks for inconsistencies in the GUID allocation. More...
 
_.Library.Status Export (_.Library.String items, _.Library.String filename, _.Library.String qspec, _.Library.String errorlog, _.Library.String Charset)
 Export Exchange Items to an XML file. More...
 
_.Library.Status ExportAllDir (_.Library.String dir, _.Library.String qspec, _.Library.String errorlog, _.Library.String Charset, _.Library.GlobalCharacterStream exported)
 Export all Exchange Items from the system to a directory.
 
_.Library.Status ExportDir (_.Library.String items, _.Library.String dir, _.Library.String qspec, _.Library.String errorlog, _.Library.String Charset, _.Library.GlobalCharacterStream exported, _.Library.Boolean header)
 Export Exchange Items to a directory. More...
 
_.Library.Status ExportTableDir (_.Library.String class, _.Library.String dir, _.Library.String qspec, _.Library.String errorlog, _.Library.String Charset, _.Library.GlobalCharacterStream exported)
 Export all Exchange Items from a given table to a directory.
 
_.Library.String GetDescription (_.Library.String Oid)
 Returns a description to be used for the element. More...
 
_.Library.String GetPath (_.Library.String Root, _.Library.List Oid, _.Library.String qspec)
 Get full normalised path to the external file that would be exported to given a root directory. More...
 
_.Library.Status Load (_.Library.String filename, _.Library.String qspec, _.Library.String errorlog, _.Library.GlobalCharacterStream loaded, _.Library.Boolean listonly, _.Library.String selecteditems, _.Library.String displayname, _.Library.Boolean header, _.Library.String charset)
 Load a file from disk. More...
 
_.Library.Status LoadDir (_.Library.String dir, _.Library.String qspec, _.Library.String errorlog, _.Library.Boolean recurse, _.Library.GlobalCharacterStream loaded, _.Library.Boolean listonly, _.Library.String selectedlist, _.Library.Boolean header)
 Load all Exchange Items from XML files in a directory.
 
 ShowQualifiers (_.Library.String group)
 Display the list of qualifiers defined in the system.
 

Static Private Member Functions

_.Library.String __GetName (_.Library.List Oid, _.Library.String Guid, qstruct)
 Returns the filename to be used for an item based on the selected qualifiers.
 
_.Library.Status __GetReferences (_.Library.RegisteredObject Obj, _.Library.String references, _.Library.String qstruct, _.Library.Numeric ReferenceDepth, _.Library.Boolean ReferencesLimited)
 Takes an object referece so that it can support serial objects.
 
_.Library.Status __exportItems (_.Library.String filename, _.Library.String qspec, _.Library.String items, _.Library.String Charset)
 Internal method to export a list of items to a file. More...
 
 __initQualifier (_.Library.String group, _.Library.String qtable)
 Initialise Qualifier details.
 
_.Library.Status __normalizeItems (_.Library.String list, _.Library.String items)
 Oids potentially contain any character. More...
 
 __qualifierParse (_.Library.String group, _.Library.String qspec, _.Library.String qstruct)
 Parse Qualifier details.
 

Additional Inherited Members

- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Detailed Description

The <class>XML.Exchange</class> class provides an interface for managing XML representations of objects.

Member Function Documentation

◆ CheckGUIDs()

_.Library.Status CheckGUIDs ( _.Library.Boolean  ApplyChange)
static

This method looks for inconsistencies in the GUID allocation.

It may optionally correct problems if possible.
The identifiable issues and their resolutions are:

  • GUID entry missing OID cross reference
    • If the object exists then add the OID cross reference
    • If the object does not exist then remove the GUID entry
  • GUID entry conflicts with OID cross reference
    • Manual intervention required
  • GUID entry for missing object
    • Remove both the GUID entry and the OID cross reference
  • GUID entry for missing class
    • Remove both the GUID entry and the OID cross reference
  • OID cross reference missing GUID entry
    • If the object exists add the GUID entry
    • If the object does not exist remove the OID cross reference
  • OID cross reference conflicts with GUID entry
    • Manual intervention required


The method will output results as the check proceeds and show a tally when the check is complete.

◆ Export()

_.Library.Status Export ( _.Library.String  items,
_.Library.String  filename,
_.Library.String  qspec,
_.Library.String  errorlog,
_.Library.String  Charset 
)
static

Export Exchange Items to an XML file.

Each of the items must be of a type that extends the XML.Exchange.Adaptor class: If exporting multiple Exchange Items pass the items("oid")="" as an array.

If the output filename is empty, matching Exchange Items will be exported to the current device.

◆ ExportDir()

_.Library.Status ExportDir ( _.Library.String  items,
_.Library.String  dir,
_.Library.String  qspec,
_.Library.String  errorlog,
_.Library.String  Charset,
_.Library.GlobalCharacterStream  exported,
_.Library.Boolean  header 
)
static

Export Exchange Items to a directory.


The directory structure created is based on the type of Exchange Items being exported. The file names used can be controlled by the /name qualifier.

Each of the items must be of a type that extends the XML.Exchange.Adaptor class. If exporting multiple Exchange Items pass the items("oid")="" as an array.

◆ GetDescription()

_.Library.String GetDescription ( _.Library.String  Oid)
static

Returns a description to be used for the element.

This value is based on the objects XMLExchangeName method.

◆ GetPath()

_.Library.String GetPath ( _.Library.String  Root,
_.Library.List  Oid,
_.Library.String  qspec 
)
static

Get full normalised path to the external file that would be exported to given a root directory.

Qualifiers can be used to indicate the naming convention to be used.

◆ Load()

_.Library.Status Load ( _.Library.String  filename,
_.Library.String  qspec,
_.Library.String  errorlog,
_.Library.GlobalCharacterStream  loaded,
_.Library.Boolean  listonly,
_.Library.String  selecteditems,
_.Library.String  displayname,
_.Library.Boolean  header,
_.Library.String  charset 
)
static

Load a file from disk.

Load Exchange Items from the file file. Returns an stream of Exchange Items it loaded in loaded, You may give it a list of files to load via a single subscripted array. If you pass listonly as true then it will not load anything but just list the Exchange Items that exist in the files that you supply it.
If selecteditems is defined then this will contain a single subscripted array of items to load. It will only load items that are in this list from the file/s provided, so this provides a way to limit which items get loaded.
qspec is a list of qualifiers which can be displayed with 'Do ##class(XML.Exchange).ShowQualifiers()'

◆ __exportItems()

_.Library.Status __exportItems ( _.Library.String  filename,
_.Library.String  qspec,
_.Library.String  items,
_.Library.String  Charset 
)
staticprivate

Internal method to export a list of items to a file.

Items to be exported may be preloaded into the "selected" list.

◆ __normalizeItems()

_.Library.Status __normalizeItems ( _.Library.String  list,
_.Library.String  items 
)
staticprivate

Oids potentially contain any character.

Therefore no delimited strings are supported.