The following elements are included in the import of profiles:
When exporting profiles in Hyperon Studio, the user has the possibility to exclude context definitions from the result. See the export description for details.
The structure of the directory with profile content is described here. If a directory inside the @profile directory contains an unexpected element, that element is ignored during import. Examples of unexpected elements:
(Profiles, regions, and versions)
If Hyperon already contains an element that is imported, the import is skipped and the existing element is left unchanged. However, the import will proceeds with sub-elements of the skipped element. For example, if the database already contains a region that is imported, the region will not be replaced with a new one, but the import will proceed with versions of that region.
Identification of the element in Hyperon is based on its name and place in the structure of profiles, regions and versions:
Description of an element is not taken into account when establishing whether it already exists.
Import does not change description of existing profiles, regions or versions.
Existing context definition for a profile is replaced with an imported version. However, if the context file does not exist or is empty, the import of context is skipped and existing context for the profile is left unchanged.
The existing time schedule for a region is replaced with the imported version. However, if the file with schedule definition does not exist for a particular region, the schedule is not imported and the existing schedule is left unchanged.
New elements (profiles, regions, versions, context definitions and time schedules for regions) are added to the database. Import of new elements does not affect existing objects or the attachment of existing objects to profiles, regions or versions. For example, if there is a function attached to an existing version of the region, the import mechanism will not attach that function to new versions imported from the snapshot.
This behavior is different from the situation when new region versions are added manually in Hyperon Studio. For example, in Studio a function attached to an existing region version is automatically attached to any newly added version of that region.
Currently supported import statuses for individual elements (profiles, regions, versions, contexts or schedule elements):
In case of status different than OK, an import message provides additional information about the problem. If it is not sufficient, further details can be found in Hyperon's log.
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.
There are import status fields on various levels of the response body, called jobStatus, status or importStatus. These fields can have one of the following values:
Fields called message contain additional information about the import action. Depending on the place in the response body, a message can be omitted if the import status is OK.
The result of the import of profiles is included in the field jobResults.PROFILE. It contains the following fields:
The result for individual profile contains the following fields:
The result of importing context definition has the following fields:
The result of importing individual region has the following fields:
The result of importing a version of region contains the following fields:
Region versions are usually numbered with integer numbers "1", "2", ..., but version "numbers" can also be strings not representing numbers. For example "MY_VERSION" is a valid region version "number".
The result of importing the time schedule for a region is a list of results for each entry (line) of the schedule. Individual entry result has the following fields:
If the schedule is empty, the version field is not included.
In Hyperon Studio it is possible to create names of profiles, regions or region versions with characters outside the standard US_ASCII set, but that will likely cause problems with import of snapshot. This is associated with the limitations of encoding paths in ZIP files.
Mechanism of profile snapshot import assumes the paths in the ZIP file are UTF-8 encoded. However, in practice this encoding depends on the tool used to create the ZIP file, operating system and national settings. In particular, the standard "compressed folder" utility in Windows produces files with the different encoding of pathnames. The information about encoding of paths is not included in ZIP file. These paths cannot be read by snapshot importer, so such files or directories will not be processed and the import process will be interrupted.
Currently the descriptions of profiles, regions and versions are not imported from the snapshot. For regions imported from snapshot the description is set to a default value "Draft". Profiles and versions of regions imported from snapshot have empty descriptions.
It is not possible to import or export profiles, when two regions within one profile or two versions of the same profile have names that differ only by letter case. For example, the situation where there are regions called REGION1 and Region1 within one profile is not supported by the snapshot mechanism.
This limitation is associated with the limitation on ZIP filesystem - it is not possible to have in one directory two files or sub-directories with names differing only by letter case (in the example above, we would have to have two sub-directories: REGION1/ and Region1/ in the same folder).
This limitation is not a problem for profile names, since the profile names in Hyperon can only be in upper case.
Importing empty context (which is equivalent to deleting context) is not currently supported. If the context file is empty, the importer skips the import of context and the existing context is left unchanged.