Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [Ens] >  [Config] >  [DefaultSettings]
Private  Storage   

persistent class Ens.Config.DefaultSettings extends %Persistent, %XML.Adaptor

This class stores and provides an API for system-wide Production default settings.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
2 8 13 1 1 3


Summary

Properties
Deployable Description HostClassName ItemName ProductionName
SettingName SettingValue

Methods
%AddToSaveSet %AddToSyncSet %BMEBuilt %CheckConstraints
%CheckConstraintsForExtent %ClassIsLatestVersion %ClassName %ClearSettings
%ClearStudioDocuments %ComposeOid %ConstructClone %Delete
%DeleteExtent %DeleteId %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty
%DispatchSetProperty %Exists %ExistsId %Export
%ExportStudioDocuments %Extends %GUID %GUIDSet
%GetLock %GetParameter %GetSetting %GetSwizzleObject
%Id %Import %ImportStudioDocuments %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 UpdateProductionModFlags XMLDTD
XMLExport XMLExportToStream XMLExportToString XMLNew
XMLSchema XMLSchemaNamespace XMLSchemaType


Parameters

• parameter XMLIGNOREINVALIDATTRIBUTE = 0;
The XMLIGNOREINVALIDATTRIBUTE parameter allows the programmer to control handling of unexpected attributes in the XML input. By default (XMLIGNOREINVALIDATTRIBUTE = 1), will ignore unexpected attributes. If XMLIGNOREINVALIDATTRIBUTE is set = 0, then an unexpected attribute will be treated as an error.
• parameter XMLNAME = "item";
This parameter provides the default XMLNAME for the class. If it is empty then the class name will be used to construct a default XML name. The default XMLNAME is used as the top level tag when exporting objects and the export context did not provide an XML container name.

Properties

• property Deployable as %Boolean [ InitialExpression = 0 ];
Indicates whether this system default setting can be exported for deployment.
• property Description as %String(MAXLEN=2000,XMLNAME="description",XMLPROJECTION="attribute");
Optional description for this item.
• property HostClassName as %String(MAXLEN=255,XMLNAME="class",XMLPROJECTION="attribute") [ InitialExpression = "*" ];
Host class name.
• property ItemName as %String(MAXLEN=255,XMLNAME="item",XMLPROJECTION="attribute") [ InitialExpression = "*" ];
Host config name.
• property ProductionName as %String(MAXLEN=255,XMLNAME="production",XMLPROJECTION="attribute") [ InitialExpression = "*" ];
Production name.
• property SettingName as %String(MAXLEN=255,XMLNAME="setting",XMLPROJECTION="attribute") [ InitialExpression = "*" ];
Setting name.
• property SettingValue as %String(MAXLEN=2000,XMLNAME="value",XMLPROJECTION="attribute");
Setting value.

Methods

• classmethod %ClearSettings(pProduction As %String = "")
Delete the contents of the Default Settings table.
If pProduction is provided then just clear settings for this production, otherwise clear all settings.
• classmethod %ClearStudioDocuments(ByRef pIDsToKeep As %String = "")
Delete the deployable contents of the Default Settings table which are projected as one Studio document.
If pIDsToKeep array is passed in where the subscript is the settings id then those settings will not be deleted.
• classmethod %Export(pFileName As %String = "", pProductionName As %String = "", pDeployable As %Boolean = "") as %Status
Export Default Settings data to file pFileName. If pProductionName is provided, then only export data that refers to this production.
If pDeployable is not defined, then export both Deployable and non Deployable. This is the default
If pDeployable is set to True, then only export data that is marked as Deployable.
If pDeployable is set to False, then only export data that is marked as not Deployable.
• classmethod %ExportStudioDocuments(pStream As %String = "") as %Status
Export Default Settings that are deployable to stream pStream.
• classmethod %GetSetting(pProductionName As %String, pItemName As %String, pHostClassName As %String, pTargetType As %String, pSettingName As %String, Output pValue As %String) as %Boolean
Look up a setting value from the Default Settings table given the production name, class name, configured name, and setting property name.
Returns a boolean to indicate if the given setting is found or not. On return, pValue will contain the value of the setting if the setting is found.
• classmethod %Import(pFileName As %String = "", Output pCount As %Integer, ByRef pIDsImported As %String = "") as %Status
Import Default Settings data from the xml file pFileName.
Lookup data is in the form:
	<defaultSettings>
	<item production="*" class="MyPkg.MyClass" name="MyName" setting="PortNumber" value="1961"/>
	</defaultSettings>
• classmethod %ImportStudioDocuments(pStream As %String = "") as %Status
Import method for rows projected in studio document and then remove those that weren't imported after.
• classmethod UpdateProductionModFlags(pProduction As %String = "*")
Update the flags that track modifications to production settings.

Queries

• query EnumerateSettings()
SQL Query :
SELECT ID,ProductionName,ItemName,HostClassName,SettingName,SettingValue,Deployable FROM DefaultSettings

Indices

•index (IdKey on ProductionName,ItemName,HostClassName,SettingName) [IdKey];

Triggers

•trigger OnChange (AFTER event INSERT/UPDATE/DELETE)
Ensure that SQL updates to the Default Settings are tracked.
•trigger OnDelete (AFTER event DELETE)
Update the timestamp whenever a deployable row is removed from a table.
•trigger OnModify (AFTER event INSERT/UPDATE)
Update the timestamp for the settings whenever an entry is added or updated that is deployable.


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