Skip to main content

Config.CommonMapMethods

abstract class Config.CommonMapMethods extends Config.CommonMethods

This class contains methods which are common (inherited) by classes which manipulate namespace mappings in the CPF file.

Method Inventory

Parameters

parameter SECTIONTYPE = 2;
This parameter governs how the class creates audit records.
Value = 0 - Class contains a single entry (SQL, Net, etc.)
Value = 1 - Class contains multiple entries (Databases, Namespaces, etc.)
Value = 2 - Class deals with mappings (MapGlobals, MapRoutines, MapPackages.)

Methods

classmethod Create(Namespace As %String, Name As %String, ByRef Properties As %String, ByRef CPFFile As %String = "", Flags As %Integer = $$$CPFSave+$$$CPFWrite+$$$CPFActivate)
Create a mapping in the CPF file.
Parameters:
Namespace - Namespace to create mapping for.
Name - Name of the mapping.
Properties - Array of properties used to create the mapping. See the subclass for a list of valid properties.
CPFFile (byref) - Name of the CPF file to use, Default=current active CPF file. The file must have a .CPF file extension if specified.
Flags - (From %syConfig.inc) Bit string of flags which governs how the mappings are added.
Bit $$$CPFSave - Save the Mappings to the CPF object.
Bit $$$CPFWrite - Write the CPF object to the CPF file.
Bit $$$CPFActivate - Activate the Mappings on the system if the CPF file is the current active file.
By default, all these bits are set, and you should normally not pass this parameter. If you are modifying a CPF file which is not the active CPF file, Bit $$$CPFActivate is ignored.
If you have a batch of updates to do to the same namespace, then you should pass only Bit $$$CPFSave for each call. Then when creating the last one, don't pass this parameter (default=All bits). This will cause all the previous additions to be written to the CPF file and activated all at once.
If you want to update several different namespaces at the same time you should use the following mechanism:
1) Pass the flag $$$CPFSave on all the calls to update the object (without writing to the CPF or activating it.) You could also pass the Write to CPF flag here if you want all your changes written out to the CPF immediately.
2) When you are finished with your updates, call Config.CPF.Write() to write out your changes to the CPF file (if you didn't pass the write to cpf flag in step #1)
3) Now Call Config.CPF.Activate() to load and activate all the new mappings.
Return values:
CPFFile (byref) - Name of the CPF file the modification was made in.
classmethod Delete(Namespace As %String, Name As %String, ByRef CPFFile As %String = "", Flags As %Integer = $$$CPFSave+$$$CPFWrite+$$$CPFActivate) as %Status
Delete a mapping from a CPF file.

Parameters:
Namespace - Namespace to delete the mapping from.
Name - Name of the mapping to delete.
CPFFile (byref) - Name of the CPF file to use, Default=current active CPF file. The file must have a .CPF file extension if specified.
Flags - Bit string of options to perform. See the Create() method for values.

Return values:
CPFFile (byref) - Name of the CPF file the modification was made in.
classmethod Exists(Namespace, Name As %String, ByRef Obj As %ObjectHandle, ByRef Status As %Status, ByRef CPFFile As %String = "", Flags As %Integer = $$$CPFSave+$$$CPFWrite+$$$CPFActivate) as %Boolean
Checks for the existence of a mapping in a CPF file.

Parameters:
Namespace - Namespace of the mapping.
Name - Name of the mapping to check existence of.
CPFFile (byref) - Name of the CPF file to use, Default=current active CPF file. The file must have a .CPF file extension if specified.
Flags - Bit string of options to perform if the object is later saved with the %Save() method. See the Create() method for values.

Return values:
If Value of the method = 0 (Mapping does not exist, or some error occured)
Obj = Null
Status = Mapping "x" does not exist, or other error message

If Value of the method = 1 (Mapping exists)
Obj = Object handle to Mapping
CPFFile = Name of the CPF file the properties were retrieved from.
Status = MapGlobal "x" already exists

classmethod Get(Namespace As %String, Name As %String, ByRef Properties As %String, ByRef CPFFile As %String = "", Flags As %Integer = $$$CPFSave+$$$CPFWrite+$$$CPFActivate) as %Status
Get a mapping's properties from a CPF file.

Parameters:
Namespace - Namespace of the mapping.
Name - Name of the mapping to get.
CPFFile (byref) - Name of the CPF file to use, Default=current active CPF file. The file must have a .CPF file extension if specified.

Return values:
Properties (byref) - List of the properties in Properties(Name)=Value format. See the subclass for a list of valid properties.
CPFFile (byref) - Name of the CPF file the properties were retrieved from.
classmethod GetList(Namespace As %String, Name As %String, ByRef CPFFile As %String = "", Flags As %Integer = $$$CPFSave+$$$CPFWrite+$$$CPFActivate) as %Status
Returns the properties from a instance of a mapping section from a CPF file by value in $list format

Parameters:
Namespace - Namespace of the mapping.
Name - Name of the instance to get.
CPFFile (byref) - Name of the CPF file to use, Default=current active CPF file. The file must have a .CPF file extension if specified.

Return value:
      $lb(%Status,Result)
      where Result=$LB($LB(property name,value),...) for each property in the instance of the section
classmethod Modify(Namespace As %String, Name As %String, ByRef Properties As %String, ByRef CPFFile As %String = "", Flags As %Integer = $$$CPFSave+$$$CPFWrite+$$$CPFActivate) as %Status
Modify a mapping in a CPF file.

Parameters:
Namespace - Namespace of the mapping.
Name - Name of the mapping to modify.
Properties (byref) - List of the properties to modify in Properties(Name)=Value format. See the subclass for a list of valid properties. If a specific property is not passed in the properties array, the value is not modified.
CPFFile (byref) - Name of the CPF file to use, Default=current active CPF file. The file must have a .CPF file extension if specified.
Flags - Bit string of options to perform. See the Create() method for values.


Return values:
CPFFile (byref) - Name of the CPF file the modification was made in.
classmethod Open(Namespace As %String, Name As %String, ByRef CPFFile As %String = "", concurrency As %Integer = -1, ByRef Status As %Status, Flags As %Integer = $$$CPFSave+$$$CPFWrite+$$$CPFActivate) as %ObjectHandle
Open an instance of a mapping object in a CPF file.

Parameters:
Name - Name of the mapping to open
CPFFile (byref) - Name of the CPF file to use, Default=current active CPF file. The file must have a .CPF file extension if specified.
Flags - Bit string of options to perform if the object is later saved with the %Save() method. See the Create() method for values.

Return Values:
CPFFile (byref) - Name of the CPF file the object was opened in.

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab