Altova MapForce 2024 Enterprise Edition

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

Application

Read-only.

Retrieves the application's top-level object.

FullName

Path and name of the document file.

JavaSettings_BasePackageName

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).

LibraryImports

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.

MainMapping

Read-only.

Retrieves the main mapping of the document.

MapForceView

Read-only.

This property gives access to functionality specific to the MapForce view.

Mappings

Read-only.

Returns a collection of mappings contained in the document.

Name

Read-only.

Name of the document file without file path.

OutputSettings_ApplicationName

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).

OutputSettings_Encoding

This property is no longer supported. Mapping output encoding settings do no longer exist. Components have individual output encoding settings.

Parent

Read-only.

The parent object according to the object model.

Path

Read-only.

Path of the document file without name.

Saved

Read-only.

True if the document was not modified since the last save operation, false otherwise.

 

Methods

Name

Description

Activate

Makes this document the active document.

Close

Closes the document without saving.

CreateUserDefinedFunction

Creates a user defined function in the current document.

FindComponentByID

Searches in the whole document, also all its mappings, for the component with the specified id.

GenerateCHashCode

Generates C# code that will perform the mapping. Uses the properties defined in Application.Options to configure code generation.

GenerateCodeEx

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.

GenerateCppCode

Generates C++ code that will perform the mapping. Uses the properties defined in Application.Options to configure code generation.

GenerateJavaCode

Generates Java code that will perform the mapping. Uses the properties defined in Application.Options to configure code generation.

GenerateOutput

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.

GenerateOutputEx

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.

GenerateXQuery

Generates mapping code as XQuery. Uses the properties defined in Application.Options to configure code generation.

GenerateXSLT

Generates mapping code as XSLT. Uses the properties defined in Application.Options to configure code generation.

GenerateXSLT2

Generates mapping code as XSLT2. Uses the properties defined in Application.Options to configure code generation.

GenerateXSLT3

Generates XSLT 3.0 mapping code. Uses the properties defined in Application.Options to configure code generation.

HighlightSerializedMarker

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.

Save

Saves the document to the file defined by Document.FullName.

SaveAs

Saves the document to the specified file name, and sets Document.FullName to this value if the save operation was successful.

 

Events

Name

Description

OnDocumentClosed

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.

OnModifiedFlagChanged

This event is triggered when a document's modification status changes.

© 2018-2024 Altova GmbH