Document
A Document object represents a MapForce document (a loaded MFD file). A document contains a main mapping and zero or more local user-defined-function mappings.
To navigate the object model, use the following properties:
•Application
•Parent
For file handling, use:
•Activate
•Close
•FullName
•Name
•Path
•Saved
•Save
•SaveAs
For mapping handling, use:
•MainMapping
•Mappings
•CreateUserDefinedFunction
For component handling, use:
•FindComponentByID
For code generation, use:
•OutputSettings_ApplicationName
•JavaSettings_BasePackageName
•GenerateCHashCode
•GenerateCodeEx
•GenerateCppCode
•GenerateJavaCode
•GenerateXQuery
•GenerateXSLT
•GenerateXSLT2
•GenerateXSLT3
•HighlightSerializedMarker
For mapping execution, use:
•GenerateOutput
•GenerateOutputEx
View access:
•MapForceView
Obsolete:
•OutputSettings_Encoding
Properties
Name | Description |
---|---|
Read-only. Retrieves the application's top-level object. | |
Path and name of the document file. | |
Sets or retrieves the base package name used when generating Java code. In the MapForce graphical user interface, this setting is available in the Mapping Settings dialog box (right-click the mapping and select Mapping Settings from the context menu). | |
Read-only. Gets a collection of imported libraries. In the MapForce graphical user interface, these correspond to entries from the Manage Libraries window, added at document level. | |
Read-only. Retrieves the main mapping of the document. | |
Read-only. This property gives access to functionality specific to the MapForce view. | |
Read-only. Returns a collection of mappings contained in the document. | |
Read-only. Name of the document file without file path. | |
Sets or retrieves the application name available in the Mapping Settings dialog box (To display this dialog box in MapForce, right-click the mapping and select Mapping Settings from the context menu). | |
This property is no longer supported. Mapping output encoding settings do no longer exist. Components have individual output encoding settings. | |
Read-only. The parent object according to the object model. | |
Read-only. Path of the document file without name. | |
Read-only. True if the document was not modified since the last save operation, false otherwise. |
Methods
Name | Description |
---|---|
Makes this document the active document. | |
Closes the document without saving. | |
Creates a user defined function in the current document. | |
Searches in the whole document, also all its mappings, for the component with the specified id. | |
Generates C# code that will perform the mapping. Uses the properties defined in Application.Options to configure code generation. | |
Generates code that will perform the mapping. The parameter i_nLanguage specifies the target language. The method returns an object that can be used to enumerate all messages created by the code generator. These are the same messages that get displayed in the Messages window of MapForce. | |
Generates C++ code that will perform the mapping. Uses the properties defined in Application.Options to configure code generation. | |
Generates Java code that will perform the mapping. Uses the properties defined in Application.Options to configure code generation. | |
Generates all output files defined in the mapping using a MapForce internal mapping language. The names of the output files are defined as properties of the output items in the mapping.
Note: This method can only be used when the MapForce (running as a COM server) main window is visible, or is embedded with a graphical user interface. If the method is called while MapForce is not visible, then an error will occur. | |
Generates all output files defined in the mapping using a MapForce internal mapping language. The names of the output files are defined as properties of the output items in the mapping. This method is identical to GenerateOutput except for its return value containing the resulting messages, warnings and errors arranged as trees of AppOutputLines.
Note: This method can only be used when the MapForce (running as a COM server) main window is visible, or is embedded with a graphical user interface. If the method is called while MapForce is not visible, then an error will occur. | |
Generates mapping code as XQuery. Uses the properties defined in Application.Options to configure code generation. | |
Generates mapping code as XSLT. Uses the properties defined in Application.Options to configure code generation. | |
Generates mapping code as XSLT2. Uses the properties defined in Application.Options to configure code generation. | |
Generates XSLT 3.0 mapping code. Uses the properties defined in Application.Options to configure code generation. | |
Use this method to highlight a location in a mapping file that has been previously serialized. If the corresponding document is not already loaded, it will be loaded first. See GenerateCodeEx for a method to retrieve a serialized marker. | |
Saves the document to the file defined by Document.FullName. | |
Saves the document to the specified file name, and sets Document.FullName to this value if the save operation was successful. |
Events
Name | Description |
---|---|
This event is triggered when a document is closed. The document object passed into the event handler should not be accessed. The corresponding open event is Application.OnDocumentOpened. | |
This event is triggered when a document's modification status changes. |