SystemWeaver offers a Word Import extension view for the swExplorer client which enables a user to import the content of a Microsoft Word document to SystemWeaver. The import can result in either Document Sections corresponding to the headings in the Word document, or a flat list of another type, such as requirements. This article describes how to use our WordImport extension.
- Required Meta Model
- Selecting the Word Document to Import
- Modifying the Default Import Settings
- Starting the Import
- Things to Consider
- Familiar with the SystemWeaver meta model building blocks (e.g., Items, Parts and Attributes)
- Familiar with the SystemWeaver Explorer Interface and common operations
- An installation of the SystemWeaver Explorer client (swExplorer)
- You must have "Write" access rights to the library being imported to.
- You have reviewed Considerations When Importing a Word Document
- The SWExtension.WordImport extension file located in the Client's swExplorerExtensions directory
- The SWExtension.WordImport extension view has been activated by a SW Architect user.
- The required meta model described below has been added to the database by a SW Architect user.
- A Microsoft Word file to import
Required Meta Model
Our WordImport extension requires the following:
- Our Documents meta model
- An attribute of Type XML with SID=DCFG, as shown below in the swArchitect client
To access the view, select your Document item and load the WordImport view by selecting it in the View drop-down menu.
Selecting the Word Document to Import
Before getting started, it is recommended that you close your Word document, and not open it during import.
Click Select word document, navigate to the file to be imported, select it, and click Open.
A Loading word document progress bar will display.
When it is finished loading, you will see a confirmation message in the view.
Default Import Settings
The extension will translate the document content into Sections following our Document meta model, and set which styles are to be included as Sections and which styles as Description content, as described in Considerations When Importing a Word Document. The result of this process will appear in the WordImport view when the document has finished loading.
Given the above example Word document, three styles were found: Heading 1, Heading 2, and Normal.
- The first two styles have automatically been set to Create as sections, and will be added as separate Sections in the Document.
- The Normal style has automatically been set to Included in Heading as Description, and will be imported as Description content.
Note: If at any time prior to import, you open the Word document and make changes, you will need to reselect the file as described above to obtain those changes in the view.
Modifying the Default Import Settings
DocumentConfig XML Attribute
When a document is loaded, the import settings are saved to a DocumentConfig XML-type attribute (DCFG) on the selected Document container item.
Example DCFG Attribute value
<?xml version="1.0" encoding="utf-16"?><XmlWordForm xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Sections><Style><Name>Heading 1</Name></Style></Sections><Sections><Style><Name>Heading 2</Name></Style></Sections><Descriptions><Name>Normal</Name></Descriptions><UseDocumentHierarchy>true</UseDocumentHierarchy></XmlWordForm>
It is possible to manually remove style values from the XML attribute value, being careful not to remove any required tags. However, we recommend instead that you drag and drop styles to other options directly in the view, if needed.
Drag and Drop
If you would like to make changes to the default import settings for the selected document, you can drag and drop styles to other options.
Including Heading Styles in Description Content
In the above example, the Heading 2 style is moved from Create as sections to Included in Heading as Description so that it is imported to the Description along with Normal styled content.
Creating as Custom (Other) Item
If you prefer that a particular style in your Word document be imported as an Item Type other than a Document Section, you can use the Create as custom item option. This is useful if, for example, you are importing a list of requirements.
- Drag and drop the style to the option's box.
- Click Select custom type.
- Select the item type to be used, and click OK. The selection will display in the Custom type field.
- When the above import is performed, all Heading 3 styles will be imported as Design requirements into the designated import Library:
- You can then copy these new Design requirements and include them in your model.
Excluding Word Document Content from Import
For styles that you do not wish to import into SystemWeaver, use the Excluded headers option. Drag and drop the unwanted styles to the option's box.
Use Hierarchy in Document
By default, the importer will maintain the same hierarchy found in the Word document.
If you do not want to maintain the hierarchy, uncheck Use hierarchy in document. An import of the same example document above, would then result in:
Starting the Import
When you are satisfied with your import settings, click Start import to perform the import. When the import is completed, and if the import is of Document Sections, you can view them directly in the selected Document structure.
If the import is of custom types, i.e., not Document Sections, you can view the newly created items via a search, or by selecting the library as described above in Creating as Custom (Other) Item.
Things to Consider
- If you import an existing structure, you will get a new version.
- As mentioned in Considerations When Importing a Word Document, it is best to use a Library designated for the import. In this way, you can use the Open item > Select Library option, and easily delete all imported items if you need to start over and redo an import. You may also want to clear out earlier import information added to the container item's Description: