You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

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

import(record, testMode)




record - запись из таблицы sys_import_source
testMode - булево значение. Если true то проведет тестовую загрузку, обозначит статус операции как тестовый.
Метод принимает запись из таблицы sys_import_source и переносит записи из прикрипленного аттача в таблицу, которая была создана через поле import_set_table_name у sys_import_source.
В результате мы получаем таблицу со временными записями - ImportSet(из которого уже будет произведен перенос записей в любую другую таблицу).


Parameter(s):

NameTypeMandatoryDefault Value
recordSimpleRecordYN
testModeBooleanNFALSE


Return:

TypeDescription
VoidThis method does not return a value.


Example:

import
var imp = new SimpleImport();
imp.import(current);

transform(record)

This method transposes entries from the import set to the table. It uses the active transformation map, which is located in the sys_map_transform table. For this process, the field ratios must be set up in the transformation map:

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

The record parameter must be the entry from the sys_import_set table.


Уточнить у Добынды, чего тут и зачем, чтобы расписать подробнее: Для переноса в карте трансформации должны быть настроены соотношения полей (source - таблица текущего импорт сета и target - таблица в которую будет осуществлятсья перенос).


Parameter(s):

NameTypeMandatoryDefault Value
recordSimpleRecordYN


Return:

TypeDescription
VoidThis method does not return a value.


Example:

transform
var imp = new SimpleImport();
imp.transform(current);

testLdapConnection(record)

record - должен быть сущностью LdapServer или LdapDefinition
Метод проверяет подключение к Ldap серверу и выдает сообщение об успешном подключении, либо об ошибке.


Parameter(s):

NameTypeMandatoryDefault Value
recordSimpleRecordYN


Return:

TypeDescription
ArrayReturns array containing description of connection status.


Example:

testLdapConnection
var imp = new SimpleImport();
var result = imp.testLdapConnection(current);
if (result.flash.type === "success") {
	ss.addInfoMessage(result.flash.message);
}
if (result.flash.type === "error") {
	ss.addErrorMessage(result.flash.message);
} (edited)

importTransform(record)

This method is used for the automatic scheduled import.

The record parameter must be the entry from the sys_schedule_import table.

Method gets the record from the sys_schedule_import table and performs import and transform and one time.


Parameter(s):

NameTypeMandatoryDefault Value
recordSimpleRecordYN


Return:

TypeDescription
Void

This method does not return a value.


Example:

importTransform
var imp = new SimpleImport();
imp.importTransform(current);

  • No labels