Examples of Mapping - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

Maps.cfg

Maps.cfg contains two variables that point to two other types of configuration files - one file to have a list of filenames that contain name maps and one file to contain a list of filenames that contain value maps.

Format:

SPFNameMaps|FileName

SPFValueMaps|FileName

Example:

SPFNameMaps|MapFilesName.cfg

SPFValueMaps|MapFilesValue.cfg

Name and value configuration files

MapFilesName.cfg and MapFilesValue.cfg contain a list of mapping files.

Format:

Filename

Filename

Example:

SPFGeneralNames.map

SPFDocumentNames.map

SPFFolderNames.map

Filenames should not contain any path, and there should be one filename per line.

The name map file

Name map file is an ASCII text file that contains the name mapping information.

Format:

SPFClassDefName|SPF_Name|Foreign_Name

Or

SPFClassDefName|SPF_Name|Foreign_Name|Special directive

If ALL is used as SPFClassDefName, the mapping is valid for all incoming classes. Mapping of Class Names must happen in "ALL" context. All data is case sensitive.

Example:

ALL|CreationDate|DEVCreationDate

CreationDate is converted to DEVCreationDate for all classes

Example:

ALL|SPFFolder|OutSPFFolder

Class definition name SPFFolder is converted to OutSPFFolder

Example:

SPFFolder|LastUpdatedDate|DEVUpdatedDate

LastUpdatedDate is converted to DEVUpdatedDate for SPFFolder.

Special directives:

A - Add this attribute to the object

D - Delete this attribute from the object

Example:

SPFFolder|CreationDate|DEVCreationDate|D

If input contains the attribute CreationDate, it is removed.

Example:

SPFFolder|ExportedFrom|SPFServer|A

An attribute named ExportedFrom with a value of SPFServer is added to SPFFolder.

The value map file

Value map file is an ASCII text file that contains the value mapping information. It is not necessary to specify value map if you don’t need one.

Format:

SPF_Attribute_Name|SPF_Value|Foreign_Value

Example:

TerminationDate|9999/12/31-23:59:59:999|Active

Example of using SPFMapper below.

Dim lobjMapper As ISPFMapperProvider

Dim lobjTransferObjectToMap As XFRDataTransfer

Dim lobjTransferObjectMapped As XFRDataTransfer

'

' Get the transfer object to map

' Initialize the mapper

'

lobjMapper = FactoryMapperProviderClass.Instantiate(lobjSessionState)

'

' Call map method to mapping data

'

lobjTransferObjectMapped= lobjMapper.Map(lobjTransferObjectToMap)