Algorithm for domain import
Algorithm for import of domain is composed of two major phases:
- First phase is responsible for analyzing the structure of the zip file and build proper XML structure based on it. Exceptions might happen during this phase. If structure or files are not properly constructed, then the import will stop and results will be shown as detailed messages via GUI. (Fail fast on first error approach)
- The second phase is responsible for analyzing the built XML structure from the first phase and verifying it against definition XML. During this phase, the structure is also validated with Hyperon's domain validation rules. If there are validation errors, then import is stopped (only for one profile!) with adequate messages for domain elements, references or domain types.
Order of processing
The import of domain supports multiple profile processing. In @domains there must be at least one directory with proper profile code, the order doesn't matter.
Supported files and proper structure of zip snapshot for domain
will find here: Domain File system structure
Individual import status
The table below summarizes the statuses of importing a function:
Importing domain with HTTP request
To see how to execute import, please go to REST import endpoint
The response body of the request contains the results of the import in JSON format.
Correct import JSON result
Validation error during import (invalid import JSON result)
There is possibility to autocommit import, if flag was set to true (by default autocommit is turned off) and there were no validation errors. During session publising errors might occure, then import will still take place, but elements will stay in session. Any problems must be resolved by hand.
Response of import/publish - autocommit is 'true':
Results of the importing domain are included in field jobResults.DOMAIN and have the following entries:
jobStatus - overall status of the tag's import job. Possible values are:
- OK - if each individual tag import was either completed correctly without warning or skipped for reason other than error.
- WARNING - if there was at least one individual tag import which was completed with warnings,
- ERROR - if there were some import errors.
message - optional text message
totalElementsCount - (imported domain elements + imported domain types)
invalidElementsCount - number of elements with an import error
importResults - grouped import results for domain
- message - general message info
- status - probably same like jobStatus
- domainImportStatus - if there were some errors, then this field is 'null'. Correct import will result with a lot of information (checkout correct result JSON)
- valid - extra flag, if the import was valid or not
- validationMessages - holds extra validation details for possible import elements, types, attributes or references
unpublishedChanges - grouped messages for publication. It will not appear if the publication was successful, but if there were any publication errors, they will appear in this section
- path - code or path of an element
- message - detailed information, why elements were not published. Probably due to some conflict with other user's session.
Known limitations - importing domain from snapshot
There are some limitations regarding import snapshot domain:
- File reference.txt holds the path to domain element, and its code must be the same as the directory name that holds reference.txt.
- Currently, in the first phase of analyzing tree directory of zip snapshot, there might be some exceptions thrown while processing. These exceptions are only in English right now and they block import.
- Import support "SKIP" phase only for no domain definition (when the Snapshot was exported without domain definition).
- The domain can be only imported when there are no domain elements in the OPEN session on an environment. This is because import will override domain definition. There is no advanced mechanism for this.