SchemaMap.Tool.Data.Write
abstract class SchemaMap.Tool.Data.Write
provides utility methods for writing information out to the mapping data tables: "create, update, delete" for CRUDMethod Inventory
- ActiveRow()
- AddElementToPath()
- AddRow()
- ApplyAllTargetTransform()
- CheckMatch()
- CleanUpMappings()
- ClearResource()
- DeleteRow()
- EnsureUtility()
- GenerateExtensionURL()
- MappingForPath()
- NewTransform()
- ObjectToObject()
- PathFromProperty()
- ReloadAutoMappings()
- RemoveEmptyRows()
- ReplaceMappingsWithTransforms()
- SaveRow()
- ShouldOverwrite()
- UpdateTableWithNewTransform()
Methods
classmethod ActiveRow(from As %String, to As %String, status As %Boolean = 1, resource As %String = "", row As %String = "") as %Status
Mark a row or rows active or inactive, according to the input status value.
row is a row id value in the mapping table indicated by from and to.
row may be a comma-separated list of row id values, or only 1 row id value.
row takes precedence over resource if both are supplied.
If there is no row value, and there is a resource value, all rows mapped from that source resource will be marked as indicated.
Add an element name to the given path, always making sure the format has a ":" between the resource and first
level of element, but only "." afterwards.
classmethod AddRow(from As %String, to As %String, fromPath As %String = "", sourceValue As %String = "") as %Status
Adds an empty row in the mapping table.
classmethod ApplyAllTargetTransform(from As %String, to As %String, id As %String = "", fromPath As %String = "", toXF As %String = "", Output userMessage As %String = "") as %Status
Applies the input toXF value to the TargetTransform column for all mapping table rows whose SourcePath indicates the same resource as the fromPath.
userMessage will return any message for the user, if it's necessary.
classmethod CheckMatch(fromClass As %String, toClass As %String, Output exactMatch As %Boolean = 0, level As %Integer = 1) as %Status
This will go through the mapping table and clean up any stray mappings that
are handled higher up (eg. using a subtransform).
classmethod ClearResource(from As %String, to As %String, resource As %String, clearAll As %Boolean = 0) as %Status
Clears out all mappings for a given resource. If clearAll is true, everything for that resource is deleted.
If it is false, only those mappings that were auto-mapped will be deleted.
During this operation, empty mapping table entries created to support UI operations are also deleted.
Deletes a row in the mapping table.
classmethod EnsureUtility(from As %String, to As %String, fromPath As %String = "", toPath As %String = "", autoMapped As %Boolean, Output subtransform As %String = "", Output classMethod As %String = "", Output notValid As %Boolean) as %Status
Checks to see if there is a potential subtransform or classmethod that can be used for this transform. If so, they will be
returned in subtransform or classMethod. notValid will return true if no such utility can
be found and the mapping is determined to need one.
classmethod GenerateExtensionURL(from As %String, fromPath As %String, Output url As %String) as %Status
classmethod MappingForPath(from As %String, to As %String, fromPath As %String, Output rowId As %String) as %Status
Returns the rowId for a mapping given the fromPath. Used to determine whether the path needs another
mapping. If it already has one, we can skip it.
classmethod NewTransform(from As %String, to As %String, source As %String, target As %String, DTLName As %String) as %Status
classmethod ObjectToObject(from As %String, to As %String, fromPath As %String, toPath As %String) as %Status
Maps the contents of fromPath to the contents of toPath. It is assumed both paths
are objects. It will also attempt to map a field to an extension in the target schema if there is no
better matching field.
This will go through the mapping table, clear, and re-automap
every resource.
Remove any empty mapping table rows for the specified mapping table (from and to).
If fromPath is supplied and non-empty, only delete rows for the specified fromPath.
The fromPath value is exact ONLY.
classmethod ReplaceMappingsWithTransforms(package As %String, from As %String, to As %String, fromResource As %String) as %Status
This will search the mappings for the given resource, and for each object in that resource see if there are entries in the
mapping table with a type that matches the object's type. If there are, it will generate that transform first then update
the object's mapping in the given resource to use that subtransform.
classmethod SaveRow(from As %String, to As %String, id As %String = "", fromPath As %String = "", sourceValue As %String = "", sourceXF As %String = "", toPath As %String = "", toXF As %String = "", autoMapped As %Boolean = 0, subtransform As %String = "", classMethod As %String = "", defaultValue As %String = "", extension As %String = "", dependsOn As %String = "", mapNotes As %String = "", append As %Boolean = 0, exclude As %String = "", active As %Boolean = 1, Output userMessage As %String = "") as %Status
Saves a new row in the mapping table. If autoMapped is true, anything contained within fromPath will also
be mapped, if possible. userMessage will return any message for the user, if it's necessary.
classmethod ShouldOverwrite(from As %String, to As %String, path As %String, Output overwrite As %Boolean) as %Status
overwrite returns true when it is safe to overwrite a mapping for an object. It checks
to make sure there are no manual mappings within the object at the path.
classmethod UpdateTableWithNewTransform(from As %String, to As %String, transform As %String) as %Status
This will go through the mapping table and see if there are any instances where the
newly created transform could replace existing mappings, and will update those entries.