1. Class import

    Article: AN0002204Updated: 04.10.2018

    There are detailed settings of an import into a class displayed on this page.

    Examples of data imports can be found here.

    Toolbar

    Icon Description
    Return to the list of imports.
    Creation of a new import.
    Saving changes in the import.
    Deletion of the import.
    Starting import (without saving and taking into account possible changes in the import).
    Displaying history of import the use.

    TAB - Basic properties

    Section: Basic properties

    • Code - Import identifier, which is used by export and import of model metadata between various application instances.
    • Name - Import name.
    • Note - Note to the import.
    • Enabled - Defines whether the import can be used.
    • Integration import - Information if the export start is conditioned by enabling integration interfaces on page Information about application.

    Section: Start

    • Enable import start via page ImportStart - Information if the import can be started by calling page ImportStart.

    Section: Data source

    • Type of the data source - Defines the type of import location.
    • Path to the data source - Path to the data source. It will not be displayed if Type of the data source is set to: File will be entered by user on the page.
    • Format of data - Selection between csv or xml file.
    • Coding - Selection of the file coding.
    • Saving the import file into the database - Determines if the import file should be saved as part of the import log.
    • Containes data header - Defines wheather the import file contains a data header in the first row. It is displayed only for Format of data: Csv.
    • CSV separator - Defines column separator in the file. It is displayed only for Format of data: Csv.
    • Number of columns in the CSV file - Defines number of columns in the file. It is displayed only for Format of data: Csv.
    • XML path to item - Defines path to the xml item. It is displayed only for Format of data: Xml.

    Section: Import target

    • Target - Defines if the import target is a class defined by the user or the internal user class. If we choose Target: Into a class, selection of model and class appears.
    • Model - Model selection, in which the class we want to import in is located.
    • Class - Selection of the class into which we want to import.
    • Restriction of records in the import class - Definition of the range of records in the import class that are taken into account when updating or deleting records in the class. Only records complying with the filter are updated or deleted.

    Grid with columns of the imported class including inherited columns

    • Import column - Defines which column of the imported file corresponds with which column in the class. If the import file has headers, indicate header name. If the import file does not have headers, indicated order of the column in the import file.
    • Target column - Name of the column of the import class. If the column is inherited the name of the column is preceded by the name of the class from which it is inherited.
    • P - Informes if the class column is obligatory.
    • I - Defines if data should be imported into this class.
    • M - Defines if this column shall be included for mapping class records and records in the import file.
    • Default value - Enables to perform following operations:
      • Textbox - Enables to enter a value which shall be imported to the given column.
      • Set up of columns of non-imported records:
        • Checkbox Clear the value - It makes clearing the value in the column, if the record is not contained in the import file.
        • Textbox - The value from this textbox will be stored in the column in the records that were not in the import file.
    • Import parameters - Enables to perform following operations based on data type of the column into which it is imported.
      • Column of the text type - Possibility to convert characters to lower or upper case and space trimming.
      • Column for mapping (Column of the reference type) - If the import column is of type reference value and it refers into another class, in which it is possible to look up simply the reference record according to one column in the import file, choose this column in the combobox. If it is necessary to look up the reference value according to more columns in the import file or it is necessary to look up in more classes, do not use this column and check the box map the imported value.
      • Column of the Date and time type - If the imported column is of Date and time type, choose one of predefined formats for Date and time values in the import column.
      • Column of True/false type (Values for True and False) - If the import column is of type True/false, indicate values that shall be interpreted as True, values that shall be interpreted as False and state, how other values out of this list shall be interpreted.
      • Column of the Colour type (Format) - If the import column is of Colour data type, select the colour format in the input file.
    • Map the import value - Check this option if you want within the import add a value into the column but this value cannot be easily determined from a value in one column of the import file. This option enables to map values from more columns of the import file to another class or query and in this way determine requested values to be added to the file.
      • Class / Query - Select a class or a query, in which you want to look up values in the import file.
      • Return value - Select a column from which a value shall be returned and used for mapping in the below stated grid. There are columns in the combobox of the same data type as the column by which it was chosen Map the import value. There is name of the class stated before the name of the column to identify columns inherited from the parent classes. At last select in the control "Column for mapping" column, to which the return value shall be mapped - in most cases it will be internal identifier of the class record: Id.
      • Grid with columns from the class or query
        • Import column - If the import column has headers, indicate to column names according to which you want to map the values from the import file the name of the import column. If the import column does not have headers state to appropriate columns of the class or query the order of the mapped import file column.
        • Mapped column - Name of the column to which value from the file will be mapped.

    Section: Type of update

    • Creation of new records - Defines wheather new records shall be created in the import class according to the records in the import file.
    • Update records - Defines wheather current records in the import class shall be updated according to the values in the import file.
    • Delete all the records before import - Defines wheather all the records in the import class shall be deleted before import.
    • Delete records that were not affected by the import - Defines, wheather records that were not found in the file, should be deleted in the import class.
    • Delete records that are in the import file - Defines, wheather records that were found in the file, should be deleted in the import class.
    • Import unique records - Defines, wheather only unique combinations of values should be imported from the import file. This set up selects unique combinations of values from columns marked for mapping. The first found value will be selected by columns that are marked for import but not for mapping. Only records, where combination of columns for mapping does not exists in the class yet, will be appended to the class. By this way necessary reference class extension will be carried out without creation of duplicates.
    • Import also deleted records - It defines, wheather also system columns 'Deleted on' and 'Deleted by' should be offered in the import detail for import. By means of them we can import into the application records, that are already marked as deleted, mark existing records as deleted or on the contrary activate logically deleted records by importing null values into columns 'Deleted on' and 'Deleted by'. This option can be used only if the class has set logical deletion of records.

    Section: Audit records

    • Created by - User that created the record (import)
    • Created on - Date and time of the record (import) creation
    • Last changed by - User that made the last modification of any data in the record (import)
    • Last changed on - Date and time of the last change of the record (export)

    TAB - Roles and display

    Section: List of roles

    • Role - Definition of the access right type to the given import for roles working with model. Access rights can be assigned only to roles enabled for the model, to which the import belongs to. Roles cannot be assigned to the import to the user class. This import can be performed only by Administrator.
    • Operations - Definition of possible activities for the selected role:
      • Display log - user is authorized to display log of import
      • Start import - user is authorized to start the import

    TAB - Notifications

    Section: Notifications

    • When to send - Defines when the notification should be sent.
    • Notification - Definition which notification shall be sent.
    • Distribution list - Definition to which distribution list the notification shall be sent.
    • Enabled - Defines wheather the notification shall be sent.

    TAB - Scripts

    Section: Workflow

    • Start workflow after import end - Defines workflow that will be started after the import end.

    Section: Scripts

    • Start before import start - Script, that shall be executed before start of the import.
    • Start after data upload into the database - Script, that shall be executed before checks and mapping in the temporary table temp_import_X, where X is a unique Id for each import launch.
    • Start before data update in the class - Script, that shall be executed before updating data in the class.
    • Start after import end - Script, that shall be executed after end of import.

    Overall description of the import course

    • 1. Start of script "Start before import start". In this step you can perform checks if the import is possible or call an external application to generate import data.
    • 2. Import file is read and saved in the database into the table "tmp_import_X", where X is a unique number of the import start.
    • 3. Start of script "Start after data upload into the database". In this step you can perform corrections of the "raw" input data in a temporary import table.
    • 4. Checks and mapping of data in "tmp_import_X" to data in ObjectGears are performed.
    • 5. Start of script "Start before data update in the class". In this step you can perform corrections of data prepared for import into the class after mapping.
    • 6. Insert-Update-Delete is performed in a table of a particular class.
    • 7. End of import.
    • 8. Start of script "Start after import end". In this step you can perform further processing and calculations, if they are needed after the import.
    • 9. Deletion of the temporary table "tmp_import_X".
    • 10. Sending notifications.
    • 11. Start of workflow "Start workflow after import end".
×