Systemweaver allows you to create custom XML export definitions that are accessible for users at the click of a button. In this article, we will first show an example of such a configuration and then go through all the configuration options that can be set when creating this type of export.
A typical configuration example can look like the one below which translates to the presets shown in the GUI example.
<ExportToXMLConfigs> <ExportToXMLConfig id="Export_1" sid="RBFN"> <ViewSettings> <Caption>Function Export</Caption> <RibbonGroup>XML Exports</RibbonGroup> <Description>Exports a Function Specification w/ subcomponents</Description> </ViewSettings> <IncludedParts></IncludedParts> <IncludedAttributes></IncludedAttributes> <IncludeItemOwnerValue>True</IncludeItemOwnerValue> <IncludeItemOwnerEditable>False</IncludeItemOwnerEditable> <IncludePreviousVersionsValue>True</IncludePreviousVersionsValue> <IncludePreviousVersionsEditable>False</IncludePreviousVersionsEditable> <IncludeLaterVersionsValue>True</IncludeLaterVersionsValue> <IncludeLaterVersionsEditable>True</IncludeLaterVersionsEditable> <IncludePlainDescriptionsValue>True</IncludePlainDescriptionsValue> <IncludePlainDescriptionsEditable>True</IncludePlainDescriptionsEditable> <IncludeAttachmentsValue>False</IncludeAttachmentsValue> <IncludeAttachmentsEditable>True</IncludeAttachmentsEditable> <SwapForeignIdsValue>False</SwapForeignIdsValue> <SwapForeignIdsEditable>True</SwapForeignIdsEditable> <CheckStatusReleased>False</CheckStatusReleased> <ForeignIdNamespace>CarsInc</ForeignIdNamespace> </ExportToXMLConfig> </ExportToXMLConfigs>
Preset Settings in swExplorer
The above example configuration has some of the options selected (denoted by a checkmark or radio button selection in the GUI) while others are left blank. Furthermore, two of the selected options are not editable via the interface as indicated by the options being grayed-out.
The <ExportToXMLConfigs> tag is used to encapsulate one or more configurations of xml exports. These are added to the top and the bottom of the view configuration.
The <ExportToXMLConfig> tags, on the other hand, surround each configuration. You must create a unique _id for each configuration as well as decide on which item(s) (sid="XXXX") the export will be valid for. If you want it to be valid for all item types, for example, you would enter sid="I".
The <ViewSettings> includes settings that control the appearance of the option in the GUI:
- The <Caption> text is the name that will be used in the GUI when selecting the configuration via a drop-down menu or ribbon button.
- The option <RibbonGroup> text specifies the Item ribbons group where the button will be available.
- The <Description> text specifies a hint that will be presented in the ribbon, if the <RibbonGroup> is specified.
The optional <IncludedParts> lists the SIDs of part types to be included in the export. Part types not listed will be excluded from the export. If <IncludedParts> is not included in the configuration or if it includes an empty list, all parts will be included in the export.
The optional <IncludedAttributes> lists the SIDs of attribute types to be included in the exports. Separate multiple SID values with a semi-colon delimiter ";". Attributes that are not listed will be excluded from the export. If <IncludedAttributes> is not included in the configuration or if it includes an empty list, all attributes will be included in the export.
The following tags are of the type "Editable" and determine if users can edit the preset value of the named element using the GUI. You can choose to set the value to "True" or "False". A value of “False” will prohibit users from editing the information included or excluded in the export xml while a “True” value will allow the user to change the setting.
In the screenshot example above, the "Editable" tags for all but two options are set to “True”. The user is free to change selections if they want to. The two non-editable options (set to "False" in the configuration) appear grayed-out and cannot be modified.
The <IncludeItemOwnerValue> tag when set to “True” will include the owner element of each item in the xml export. When imported to a new database, the item owner will be the user who imports the file to the database, but the original owner value will be imported as an attribute.
The <IncludePreviousVersionsValue> and <IncludeLaterVersionsValue> tags when set to "True" will include all previous and later versions of an item depending on which is used. This is useful if one only wants to export versions up to or from a certain point.
The <IncludePlainDescriptionsValue> tag when set to "True" will export the description values as unformatted text. Note: This means that pictures, graphs, grids, text format such as colors and font will NOT be included.
The <IncludeAttachmentsValue> tag when set to "True" will include all attachments for the chosen items. These files will be placed in a separate ZIP file with an identical file name, but appended with “_attachments”. Observe that this file must not be modified or any corresponding import will fail.
<SwapForeignIdsValue> replaces the id attribute in the exported XML with the ForeignID* property of the items and parts if there is any. Effectively the ForeignID becomes the item ID in the export file.
The <ForeignIdNamespace> includes a "namespace" string that will be used as a prefix of exported ids.
If used together with the <SwapForeignIdsValues> option set to "True", all "native" items and parts (i.e., those that do not have a Foreign id value) will receive the entered prefix. Those items and parts that do have a Foreign id value will not receive the prefix. Read more about the ForeignID property in the Item and Part. This corresponds to the Export for synchronization between SystemWeaver databases option in the view.
If used together with the <SwapForeignIdsValues> option set to "False", all items and parts will receive the entered prefix in front of their item id. This corresponds to the Prefixed export option in the view.
The <CheckStatusReleased> tag when set to "True" checks if the items' status is either Released or CS Released and refuses the export if this is not the case. Helpful if one wants to make sure to export complete latest versions, but also forces the importing side to take out new versions if they want to modify the imported items.
The interface provides options for including all metadata, excluding all metadata or only including the referenced metadata. The default setting is to include metadata since this is the most likely scenario if one is not working with identical databases.
* A Foreign ID, used for cases where the item or part has been copied from some original source outside the SystemWeaver model.