Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Merged branch "DOC0000091" into parent

This class provides methods that allow importing data from external parties.

SimpleImport()


Instantiates a new SimpleImport class object.

Example:

Code Block
languagejs
themeEclipse
titleSimpleImport
linenumberstrue
letconst imp = new SimpleImport();

getErrorMessage()

This method returns the current error message.


Return:

TypeDescription
StringThe error message text


Code Block
languagejs
themeEclipse
titlegetErrorMessage
linenumberstrue
const imp = new SimpleImport();
if (imp.transform(current)) {
    ss.addInfoMessage('Import succeeded');
} else {
    ss.addErrorMessage(imp.getErrorMessage());
}

import(record, testMode)


The method takes the record from the the Import Sources (sys_import_source) tables and imports the entries from the attachment to the table created via the the Import Set Table Name (import_set_table_name) field of the the Import Sources (sys_import_source table) table. As a result, we get a table with temporary records - an Importset, from which the records import to any other table will be performed.

The record parameter must be the record from the the Import Sources (sys_import_source) table.

The testmode parameter is a Boolean parameter. If its value is TRUE'true', then it will perform the test import and indicate operation status as "test".


Parameter(s):

NameTypeMandatoryDefault Value
recordSimpleRecordYN
testModeBooleanNFALSE'false'


Return:

TypeDescription
VoidThis method does not return a value.


Example:

Code Block
languagejs
themeEclipse
titleimport
linenumberstrue
constvar imp = new SimpleImport();
imp.import(current);


importTransform(record)


This method is used for the automatic scheduled import.

The record parameter must be the record from the the Scheduled Imports (sys_schedule_import table) table.

Method gets the record from the the Scheduled Imports (sys_schedule_import table ) table and performs import and transform in one time.


Parameter(s):

NameTypeMandatoryDefault Value
recordSimpleRecordYN


Return:

TypeDescription
Void

This method does not return a value.


Example:

Code Block
languagejs
themeEclipse
titleimportTransform
linenumberstrue
varconst imp = new SimpleImport();
imp.importTransform(current);

testLdapConnection(record)


This method checks the connection to the LDAP server and alerts about the successful connection, or about an error.

The record parameter must be the filled with the sys_id of the LDAP server (The record parameter must be the record from the sys_ldap_server or sys_ldap_definition tables.) table element related with this connection.  


Parameter(s):

NameTypeMandatoryDefault Value
record

SimpleRecord

(object of the LDAP server (sys_ldap_server) table)

YN


Return:

TypeDescription
ObjectReturns an object containing LDAP server connection status or connection error message (in case of connectivity issues).


Example:

Code Block
languagejs
themeEclipse
titletestLdapConnection
linenumberstrue
const imp = new SimpleImport();
const result = imp.testLdapConnection(current);
if (result.flash.type === "success") {
    ss.addInfoMessage(result.flash.message);
    return;
}
if (result.flash.type === "error") {
    ss.addErrorMessage(result.flash.message);
}


testLdapConnections(record)


This method checks all connections This method checks the connection to the LDAP server and alerts about the successful connection, or about an error.

The record parameter must be the filled with the sys_id of the LDAP server (sys_ldap_server) table element related with this connection. 


Parameter(s):

NameTypeMandatoryDefault Value
record

SimpleRecord

(object of the LDAP server (sys_ldap_server) table)

YN


Return:

TypeDescription
ArrayObjectReturns array containing description of connection statusan object containing LDAP server connections statuses or connection error messages (in case of connectivity issues).


Example:

Code Block
languagejs
themeEclipse
titletestLdapConnection
linenumberstrue
constvar imp = new SimpleImport();
varconst result = imp.testLdapConnectiontestLdapConnections(current);
if (result.flash.type === "success") {
	ss.addInfoMessage(result.flash.message);
    return;
}
if (result.flash.type === "error") {
	ss.addErrorMessage(result.flash.message);
}

transform(record)


This method transposes entries from the import set to the table. It uses the active transform map, which is located in the systhe Transform Maps (sys_transform_map_transform table) table.

  • source - the current import set table
  • target - the destination import set table.

The record parameter must be the entry from the the Import Set (sys_import_set) table.

A transform map is a set of field maps that determine the relationships between fields in an import set and fields in an existing table.


Parameter(s):

NameTypeMandatoryDefault Value
recordSimpleRecordYN


Return:

TypeDescription
VoidThis method does not return a value.


Example:

Code Block
languagejs
themeEclipse
titletransform
linenumberstrue
constvar imp = new SimpleImport();
imp.transform(current);


Table of Contents
absoluteUrltrue
classfixedPosition