Document provider

The document provider interface consists of this function:
Syntax:
    function extern xmlnode get.metadata()
Description:
    Provides the document provider meta data in datafields and optionally contexts.
Example implementation which assumes the bic_dom be included:
  
    domain ttxmlnode meta.node
  
    meta.node = dom.provider.metadata.init()
  
    dom.provider.metadata.add.field("filename", "Filename", "ttaud.path",  meta.node)
    dom.provider.metadata.add.field("docname", "Document name", "ttaud.path", meta.node)
    dom.provider.metadata.add.field("extension", "Extension", "ttst10", meta.node)
    
    dom.provider.metadata.add.context("new", "New file", meta.node)   dom.provider.metadata.add.context("update", "Updated file", meta.node)

    return (meta.node)
    Description: XML node with metadata

The <bic_dom> include contains these supporting functions, which can be used in the get.metadata implementation:

dom.provider.metadata.init()
Syntax:
     function extern long dom.provider.metadata.init()
Description:
     Initializes the DOM Document Provider meta data structure.
dom.provider.metadata.add.field()
Syntax:
     function extern long dom.provider.metadata.add.field (string i.id, string i.description, string i.domain, long io.metadata)
Description:
     Adds a provider data field to the meta data.
Arguments:
     i.id: Name of the provider data field.
     i.description: Description of the provider data field.
     i.domain: Domain of the provider data field.
     io.metadata: Node created by dom.provider.metadata.init().
dom.provider.metadata.add.context ()
Syntax:
     function extern long dom.provider.metadata.add.context (string i.id, string i.description, long io.metadata)
Description:
     Adds a provider context to the meta data.
Arguments:
     i.id: Name of the provider context.
     i.description: Description of the provider context.
     io.metadata: Node created by dom.provider.metadata.init().
dom.add.external.document()
Syntax: 
function extern long dom.add.external.document( 
const string i.doc.provider, 
const string i.doc.provider.context, 
const string i.file.name, 
const string i.language, 
boolean i.own.transaction, 
ref string o.error,
[long i.receiver.independent.destinations])

Description: 
Add a rendered document to Document Output Management (DOM). The given language is used to select language dependent DOM document type parts. A batch is created with one document
Precondition: 
The given document provider exists and a valid document provider rule exists.
Postcondition: 
The document given in i.file.name is added to DOM as rendered document and is ready for distribution.

Arguments: 
i.doc.provider - The DOM Document Provider 
i.doc.provider.context - The Document Provider context used to differentiate in DOM expressions. 
i.file.name - The rendered document to be added. This includes the path on the LN server. 
i.language - Language to be used for selection of language dependent document type parts. 
i.own.transaction - whether or not the changes have to be committed to the database 
o.error - Error message in case of an error. Return value: long 0 in case document has been added, <0 when not OK 
    -2 Document Provider not found 
    -3 Document Provider Context not found 
    -4 Document Provider rule problem 
    -5 Document type used in document provider rule not found 
    -6 Batch cannot be created in DOM 
    -7 Problem in getting keywords from document provider rule object 
    -8 Document cannot be created in DOM 
    -9 Document Variables cannot be created in DOM 
    -10 Problem in initializing document distribution 
    -11 Most likely given file cannot be attached as BLOB
i.receiver.independent.destinations - Optional argument which can contain additional receiver type dll independent document destinations. Argument must be the response of dom.get.document() call and destinations can be added via the dom.destination.* methods.