MapForceServer
The MapForceServer class creates a new MapForce Server object instance, and provides access to the MapForce Server engine.
Methods
Name | Description |
---|---|
Adds properties from a credential property map to the current credential. This method takes as argument a credential property map (property_name, property_value). This method must be called after calling beginCredential() and before calling endCredential(). As an alternative to calling this method, you can also call AddCredentialProperty(). | |
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(). As an alternative to calling this method, you can also call addCredentialPropertiesFromMap(). | |
Assigns a value to a parameter defined in the mapping. | |
Creates a new credential with the name supplied as argument. If you call this method, you must also add properties to it using addCredentialProperty() or addCredentialPropertiesFromMap(), 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 major version of the MapForce Server API. This can be different from the product version if the API is connected to another server. | |
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. | |
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. | |
Gets the message received during the last run command. | |
Gets the major version of the product, as number of years starting from 1998 (for example, "20" for Altova MapForce Server 2018). | |
Gets the minor version of the product (for example, "2" for Altova MapForce Server 2018 r2). | |
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. | |
Gets the name of the product (for example, "Altova MapForce Server"). | |
Gets the complete name and version of the product (for example, "Altova MapForce Server 2018 r2 sp1 (x64)"). | |
Gets the path to the server's binary executable file. | |
Gets the service pack version of the product (for example, "1" for Altova MapForce Server 2018 r2 sp1 (x64)). | |
Gets the current working directory. | |
Returns true if the MapForce Server engine is a 64-bit executable. | |
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. | |
Sets the path of the MapForce Server executable. | |
Sets the current directory for running jobs (relative paths will be evaluated against the working directory). | |
Stops the server process. |
Examples
For an example of creating a new instance of MapForceServer in Java, see the Java example.