The MakeDoc api enables application programmers to integrate running ITP models in their own applications. This api is available as a function and as an executable.

Models
This api outputs an ITP file--or model, which resides on a traditional LAN. 

The process for creating this model begins when OV2Word converts OfficeVision documents to MS Word files using our OV2Word converter. These newly created MS Word files contain the document's layout & content, data merge, and media device requirements. 

To create an ITP model, this MS Word file is submitted to the MakeDoc api. The MakeDoc api generates an ITP file--called a model.

A model is a compiled object to which platform connection information has been added that identifies the client-server/host connection, for example, AS400, OBDC, Oracle, and so on. 

This model is then submitted to a second process that runs the model. When the model is run, a second MS Word file is produced and placed on the LAN. The document incorporates all the resolved information from the model and is called the Result document. The Result document is located initially on the LAN, but can be archived, scanned, PDF, emailed, or printed using ITP.

DLL
<api_result> = INT RUNMDL(STRING <flags_and_optional_parameters>, STRING <model>, STRING <result_document>, STRING <overwrite>, STRING <keys>, STRING <extra>)

Executable
RUNMDL <flags> <optional_parameters> <model> <result_document> <overwrite> <keys> <extra>

Flags and Optional Parameters
/cfg=<ITP configuration file>The configuration file specified overrides the current ITP configuration file.
/m Execute post-macro if the post-macro is set and ITP supports the word processor's macro feature.
/i Starts this api minimized (like running in the background).
/q This parameter is obsolete in ITP/CS. ITP/CS will always allow interaction (including warning messages and fatal errors). ITP/Batch Server will always run in quiet-mode, in which no interaction can take place (including warning messages and fatal errors). In both cases warnings and error messages are logged to the file ITPLOG in the ITP temp directory.
/e Edit the result document in the word processor.
/p Print the result document. This is only supported for Windows word processors that support the Windows shell print functions.
/macro=<post-macro> Specifies which particular post-macro is to be executed. This overrides the value in the ITP configuration file.
/pre=AS400.CMD[…]AS/400 Connection only. The /pre is executed after the librarylist is set.
/onsuccess=AS400.CMD[…]AS/400 Connection only. /onsuccess is executed if the model completed successfully.
/onfailure=AS400.CMD[…]AS/400 Connection only. /onfailure is executed if the model failed.
/post=AS400.CMD[…]AS/400 Connection only. The /post is executed at the end of the run (after onsuccess or onfailure).

Required Parameters
Model-The model to be executed (a *.itp file). This may be specified relative to the configured model directory.
Result_document-The result document. This may be specified relative to the configured result directory. The programmer is responsible for the correct extension.
Overwrite-Specifies whether the result document should be replaced if it already exists. Values can be "Y" (overwriting the result is allowed) or "N".
Keys-Specifies the ‘key’ values for this model.
Extras-Specifies the ‘extra’ values for this model. 

API Result
0 (= EXIT_NO_ERRORS)No errors occurred.
1 (= EXIT_FATAL_ERROR)A fatal error has occurred while executing the model. If the model has been executed in quiet mode, the actual errorcode and error message are stored in a file named ITPLOG in the itp temp directory.
5 (= EXIT_PROGRAM_ABORT)Model execution has been aborted by the user.
6 (= EXIT_RESULT_EXISTS)The result document already exists. This value can only be returned when the overwrite parameter is "N".
7 (= EXIT_MODEL_NOT_EXIST)The model, which was to be executed, does not exist.
11 (=EXIT_TIMEOUT)Running the model has timed out.
13 (=EXIT_DATAMANAGER_ERROR)The DataManager has ended.
14 (=EXIT_NO_VALID_CFG)ITP/ Batch Server only. No configuration file active or passed as parameter to the API.

Examples
Command line specification of key parameters and no extra parameters:
RUNMDL.EXE c:\models\test.itp c:\result\test.doc Y "!Zaphod;Beeblebrox;42" "none"

Command line specification of extra parameters and no key parameters:
RUNMDL.EXE c:\models\test.itp c:\result\test.doc Y "none" "!Zaphod;Beeblebrox;42"

DLL API specification of extra and key parameters:
rc = RUNMDL("", "test.itp", "test.doc", "Y", "!Zaphod;Beeblebrox", "!42")

File specification of key and extra parameters through executables:
ITPKEYS.EXE c:\temp\model1.key Zaphod BeeblebroxITPEXTRA.EXE c:\temp\model1.ext 42RUNMDL.EXE c:\models\test.itp c:\result\test.doc Y c:\temp\model1.key c:\temp\model1.ext


©2003 ITSG Inc. All rights reserved.    Terms of Use    |    Privacy