01. Navigation Attribute
At first we need to configure navigation attribute for the organization with the following commands.
AddNavPageAttribute [path] System.Customer.NIUserCsvIntegrator.IsTestMode True
AddNavPageAttribute [path] System.Customer.Integrator.NIUserCsvIntegrator.CsvDelimiter ","
AddNavPageAttribute [path] System.Customer.Integrator.NIUserCsvIntegrator.ImportFileBackupPath [value]
AddNavPageAttribute [path] System.Customer.Integrator.NIUserCsvIntegrator.ImportFilePath [value]
AddNavPageAttribute [path] System.Customer.Integrator.NIUserCsvIntegrator.SchedulePeriod "1"
AddNavPageAttribute [path] System.Customer.Integrator.NIUserCsvIntegrator.PollingInterval "1"
AddNavPageAttribute [path] System.Customer.Integrator.NIUserCsvIntegrator.CsvTranslations [value]
Example of CsvTranslations:
AddNavPageAttribute [path] System.Customer.Integrator.NIUserCsvIntegrator.CsvTranslations OrgLoginId=UniqueUserID,FirstName=FirstName,LastName=LastName,Password=DateOfBirth,EmailAddress=PersonalEmailAddress,Rank=Rank,Vessel=Vessel,Language=Language,DeptCode=DeptCode,Deactivate (X)=Deactivate (X)
In csv translation, the right side of the '=' is the column name in the csv whereas the left side is the system properly name.
02. User Integrator Configuration
Now we need to configure the UserIntegratorConfigFile.json file which contains the configuration of how imported data will be processed. This file has 10 different section for different purposes.
DataConsistencyCheckConfiguration
ValueMappingConfiguration
DataSanitationConfiguration
ResetFieldsToDefaultIfEmptyConfiguration
DataFormattingConfiguration
DataAssemblerConfiguration
DataValidationConfiguration
PasswordConfiguration
AutoUserDeactivationConfiguration
UserImporterConfiguration
DataConsistencyCheckConfiguration:
"DataConsistencyCheckConfiguration" : {
}
Currently there is no configurations in this section here
ValueMappingConfiguration:
"ValueMappingConfiguration": {
"FieldNamesWithMapping": [
{
"FieldName": "Rank",
"MappingMode": "Complete",
"MappingFileName": "ValueMapping-Rank.json"
}
]
}
If a user field value needs to be mapped to a different value then this section can be configured. Value mapping is only available for OPFs.
FieldName: It points to the field in LMS
MappingMode: It can be three different types.
Complete (default): For ScS field, all the values must be present as target value in the value mapping file. Otherwise it will be considered as configuration error.
WarnIfMappingIsMissing: Ignores any missing mapping and try to set the OPF value as is. Add a warning to the notification
IgnoreMissingMappings: Ignore any missing mapping and try to set the OPF value as is - without mapping. Don’t add a warning/error to the notification.
MappingFileName: This property points to the location of the file that contains the mapping of source value and target value.
Example for a ValueMappingRank.json array
[
{
"SourceValue": "Capt.",
"TargetValue": "Captain"
},
{
"SourceValue": "Captain",
"TargetValue": "Captain"
},
{
"SourceValue": "1st Eng.",
"TargetValue": "First Engineer"
},
{
"SourceValue": "2nd Eng.",
"TargetValue": "Second Engineer"
}
]
DataSanitationConfiguration
Sample Configuration:
"DataSanitationConfiguration": {
"FieldsToSanitize": [
{
"FieldName": "DeptCode",
"ReduceToSingleWhiteSpace": "true",
"SanitizeValues": [
{
"Original": "XT",
"Replacement": "xt"
},
{
"Original": ",",
"Replacement": "+"
}
]
}
]
}
The user importer can configure OPFs/user properties which need to be ‘sanitized’. Other than this there are few sanitization rules which are applied by default.
FieldName: The name of the field to be sanitized.
ReduceToSingleWhiteSpace: If this value is true, multiple white spaces will be trimmed to single whitespace. (i.e “Mobile Phone“ => “Mobile Phone“)
SanitizeValues: It contains the original and replacement values for the field.
ResetFieldsToDefaultIfEmptyConfiguration
Sample Configuration
"ResetFieldsToDefaultIfEmptyConfiguration": { "ResetFieldsToDefaultIfEmpty": [ "Vessel", "Rank", "EmbarkmentDate" ] }
If any user property is not provided or provided as empty and that property is added in this ResetFieldsToDefaultIfEmpty array, it sets default value for that property depending on the data type.
Add Comment