Arbortext Command Language > Functions by Alphabetical Listing > document_import
  
document_import
document_import ([inFile[, outFile[, mapFile[, logFile[, nFlags]]]]])
This function starts an import process with the specified parameters. This function returns one of the following values:
-1 — The import failed or the user canceled the import using the interactive mode.
0 — Failure using Arbortext Publishing Engine import processing.
A number greater than 0 — Success. The value returned is the ACL document identifier of the resulting document
document_import has the following parameters:
inFile — The path and file name of the source document to be imported.
outFile — The path and file name of the converted XML document.
mapFile — The absolute path and file name of the MapTemplate for the target document type on your Arbortext Publishing Engine server.
To determine which maps are installed on the server, use the following commands in an ACL function:
require compconfig;
local mapList[];
local mapCount = compconfig::getImportMaps( mapList );
Alternately, use the following commands outside of an ACL function:
require compconfig;
global mapList[];
mapCount = compconfig::getImportMaps( mapList );
Either method sets mapCount to the number of map file installed on the server, and fills the array mapList with the absolute paths to each map file.
logFile — The path and file name of the Import log file.
nFlags — A set of bit flags (that is, an integer argument, not a string argument), defined as follows:
If bit 0,(flagLightsOut), is 1 (decimal value of 1), the import process is run “lights-out” or in batch mode. In this mode, the import process will not display anything on screen. The default value for this option is dependent on how Arbortext Editor is being run. The default is 0.
If bit 1, (enableMapComments), is 1 (decimal value of 2), the import process will include MapObject comments in the imported XML document. The default value is 0.
If bit 2, (flagVerboseLog), is 1 (decimal value of 4), the import process generates a verbose import log if the log file parameter is specified.
If bit 3, (flagDoNotOpenDoc), is 1 (decimal value of 8), the import process will not automatically open the imported XML document in Arbortext Editor (using the ACL function doc_open).
* 
The Arbortext Import/Export bit flags are defined as the following ACL constants:
#################################
# Import/Export bit flags
#################################
global flagLightsOut = 0x0001
global enableMapComments = 0x0002
global flagVerboseLog = 0x0004
global flagDoNotOpenDoc = 0x0008
If any of the first three parameters (inFile, outFile, or mapFile) is not specified, the function will run interactively, prompting the user to specify valid values for the settings.The final parameter (nFlags) is optional. If it is not specified, the default value will be used.
If Bit 0 (flagLightsOut) of nFlags, is set to 1, the first three arguments must be specified. If nFlags is set to 1 and one of the first three parameters is not specified, the function will return -1.
If the import process is not run in batch mode, the resulting document will be displayed in Arbortext Editor. If nFlags is 8, only the document identifier is returned. It is the caller's responsibility to close the document (with doc_close) when finished. Note that in both cases the document will have been saved to the location specified by outFile.