Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [%SYS] >  [Config] >  [NLS] >  [Tables]
Private  Storage   

persistent class Config.NLS.Tables extends %Persistent, %XML.Adaptor, %SYSTEM.Help

This class describes the basic properties of a table and, depending on its type, can also contain the table data itself.

For types XLT, COL, and Case, the data points are stored in a SubTable object. For types Patcode, Ident and XY, the data points are kept in the Table object itself. Mode tables use a hybrid mechanism, with the modal escape sequences kept in the Table and the data points in a Mode SubTable. Pattern tables keep the pattern code ranges but also point to a Patcode Table.

Warning!

Only tables which have a "NameFrom" or "NameTo" property beginning with "y" (e.g. "yPrinterXYZ" or "yMytable") are considered custom tables and are preserved during system upgrades. All other tables are restored to their original state and any changes to them made with methods from this class will be lost in an upgrade.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 17 38 3 1


Summary

Properties
COLRules Description Identifiers Modes
NameFrom NameTo PatAliases PatCodes
PatternRanges SubTableName Type XLTDefaultAction
XLTModeTableName XLTReplacementValue XLTReversibility XLTType
XYActions

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ComposeOid
%ConstructClone %Delete %DeleteExtent %DeleteId
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Exists
%ExistsId %Extends %GUID %GUIDSet
%GetLock %GetParameter %GetSwizzleObject %Id
%InsertBatch %IsA %IsModified %IsNull
%KillExtent %KillExtentData %LoadFromMemory %LockExtent
%LockId %New %NormalizeObject %ObjectIsNull
%ObjectModified %Oid %OnBeforeAddToSync %OnDetermineClass
%Open %OpenId %OriginalNamespace %PackageName
%PhysicalAddress %PurgeIndices %Reload %RemoveFromSaveSet
%ResolveConcurrencyConflict %RollBack %Save %SaveDirect
%SaveIndices %SerializeObject %SetModified %SortBegin
%SortEnd %SyncObjectIn %SyncTransport %UnlockExtent
%UnlockId %ValidateIndices %ValidateObject Compile
Create CreateSkeleton Delete Exists
Export ExportAllToNls ExportDir ExportList
ExportToNls FromToDeleteRow FromToEditRow Get
GetPropertiesFromNls Help Import ImportAllFromNls
ImportDir ImportFromNls IsLoadable IsValid
Load Modify SetPropertiesToNls XMLDTD
XMLExport XMLExportToStream XMLExportToString XMLNew
XMLSchema XMLSchemaNamespace XMLSchemaType


Parameters

• parameter DOMAIN = "%Utility";
Default Localization Domain

Properties

• property COLRules as %List;
For Collation tables only.
$LB(collation #,local encoding rule,global encoding rule)
• property Description as %String(MAXLEN=128);
Description of the Table.
• property Identifiers as %List;
For Identifier tables only.
$LB("start:num","start:num",...)
• property Modes as array of %String;
For Mode tables only.
array({mode-index})="mode-name:mode-bytes:mode-seq"
• property NameFrom as %String(MAXLEN=64,MINLEN=1) [ Required ];
For XLT tables this corresponds to the source encoding or character set. For the other types this is the character set used by the current locale.
• property NameTo as %String(MAXLEN=64,MINLEN=1) [ Required ];
For XLT tables this corresponds to the target encoding or character set. For the other types is is usually the name of the table.
• property PatAliases as %List;
For Patcode tables only.
$LB("alias:codes","alias:codes",...)
• property PatCodes as %List;
For Patcode tables only.
$LB("code:num","code:num",...)
• property PatternRanges as array of %List;
For pattern tables only.
array("A")=$LB("start:num","start:num",...)
• property SubTableName as %String;
For LowerCase, UpperCase, TitleCase, XLT, COL and Pattern tables.
• property Type as %String(MAXLEN=10,MINLEN=1) [ Required ];
Type of table:
Lowercase, UpperCase, TitleCase,
XLT, COL, Mode, Pattern, Ident, XY, Patcode
• property XLTDefaultAction as %Integer;
For XLT tables only.
XLT Default actions:
0 - Generate error
1 - Replace with replacement string/value
2 - Replace with original string/value (ignore)
• property XLTModeTableName as %String;
For XLT modal tables only.
XLT Name of mode table.
• property XLTReplacementValue as %String;
For XLT tables only.
XLT Replacement value.
• property XLTReversibility as %Integer;
For XLT tables only.
XLT Reversibility:
0 - Non-reversible (ambiguous)
1 - Reversible
2 - Generated from a reversible table
• property XLTType as %Integer;
For XLT tables only.
XLT Table type:
0 - Non-modal to non-modal
1 - Non-modal to modal
2 - Modal to modal
• property XYActions as array of %List;
For XY table only.
array({xytype})=$LB("start:num","start:num",...)
xytype:
0 - Normal printing character
1 - Full width character
2 - Non printing character
3 - Backspace character
4 - Line feed character
5 - Form feed character
6 - Carriage return character
7 - Escape sequence character

Methods

• classmethod Compile(Type As %String, NameFrom As %String, NameTo As %String) as %Status
Compiles a single Table

Parameters:
  • Type - Table type (eg: "LowerCase", "COL", "XLT", etc.)
  • NameFrom - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
  • NameTo - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
• classmethod Create(Type As %String, NameFrom As %String, NameTo As %String, ByRef Properties As %String) as %Status
Creates a Table the NLS database.

Parameters:
  • Type - Table type (eg: "LowerCase", "COL", "XLT", etc.)
  • NameFrom - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
  • NameTo - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
  • Properties - Array of properties corresponding to the class properties
• classmethod CreateSkeleton(Type As %String, From As %String, To As %String, Maxchar As %Integer, ByRef Table As %ObjectHandle) as %Status
Creates a Table with common default parameters
Doesn't require passing a complete table specification.

Parameters:
  • Type - Table type (eg: "LowerCase", "COL", "XLT", etc.)
  • From - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
  • To - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
  • Maxchar - Highest character: 0 (empty), 255 (8-bit), 65535 (Unicode)
  • Table - Return oref of the created object
• classmethod Delete(Type As %String, NameFrom As %String, NameTo As %String, Deep As %Integer = 0) as %Status
Deletes a Table.

Parameters:
  • Type - Table type (eg: "LowerCase", "COL", "XLT", etc.)
  • NameFrom - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
  • NameTo - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
• classmethod Exists(Type As %String, NameFrom As %String, NameTo As %String, ByRef Table As %ObjectHandle, ByRef Status As %Status) as %Boolean
Checks for the existence of a Table in the NLS database.

Parameters:
  • Type - Table type (eg: "LowerCase", "COL", "XLT", etc.)
  • NameFrom - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
  • NameTo - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
Return values:
If Value of the method = 0 (Table does not exist, or some error occured)
  • Table = Null
  • Status = Table "x" does not exist, or other error message
If Value of the method = 1 (Table exists)
  • Table = Object handle to Table
  • Status = $$$OK
• classmethod Export(FileName As %String = "TablesExport.xml", ByRef NumExported As %Integer, Types As %String = "*", NamesFrom As %String = "*", NamesTo As %String = "*") as %Status
Exports Table Objects to a file in xml format.

Parameters:
  • FileName - Output file name
  • NumExported (byref) - Returns number of Table records exported.
  • Tables - Comma separated list of Tables to export, "*" = All
  • • classmethod ExportAllToNls(ByRef NumExported As %Integer, Deep As %Integer = 0) as %Status
    Exports all Table records to ^%nls.

    Parameters:
    • Return values: Status
    • NumExported - Number of exported tables
    • classmethod ExportDir(Dir As %String, ByRef NumExported As %Integer, Types As %String = "*", NamesFrom As %String = "*", NamesTo As %String = "*") as %Status
    Exports Table Objects to separate xml files.

    Parameters:
  • Dir - Directory where the files will be created
  • NumExported (byref) - Returns number of Table records exported.
  • Types/NamesFrom/NamesTo - Comma separated list of Tables to export, "*" = All
  • • classmethod ExportList(FileName As %String = "TablesExport.xml", ByRef NumExported As %Integer, ByRef Tables As %String) as %Status
    Similar to Export() but uses a list of Tables to export rather than a query. Used internally by Locales.ExportList() and other utilities.

    Parameters:
    • FileName - Output file name
    • NumExported - Number of exported SubTables [out]
    • Tables - Array of Tables to export
    • classmethod ExportToNls(Type As %String, NameFrom As %String, NameTo As %String, Deep As %Integer = 0) as %Status
    Exports one Table record to ^%nls.

    Parameters:
    • Type - Table type (eg: "LowerCase", "COL", "XLT", etc.)
    • NameFrom - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
    • NameTo - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
    • Deep - If true export associated SubTable(s)
    • classmethod FromToDeleteRow(Type As %String, NameFrom As %String, NameTo As %String, FromCode As %String) as %Status
    Deletes a single row in a "FromTo" table (XLT, COL or Case).

    Parameters:
    • Type - Table type (eg: "LowerCase", "COL", "XLT")
    • NameFrom - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
    • NameTo - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
    • FromCode - Source character or sequence
    • classmethod FromToEditRow(Type As %String, NameFrom As %String, NameTo As %String, FromCode As %String, ToCode As %String) as %Status
    Edits a single row in a "FromTo" table (XLT, COL or Case).

    Parameters:
    • Type - Table type (eg: "LowerCase", "COL", "XLT")
    • NameFrom - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
    • NameTo - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
    • FromCode - Source character or sequence
    • ToCode - Target character or sequence
    • classmethod Get(Type As %String, NameFrom As %String, NameTo As %String, ByRef Properties As %String) as %Status
    Gets a Table's properties from the NLS database.

    Parameters:
    • Name - Name of the Table to get
    • Properties - Array of properties. See the Create() method for a full list
    • classmethod GetPropertiesFromNls(Type As %String, NameFrom As %String, NameTo As %String, ByRef Properties As %String, Ref As %String = "^%nls") as %Status
    Gets a Table's properties from the ^%nls global.

    Parameters:
    • Type - Type of table ("XLT", "COL", etc.)
    • From - Source character set ("Latin1", "Unicode", etc)
    • To - Destination character set
    • Properties - Reference to array where properties will be stored
    • Ref - Source global reference
    See the Create method for more information on properties returned
    • classmethod Import(FileName As %String = "TablesExport.xml", ByRef NumImported As %Integer, Flags As %Integer = 0) as %Status
    Imports Table records from an xml file.

    Parameters:
    • FileName - Filename to import Table records from
    • NumImported (byref) - Returns number of records imported
    • Flags - Control import
      • Bit 0 - Do not import records, just return count
    Note: On failure, no records will be imported
    • classmethod ImportAllFromNls(ByRef NumImported As %Integer, Flags As %Integer = 0, Deep As %Integer = 0, Ref As %String = "^%nls") as %Status
    Imports Table records from ^%nls.

    Parameters:
    • NumImported (byref) - Returns number of records imported
    • Flags - Control import
      • Bit 0 - Do not import records, just return count
    • Ref - Source global reference
    • classmethod ImportDir(Dir As %String, ByRef NumImported As %String, forcemulticompile As %Boolean = "") as %Status
    Imports table files from a directory.

    Parameters:
    • Dir - Directory to import NLS files from
    • NumImported (byref) - Returns number of tables imported.
    • classmethod ImportFromNls(Type As %String, NameFrom As %String, NameTo As %String, Deep As %Integer = 0, Ref As %String = "^%nls") as %Status
    Imports one Table record from ^%nls.

    Parameters:
    • Type - Table type (eg: "LowerCase", "COL", "XLT")
    • NameFrom - Character set or name (eg: "Unicode", "DTM-J")
    • NameTo - Character set or name (eg: "Unicode", "DTM-J")
    • Deep - If true also import associated SubTables
    • Ref - Source global reference
    • classmethod IsLoadable(Type As %String, NameFrom As %String, NameTo As %String, ByRef Table As %ObjectHandle, ByRef Errors As %String) as %Boolean
    Verifies whether a table can be loaded

    Parameters:
    • Type - Table type (eg: "LowerCase", "COL", "XLT")
    • NameFrom - Character set or name (eg: "Unicode", "DTM-J")
    • NameTo - Character set or name (eg: "Unicode", "DTM-J")
    • Table - Returned Table reference
    • Errors - Returned list of errors
    Returns: True if table has been compiled and can be loaded
    False otherwise
    • classmethod IsValid(Type As %String, NameFrom As %String, NameTo As %String, ByRef Errors As %String, ByRef Warnings As %String) as %Boolean
    Verifies validity of table

    Parameters:
    • Type - Table type (eg: "LowerCase", "COL", "XLT")
    • NameFrom - Character set or name (eg: "Unicode", "DTM-J")
    • NameTo - Character set or name (eg: "Unicode", "DTM-J")
    • Errors - Returned list of errors
  • Warnings - Returned list of warnings
  • Returns: True if the table has a consistent definition
    False otherwise
    • classmethod Load(loc As %String, typ As %String, nam As %String) as %Status
    Loads a Table from a Locale.

    Parameters:
    • loc - Name of locale that contains table (eg: "jpnw")
    • typ - Type of table (eg: "XLT", "UpperCase", "XY")
    • nam - Name of table in locale (eg: "CP1252", "UnicodeBig")
    If typ="COL" or typ="XLT", loads both input and output sides.
    If loc = current locale, changes defaults if necessary
    • classmethod Modify(Type As %String, NameFrom As %String, NameTo As %String, ByRef Properties As %String) as %Status
    Modifies an existing Table's properties in the NLS database.

    Parameters:
    • Type - Table type (eg: "LowerCase", "COL", "XLT", etc.)
    • NameFrom - Source character set (eg: "Unicode", "CP1250", "DTM-J", "etc.)
    • NameTo - Target character set (eg: "Unicode", "CP1251", "Latin2", etc.)
    • Properties - Array of properties to modify.
    See the Create() method for a description of the Properties parameter.
    If a specific property is not passed in the properties array, or is the same as the existing value, the value is not modified.
    • classmethod SetPropertiesToNls(ByRef Properties As %String) as %Status
    Sets a Table's properties in ^%nls.

    Parameters:
    • Properties - Array with locale properties

    Queries

    • query Detail(Types As %String, NamesFrom As %String, NamesTo As %String)
    Selects Type As %String, NameFrom As %String, NameTo As %String, Description As %String
    List all Table records, brief display.
    Names - Comma separated list of Table names, "*" = All
    Types - Comma separated list of Table types, "*" = All
    NamesFrom - Comma separated list of source character set names, "*" = All
    NamesTo - Comma separated list of target character set names, "*" = All
    Note: This query may change in future versions
    • query FromToTable(Type As %String, NameFrom As %String, NameTo As %String)
    Selects FromCode As %String, ToCode As %String
    • query List(Types As %String = "*", NamesFrom As %String = "*", NamesTo As %String = "*")
    Selects Type As %String, NameFrom As %String, NameTo As %String, Description As %String

    Indices

    •index (TypeNameFromNameToIndex on Type,NameFrom,NameTo) [IdKey];


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