IServer
The IServer interface creates a new MapForce Server object instance, and provides access to the MapForce Server engine.
If you are using C++ under COM platform, the name of the main interface is IServer. If you are using a .NET language such as C# or VB.NET, the name of the main interface is Server.
Properties
Name | Description |
---|---|
Read-only. Gets the major version of the MapForce Server API. This can be different from the product version if the API is connected to another server. | |
Read-only. Gets the minor version of the MapForce Server API. This can be different from the product version if the API is connected to another server. | |
Read-only. Gets the service pack version of the MapForce Server API. This can be different from the product version if the API is connected to another server. | |
Read-only. Returns true if the MapForce Server engine is a 64-bit executable. | |
Read-only. Gets the message received during the last Run command. | |
Read-only. Gets the major version of the product, as number of years starting from 1998 (for example, "20" for Altova MapForce Server 2018). | |
Read-only. Gets the minor version of the product (for example, "2" for Altova MapForce Server 2018 r2). | |
Read-only. Gets the name of the product (for example, "Altova MapForce Server"). | |
Read-only. Gets the complete name and version of the product (for example, "Altova MapForce Server 2018 r2 sp1 (x64)"). | |
Gets or sets the path of the MapForce Server executable. | |
Read-only. Gets the service pack version of the product (for example, "1" for Altova MapForce Server 2018 r2 sp1). | |
Gets or sets the current directory for running jobs (relative paths will be evaluated against the working directory). |
Methods
Name | Description |
---|---|
Adds a property to the current credential (for example, the username, the password, or both). The first argument specifies the property name, and the second argument specifies the property value. Valid property names: username, password. In MapForce Server Advanced Edition, the property name oauth:token is additionally supported.
This method must be called after calling BeginCredential() and before calling EndCredential(). | |
Assigns a value to a parameter defined in the mapping. The first argument specifies the name of the parameter as defined on the mapping; the second argument specifies the parameter value. | |
Creates a new credential with the name supplied as argument. If you call this method, you must also add properties to it using AddCredentialProperty(), and finally close the credential by calling EndCredential(). | |
Clears the list of credentials set previously. All credentials are valid for the lifetime of the object. Call this method if you need to explicitly clear all of the previously set credentials. | |
Clears the list of options previously set through the SetOption method. All options set through the SetOption method are valid for the lifetime of the object. Call this method if you need to explicitly clear all of the previously set options. | |
Clears the list of parameters that were previously set using the AddParameter method. | |
Closes a credential object that was previously created using the BeginCredential method. | |
Gets the string output generated by the last run command. Returns null if no output was generated. This function requires a string parameter which identifies the name of the output component in MapForce. | |
Executes a MapForce Server Execution file (.mfx file). Returns true in case of success; false otherwise. | |
Sets an option before running the mapping. The first argument specifies the name of the option, while the second argument specifies the option value. This method is particularly useful when a mapping was designed to consume Global Resources (see Altova Global Resources). The currently supported options are as follows:
•globalresourcefile (or gr) - A Global Resource file path. (When this option is specified, then a Global Resource configuration name must also be specified, see next item). •globalresourceconfig (or gc) - A Global Resource configuration name. (When this option is specified, then a Global Resource file path must also be specified, see previous item). •catalog - The path to a custom RootCatalog.xml file. This option enables you to specify a custom catalog file used to resolve URLs used by the mapping. The default catalog is in the etc subdirectory of the program installation directory. •taxonomy-package - The path to a custom XBRL taxonomy package, if one is required by the mapping. •taxonomy-packages-config-file - The path to a custom XBRL taxonomy package configuration, if one is required by the mapping.
All set options are valid for the lifetime of the object. If you set an option with the same name twice, the previous option will be overridden. To explicitly clear all options, call the ClearOptions() method. | |
This method stops explicitly the process connected with the COM object, without releasing the object. The process stops implicitly when the COM object is released. |
Examples
See the following examples that illustrate how to initialize and run MapForce Server in various languages: