The XML Export view in the swExplorer client is used to export SystemWeaver data into a SystemWeaver XML file. The typical purpose of the export is to import into another SystemWeaver target database, but the export can also be used for other integration purposes. The view is configurable and Architects will likely create custom export configurations for various use cases. This article describes the view in the swExplorer which can also be used for on-the-fly exports if enabled in the installation. After selecting an item in the structure tree, you define what objects and attributes in the structure below it that you want to include in your data export.
The view is accessed via the View drop-down and/or by selecting the option via a configured button on the Items ribbon:
Setting up and Exporting
For most use cases, Architects will create customized configurations. This section describes the export options available via the view. If a customized configuration is selected for the export, some of the options may not be editable per the definition in which case they will appear grayed-out.
- Select the top-item of the structure that you want to export. In the screenshot above, "Function requirements" is selected so the settings will apply to its item structure.
- Select the XML Export view that you wish to use for your export. This may be a system default XML Export configuration or a custom pre-defined export configuration.
- Enter an optional Export Description which will be included in the Info section of the XML file.
- Make your selections regarding what elements to include in the export. The options are described below.
This menu includes options for what to use as item and part ids in the export:
Plain export will use the item ids.
Export for synchronization between SystemWeaver databases will replace the id of each of the exported objects with their Foreign id value, if a Foreign id value exists.
In the Prefix box, you can enter an optional namespace string that will be used as a prefix for all "native" items, i.e., items that do not have a Foreign id. The items' IDs would consist of the namespace + their ID. The prefix can be used in the target database to clearly identify that the original of the imported object resides in an external database, and store the id as a Foreign id in the target database.
For the below example, if the above setting is applied, the IDs in the export for the first 4 items (which have Foreign Id values) will be the Foreign Id values. For "Requirement 3", which does not have a Foreign Id value, the ID will be its "native" item ID with the prefix "ABC:".
The below screenshot shows the IDs (Item id) in the export.
Note: The content and organization of the ZIP file must not be modified to ensure succeeding import of the attachments into a target database.
Prefixed export will use the item ids and a prefix which you enter in the Prefix box. The prefix is applied to the item ids of all exported items.
The following General options are available in the view. To select an option, check the box to the left of it:
Include item owner (username): Include the item owner's user name for all items.
Include previous versions: Include all previous versions of all items included in the export.
Include later versions: Include all later versions of all items included in the export. If used in conjunction with the Include previous versions option, the entire version history will be included for all exported items.
Include plain descriptions: Include additional unformatted version of the item descriptions. Note that the formatted version in the form of a Binary will always be included. Including the plain version is an option.
Include attachments: Include the atttachment files of the exported items. The files will be placed into a ZIP file in the same location as the XML file. The ZIP file will have the same file name name as the XML file with a suffix of "_attachments".
The Metadata options include alternative options for meta model inclusion in the export:
Include metadata: Include the database's entire meta model in the export. Select this if, for example, you plan to import the model into an empty database or plan to extend an existing database with the meta model included in the export. This option is typically used when the item structure is assumed to represent more or less all types of the source database and when all of these are wanted in the target database.
Excluded metadata: Exclude the meta model from the export. Note that the exported items will make references to the types. So, if this option is used, all types used by the exported model need to already exist in a target database, i.e., an import can be performed without extending or modifying the existing meta model of the target database.
Referenced metadata only: Include the subset of meta model types required to represent the exported items. This option is typically used when you plan to import into an empty database and only want the subset of the meta model. It can also be used to extend an existing meta model in a target database while minimizing the risk of introducing unwanted types.
Once you have made all of your selections, click the Export... button to save the XML file to a suitable location.
Viewing Errors and Warnings
When you select an item structure for export, the bottom pane of the view will display errors and/or warnings should there be any issues with the structure. There may be missing part or item types, abstract item types, deprecated item types missing attachments and/or invalid errors of various kinds. These issues should be analyzed and addressed prior to export.
Note: If using the Swap in foreign ids option, a "warning" will display if a part or item does not have a foreign id. This is not a warning that needs to be resolved. It is more informational as it may be useful to have a list of all objects in the export that do not have a foreign id.
Creating Custom Preset Configurations
For reoccurring exports where the settings should remain static, Architect users can save settings so that future exports can be set with one click of a button. Below is an example showing an export option called "Custom export" which, when clicked, will load the view with the pre-defined settings.
Configuration also supports additional options for the export. See Creating Customized Export to XML Definitions or Configure XML Export in the Help to learn more.