1. General information
- Import and export of applications in NET Genium are used to transfer applications between different installations of the system, to deploy new versions of applications, and to create backup copies.
- The functions for importing a new application, updating an existing application, and exporting an application are available only to users with the highest permission level – the Administrator with database ID 1. This permission is required primarily due to the possibility of modifying the structure, permissions, and dependencies of an application.
- Import of a new application is available through the “Import application” icon in the navigation area, or on the main page in admin mode by selecting “Import application” in the “Create new application” wizard.
- Updating an existing application is performed in the “Modify application” dialog on the “Administration” tab, which contains a separate “Import application” section intended exclusively for update imports.
- Export of an application is available in the navigation area through the “Export application” icon, and allows generating a file with the “nga” extension. This file contains the complete definition of the application, and optionally also data or file attachments, depending on the selected options in the “Export application” dialog.
- Importing a new application and updating an application represent two distinct processes:
- Importing a new application creates an entirely new instance of the application.
- Updating an application replaces the existing application and modifies its structure and configuration according to the imported file.
Details
- In NET Genium Online the import of a new application from a file (“nga”, “xlsx”, “xlsm” or “xls”) is not available. Updating an existing application from an “nga” file in the application settings is available. Exporting an application is not restricted.
- Exporting applications and application groups can be disabled in the given installation even for the Administrator user by the “DenyExport.txt” file in the “Config” directory (its content does not matter). The restriction applies to the export in the NET Genium web interface. The “ApplicationManager.exe” program run on the server does not respect it.
- The “nga” file is encrypted with a fixed NET Genium key, which is not secret. An export containing data must therefore be handled as unprotected data.
2. Import a new application
- The options described in this chapter apply exclusively to the import of a completely new application.
- Importing a new application creates a separate instance of the application in NET Genium and does not perform any update of an existing application. The procedure for updating an existing application is described separately in the chapter Update an existing application.
- Importing a new application is available only to users with the highest permission level, specifically the Administrator with database ID 1.
- Importing a new application is available via the “Import application” icon in the navigation area, or on the main page in admin mode by selecting “Import application” in the “Create new application” wizard.
- The “Import application” icon in the navigation area of an application group imports the application into this application group.
- The “Create new application” wizard creates a new application group for the imported application with the same name, icons and rights as the imported application, and places it in the second-to-last position of the application group bar.
Details
- If an “ngg” file is imported with the wizard, the new application group gets the name and icons of the first application group from the file and the rights of its first application.
- The “Import application” dialog allows import from a file with the “nga”, “xlsx”, “xlsm”, or “xls” extension.
Details
- The dialog also accepts an “ngg” file and imports all applications from it into one application group – when importing with the icon in the navigation area into the current application group, with the wizard into a newly created one.
2.1. “From file” tab
2.1.1. Options
- I am the owner of the imported data
- Checking this box determines whether the import overwrites the owner of all database records in all imported database tables. The owner of records in the change history tables does not change.
- If the box is unchecked, the records keep the owner IDs from the source NET Genium – in the target NET Genium they may belong to a different user, or may not exist.
- A detailed description of ownership and co-ownership of records is provided in the separate guide Edit form.
- Import history of records
- Checking this box determines whether the record history of all imported database tables should be imported.
- The prerequisite for this function is that the file with the exported application contains the history records. An export with data always contains the record history.
- Import rights
- Checked – The rights of the application and all its child objects are transferred to the user groups of the target NET Genium by group ID and to users by login name. The group IDs thus stay the same as the IDs in the scripts, query conditions and JavaScript of the imported application. A group whose ID does not exist in the target NET Genium is created with the same ID as a new user group without members. A user who does not exist in the target NET Genium does not receive their rights.
- If a group with the same ID has a different name in the target NET Genium or if the users differ from the source NET Genium, a list of the differences is displayed before the import with a question whether NET Genium should resolve them automatically. If the answer is “No”, the import is not performed. After the import, it is advisable to assign users to the newly created groups – until then, their rights do not apply to anyone.
Details
- A group with the same ID and name, a group created with the same ID and a user with the same ID and login name are not shown in the list of differences. Group names and login names are compared regardless of letter case.
- A group with the same ID and a different name receives the rights once the question is confirmed, but its name in the target NET Genium does not change.
- If a group with the same name exists under a different ID in the target NET Genium, a new group with the source ID is created anyway and the list of differences points this out. Members have to be assigned to the new group manually.
- A newly created group does not take over its placement under another user group from the source NET Genium.
- The system user groups “Administrators” and “Users”, the Administrator user and the anonymous user are matched by ID without comparing the name. The “External Users” group is matched with the group with the same ID and the same name, otherwise with the group with the same name under a different ID – the list of differences points this out. If a system group is missing in the target NET Genium (for example the “External Users” group in NET Genium Online), the rights of this group are not imported.
- An object that is left with no rights after the matching is accessible only to administrators.
- A file exported by an older version of NET Genium does not contain group names or user login names. The rights from it are imported with the IDs from the source NET Genium without any check and without a question, so the same ID may denote a different group or user in the target NET Genium, or may not exist there.
- User and user group IDs written outside the rights settings – in JavaScript, in query conditions, in scripts or in parameters of server functions – are not converted. Group IDs do not change during the import, except for the “External Users” group that the import matched by name with a group under a different ID. The ID of this group and the ID of a user whom the import found by login name under a different ID have to be adjusted manually in these places.
- The “ApplicationManager.exe” program resolves the differences automatically without a question.
- Unchecked – The imported application and all its child objects that had at least one right set in the source application will have the rights to the user group “Users” set. Objects without rights remain without rights, i.e. accessible only to administrators.
- The same applies to co-owners of edit form records: if an edit form in the source application had at least one co-owner set, after an import with the box unchecked all users of the “Users” group become co-owners and can thus modify the records of other users. It is therefore advisable to check the co-owners of the edit forms after the import.
- Keep bindings to other applications
- Checked – References to objects of other applications (edit forms, controls, view pages, queries) are taken over with the IDs from the source NET Genium without any check. The import is stopped with an error message about data consistency violation only where the reference is guarded by a database foreign key. Elsewhere, a reference to a non-existent object remains invalid, and if another object with the same ID exists in the target NET Genium, the reference will point to it.
- Unchecked – Links to other applications and their children will not be linked. Queries over edit forms of other applications will not be created, and the view tables over them are not created either. Other controls that used such a query (for example a foreign key or a drop-down list) are created without the query. If there are links to other applications, it is necessary to go through and adjust these links.
Details
- On a view page, apart from view tables, the calendar, Planner, history, chart and tree over a query of another application are not created either.
- Queries over the system edit forms of users and user groups are created even without checking the option. References to the controls of these forms other than the basic system ones are, however, not preserved in them.
- The joins with the edit forms of other applications and the joins, conditions and columns with the controls whose reference is not preserved (the same applies to the conditions and joins of “AutoSum” controls) are removed from the queries of the imported application over its own edit forms and over the forms of users and user groups. The displayed column and sorting by these controls change to ID, and secondary sorting, the selection of unique records and the “Color by” and “Time span by” settings with these controls are cancelled. Such a query returns different records than in the source NET Genium, so it must be checked after the import.
- An “is in the query” or “is not in the query” condition in a query or in an “AutoSum” control whose nested query is over an edit form of another application remains, but the nested query is not created. A query or an “AutoSum” control with such a condition ends with an error until the condition is corrected or removed.
- In the controls of the imported application, the “Color by” and “Category by column” settings with the controls whose reference is not preserved are cancelled.
- The records of the imported tables keep the IDs from the source NET Genium, so foreign keys between the tables of the imported application remain valid. IDs stored in the values of controls are not converted with either option, with the exception of attachments – a foreign key to a table of another application and IDs of users or user groups keep containing the IDs from the source NET Genium.
- The parent form of nested records from the file is converted to the new ID if it is part of the file. If the parent form is a form of another application, its ID from the source NET Genium remains when the option is checked, and without it the parent form is reset to zero – the records then stop being nested, but they keep the ID of the parent record. The system edit forms of users and user groups always keep their ID as the parent form.
2.1.2. Select file
- “Browse...” button to upload the file of the imported application with the extension “nga”, “xlsx”, “xlsm” or “xls”.
- The “nga” file format is the standard export and import format for NET Genium applications, which contains the complete definition of the application, including its structure, controls, bindings and possibly data or file attachments.
- The “xlsx”, “xlsm” and “xls” formats are used to automatically create a new application based on data from Microsoft Excel.
- For each sheet of the workbook that has at least one row below the selected header row and a filled first header cell, a separate edit form with a title, a view page with the “Records” view table and the “New record” button for creating a new record are created. The edit form and the view page are named after the sheet, the new application after the file name without the extension.
- The row with the column headers is selected for each sheet separately (rows 1 to 10). Columns are read from the left up to the first empty header cell.
- For each column, a Textbox control with the data type String is automatically created.
- The application, the edit forms, the view pages and the controls get the rights of the “Users” user group, and all members of this group are co-owners of the records of the new edit forms, also when importing into an existing application group. When importing into a new application group, the new application group gets these rights as well.
- All rows below the header up to the last row of the sheet are automatically imported into the created database table during import, including empty rows, from which empty records are created. Column names and values longer than 50 characters are truncated. The owner of the imported records is the user who performed the import.
Details
- An import from an “nga” file creates new edit forms with the identifiers from the source application. If a table with the same identifier already exists in the target NET Genium, the new table gets a numeric suffix (for example “ng_table0”). The new identifier is automatically reflected only in print templates in the Excel format. Query conditions written directly in SQL, table identifiers written in the parameters of server functions in scripts (for example EMAILLINK or SCHEDULEFORM), other print templates, JavaScript and external functions must be adjusted manually. Until then, they refer to the table with the original identifier.
- In an import from an “nga” file, the structure of the application is created in a single transaction and the data is imported only after it is committed. If writing a record fails, the import continues with the next records and finally displays a list of the records that could not be imported, and the application remains created without them. The same applies to the update of an existing application.
- An import from an “xlsx”, “xlsm” or “xls” file does not run in a transaction and is ended by the first error: the application, and possibly also the new application group, remains created with the edit forms and view pages from the sheets processed up to that point and with their records, and an error message is displayed.
- If the date format of the source and the target NET Genium differs, text values in the form of a date are converted from the format of the source NET Genium to the format of the target one. Values that the update of an existing application restores from the backup are not converted.
- The export writes date and time values with the time zone offset of the server's operating system, and the import converts them to the time zone of the server it runs on. Between servers with a different operating system time zone, they are therefore shifted by the difference between the time zones (a date without time even by a day) and must be checked after the import.
- When importing into a Firebird database, values of controls longer than 8191 characters (for Firebird older than version 3, longer than 250 characters) are truncated without a warning. The exceptions are the “TextArea”, “RichTextBox” and “MultiListBox” controls. The same applies to the data that the update of an existing application restores from the backup.
- If the data of a control with a text value of limited length contain values longer than its maximum length allows, the import increases the maximum length of the control according to the longest value in the data, and when the record history is imported, also in the history. This also applies to the data restored from the backup during the update of an existing application.
- The import turns off the “Read/write data from the database table using a memory optimized table” and “Read data from the database table using a view” options of edit forms and warns about them – it creates neither the In-Memory table nor the database view. After the import, they must be created with the command from the drop-down list below the check box in the edit form dialog, the data must be transferred to the In-Memory table with the command “IMPORT DATA TO ng_table_memory FROM ng_table”, and the option must be checked again. The same applies to the update of an existing application. The original In-Memory table, however, remains in the database with the old structure and data, so it must be deleted with the command “DROP ng_table_memory” before the new one is created.
- The import switches the “CONTAINS (MSSQL Full-Text)” search option of controls to “LIKE (contains)” and does not create the full-text index. The same applies to the update of an existing application. The update removes the full-text index of the application's tables and switches the search to “LIKE (contains)” before deleting the original application, so if the update ends with an error, the original application also remains switched this way. Full-text search is restored by switching the option back to “CONTAINS (MSSQL Full-Text)” and saving the control. Depending on the type of the control, the full-text index is either created at that point (for example for a “TextArea” control) or must already exist in the MSSQL database (for a “TextBox” control).
3. Update an existing application
- This chapter describes exclusively the process of updating an already existing application. Importing a new application, which creates an entirely new instance of the application in NET Genium, is described separately in the chapter Import a new application.
- Updating an existing application is available only to users with the highest permission level, specifically the Administrator with database ID 1.
- The update of an existing application is performed in the “Modify application” dialog on the “Administration” tab, where the “Import application” section is available.
- Updating is carried out by importing a file with the “nga” extension, which replaces the structure and configuration of the application according to the contents of the imported file. The file must contain exactly one application, but NET Genium does not check whether it is the same application.
- The update first deletes the existing application and then recreates it from the file. This implies:
- The application and all its categories, edit forms, controls, view pages and queries get new IDs. Saved links containing the ID of an application, a category, a form or a view page, IDs written in external functions and IDs in JavaScript, HTML controls and scripts that the import does not convert therefore stop working.
Details
- The import converts to the new IDs the references to buttons and view tables written in JavaScript in the form “(BT” or “(DG” followed by the ID and in an HTML control of an edit form in the form “, BT” followed by the ID. In an HTML control of a view page and in the JavaScript of the “ActionButtons” control buttons (“Save”, “Delete”, “Back”), the IDs are not converted. In comment lines of scripts, it converts the IDs in the parameters of the EMAILLINK, OBSOAS, LOADDATAGRIDSETTINGS, SAVEDATAGRIDSETTINGS, RESETDATAGRIDSETTINGS, PROTECTFORM, PROTECTSCRIPT, SCHEDULEFORM, SCHEDULESCRIPT, SCHEDULEVIEWPAGE and UPDATEAUTOSUM functions. In other script steps, in exceptions and in the texts of e-mails, the IDs of these functions are not converted. Other IDs in JavaScript, HTML controls, scripts and query conditions written in SQL must be adjusted manually.
- The objects of the application also get new IDs during the import of a new application, so the same applies to it as well.
- References from other applications to the updated application (queries over its edit forms, references in scripts and e-mails) are removed during the deletion and are not restored by the import. Some controls displaying the data of these queries, for example view tables and trees, are deleted. The other controls remain without a query or with a reference to the deleted query. The joins with the edit forms of the updated application and the conditions and columns with its controls are removed from the queries of other applications over their own edit forms. The displayed column and sorting by its controls change to ID, and any secondary sorting and the selection of unique records are cancelled. Such a query remains and returns different records than before the update, so it must be checked after the update. Nested records of other applications whose parent form is a form of the updated application keep its original ID.
- The user settings of all users – favorite items, portlets, view table settings and filters – and the synchronization settings of the edit forms of the application are deleted as well.
- The deletion of the application and its recreation do not take place in a single transaction. The deletion is carried out either completely or not at all – if it fails, the application remains unchanged. If only the recreation ends with an error, the original application no longer exists. It is therefore advisable to export the application including data before the update.
Details
- Of the view page controls, the view tables, history, calendars, TimeTable, Planner, charts and trees over these queries are deleted. Other view page controls, for example Kanban, remain and refer to the deleted query. Of the edit form controls, only view tables and trees are deleted. The others, including calendars and charts, remain.
- Together with secondary sorting and the selection of unique records, the “Color by” and “Time span by” settings with the controls of the updated application are also cancelled in the queries of other applications. In the controls of other applications, the “Color by” and “Category by column” settings with the controls of the updated application are cancelled.
- An “is in the query” or “is not in the query” condition in the queries and “AutoSum” controls of other applications whose nested query is over an edit form of the updated application remains without the nested query, which is deleted together with the application. Such a query or “AutoSum” control ends with an error until the condition is corrected or removed.
- View pages of the “Open an edit form” type and buttons of other applications that open an edit form of the updated application lose their target form. Buttons and view pages of other applications that go or return to a view page of the updated application keep its original ID. After the update, the target form and the view page must therefore be set again.
- If the database contains tables or, for a Firebird database, generators with the identifier of an edit form from the “nga” file or of its history to which no edit form belongs in NET Genium (for example after an unfinished update in an older version of NET Genium), the update does not start and lists them. They must first be removed or renamed.
- A Firebird database refuses to drop a table that another connection is currently working with. The update then ends with an error and the application remains unchanged.
- If the update ends with an error, the dialog displays the “Close database connections for all other users” field together with the error message. If it is checked when the update is repeated, NET Genium terminates all other connections to a Firebird database before the update, including the connections of services and other applications working with the same database. On MS SQL Server, the field has no effect. If the update ends with an error only after the original application has been deleted, the dialog does not display the field and only refreshes the list of applications – the update can no longer be repeated.
- The data of existing tables is preserved through a backup that NET Genium saves to the “Backup” directory when deleting the application (the “ng_table.xml” and “ng_table_history.xml” files). Tables are paired by identifier, columns within a table also by identifier. New columns remain empty, the data of columns missing in the new version is lost. A backup older than 1 hour is not used. New tables get data from the “nga” file.
- Print templates bound to buttons are saved to the “Templates” directory as new copies with each update and the buttons are switched to them, so modifications of the templates made in the target NET Genium are no longer used.
Details
- A print template with an extension that the web server would execute or read as configuration (for example “aspx” or “config”) is not taken over to the “Templates” directory by the import, and the button remains without a print template. The same applies to the import of a new application.
- Images inserted into “RichText” controls are saved as new attachments with each update, and the original images remain stored as unused attachments. The “SqlBackup.exe” program with the “/unusedfiles” parameter lists unused attachments in the “UnusedFiles.log” file with a proposal for review, and they are deleted only by the “SqlBackup.exe /run UnusedFiles.log” command.
- The backup files “ng_table.xml” and “ng_table_history.xml” remain in the “Backup” directory until they are overwritten by the next backup of a table with the same identifier (for example during the next update). The data of columns and tables missing in the new version and the records that could not be restored can be found in them. The files contain the data unencrypted, so it is advisable to delete them after the check.
- The table data is backed up at the start of the update, before the application is deleted. Changes to records that users save between the backup of a table and its deletion do not get into the restored data. It is therefore advisable to perform the update at a time when nobody is working with the application.
3.1. “Modify application” dialog, “Administration” tab
3.1.1. Import application
3.1.1.1. Options
- Update and preserve existing data
- Checking this box displays the “Browse...” button, which is used to update the application while preserving existing data in all database tables of the application. No other way of updating is available.
- Preservation of existing data is based on a comparison of the identifiers of tables and columns – see the chapter Update an existing application.
- The record history is always restored during the update and the owners of records do not change.
Details
- The updated application is created in the application group selected in the “Location” field on the same tab, even if the change of the field has not been saved. Other unsaved changes in the dialog are not used – the name, icons and help of the application are taken over from the file.
- Import rights
- Checked – The rights are transferred to the user groups of the target NET Genium by ID and to users by login name, in the same way as for the import of a new application, including the question about resolving the differences automatically. If the answer is “No”, the update is not performed and the existing application remains unchanged. A detailed description is provided in the chapter Import a new application.
- Unchecked – The behavior is the same as for the import of a new application, see the chapter Import a new application. The rights set in the target NET Genium are not preserved in either case.
- Keep bindings to other applications
- The behavior is the same as for the import of a new application, see the chapter Import a new application.
3.1.1.2. Select file
- “Browse...” button to upload the imported application file with the “nga” extension.
- Displayed after checking the “Update and preserve existing data” option.
4. Export the application
- Exporting an application is available through the “Export application” icon and is intended exclusively for users with the highest permission level – the Administrator with database ID 1.
- After clicking the “Export application” icon, an export file with the “nga” extension is generated. This file contains the complete definition of the application. The export includes the structure of the application, controls, relations, and, depending on the selected options, also data or file attachments.
- Exporting an application serves to transfer it to another NET Genium environment or to create a backup copy. The process is performed as a single step without requiring further user actions. After selecting the export options, the system generates the file and offers it for download.
Details
- An export of the “Settings” application does not contain the data of users, layout, holidays, usage statistics, invalid logins or the synchronization queue (the “susers”, “slayout”, “sholiday”, “sstatistics*”, “sinvalidlogins” and “ssynchro” tables). A file with the “Settings” application can neither be imported as a new application nor used to update another application.
4.1. Options
- Including data
- Checking this box determines whether the database records of all exported database tables, including the record history, should be included in the resulting export.
- Including attachments (files/images)
- Checking this box determines whether file attachments of all exported database tables should be included in the resulting export. Attachments are exported only together with data. An export of data without attachments leaves the columns of the “File” and “Image” type empty.
Details
- An export of data without attachments does not transfer the images inserted into the values of “RichTextBox” controls, and the imported values keep referring to them by the attachment IDs of the source NET Genium – in the target NET Genium they are not displayed, or the reference leads to a different attachment with the same ID.
Images inserted into “RichText” controls are always part of the export. Of the print templates, only those bound to a button are exported. Of users and user groups, the export contains only the login names of users and the names of groups to which the application assigns rights – the import matches the rights by them. The user accounts, groups and their memberships themselves are not transferred. The export does not contain synchronization settings, user settings (favorite items, portlets, view table settings) or external functions.
4.2. “Export” and “Close” buttons
- “Export” button – Starts the application export and creates an export file with the “nga” extension, which contains the selected application including all settings and optionally also data or attachments, if these options are selected.
- “Close” button – Closes the application export dialog without performing the export.