Loading Input/Output Structure
An Input/Output Structure can be loaded in one of the following ways:
- Click the Add Structure button from the tool bar in the Input/Output Structure Panel and choose the structure type from the drop down list.
- Right-click on the Input/Output Structure Panel and select Add Structure and choose the structure type from the sub-menu.
The drop-down list or the sub-menu has the following options:
- XSD For loading an XSD document
- DTD For loading a DTD document
- XML For loading an XML document
- FIX For loading a FIX message
Load Input/Output Structure From an XSD document
Select XSD from the Add Structure menu. The Load Input/Output XSD Structure Wizard appears. The wizard contains two pages, Structure Selection page and External XSDs page.
Figure 1: Structure Selection Page
Structure Selection Page
The name of the structure can be specified in the Structure Name text field at the top of the page.
The XSD content can be defined in the text area provided in this page.
The schema can also be loaded from an existing file using the Load from File button. Clicking this button will open a file dialog through which you can browse through the file system to choose an existing file. Modifications, if any, to the schema are loaded from the file from this page.
External XSDs Page
Figure 2: Adding External XSDs
Any external XSDs used by a structure can be added from this page. External XSDs can be added by performing the following steps:
Click the New button to add a new external schema. A context menu will appear. The user can either add a New XSD or use an Existing Schema that is already present in the eMapper Project.
Adding a new XSD
- Click New XSD. This will enable the Schema Content Area where the content of the schema can be entered.
- A valid file name should be provided in the Schema File field. The provided XSD will be saved with the name specified in the PROJECT_HOME/resources/schemas directory.
- The content can also be loaded from a file using the Browse button. Click this button and browse through the file system and select the required file.
- After providing the XSD, it can be saved as an external XSD for the structure by clicking the Save button. As specified earlier, the XSD will be saved in the PROJECT_HOME/resources/schemas folder with the name specified in the Schema File field.
- The target name space of the schema is added to the list of Referenced URIs present on the left end of the page.
Adding an existing schema
- To use an XSD which is already present in the eMapper Project, click Existing Schema in the New context menu. A list of all the XSD present in the PROJECT_HOME/resources/schemas directory is shown. Choose an XSD and it will be saved as an external schema to the current structure.
- External schemas can be removed by selecting the namespace of the structure to be deleted and clicking the Delete button.
Load Input/Output Structure from a DTD document
Select DTD from the Add Structure menu. The Load Input/Output DTD Structure wizard appears. The DTD content can be specified from the Structure Selection Page present in this wizard. Similar to the Structure Selection Page in Load Input/Output XSD Structure Wizard, this page allows the user to enter the structure content directly or by loading it from an existing file. To load content from an existing DTD document, click the Load From File button.
Figure 3: Load Input DTD Structure
Load Input/Output Structure from an XML document
Select XML from the Add Structure menu. The Load Input/Output XML Structure wizard appears. The dialog contains two panes: XML Content and Generated DTD.
The name of the structure can be specified in the Structure Name field. The structure name cannot contain special characters. Only alphabets, numbers and '_' are allowed in a structure name. Two structures with the same name are not allowed.
The XML can be provided in the text area present in the XML Content pane. This text area has a tool bar with two buttons, Load From File and Generate DTD. The content can be loaded from an existing file by clicking the Load From File button. Click the Generate DTD button to generate a DTD from this XML document. The DTD is shown in the text area present in the Generated DTD pane. This DTD document is used to load the structure. Modifications, if needed, can be made to this DTD.
The structure can be saved and loaded in the Input/Output Structure panel by clicking the Finish button. The content is saved in a file with name <Structure_Name>.<Mime_Type> in the PROJECT_HOME/resources/schemas directory. If the schema is not valid an exception is logged in the Error Log view.
Figure 4: Load Input XML Structure
Load a FIX message as an Input/Output Structure
Select FIX from the Add Structure menu A list of different FIX versions and message types is displayed where the messages to be loaded can be chosen. Select the message types and click the Load button to load the messages types in to the workspace. Click Finish in the Add Structure wizard and the FIX message structure is loaded in Mapper.
Figure 5: Loading a Fix Message
More information on FIX-XML transformation is provided in the FIX-XML Transformations section.
Delete Structure
A structure can be deleted from the Input/Output Structure Panel by clicking the Delete Structure panel present in the structure panel's tool bar. This will delete the selected structure and will clear all the mappings associated with this structure.
Edit Structure
To edit Input/Output Structure:
- Right-click the structure and click the Edit Structure option. The Edit Structure dialog is opens as shown in the figure below.
- The selected structure is shown in the text area. A drop-down in the top lists all the imported schemas added to the structure. Selecting a schema from the drop-down will populate its content in the text area. Modifications to the structure can be done here. The (Load From File) button can be used to load structure from a file And the (Save) button to save the modifications in the current schema.
- Click the OK button to save the modifications to the structure and to refresh the tree structure in the mapper with the modified structure.
If the new structure is valid, it gets saved and loaded in its corresponding panel. Otherwise, an error dialog box is shown and the modifications are ignored. Upon editing a structure, mappings defined to the affected elements/attributes are discarded.
Figure 6: Edit Structure Dialog