Adding existing documents from any supported DMS through document hub

The <bic_dom> include contains functions, which can be used to add existing documents from a DMS:

dom.dochub.list.init
Syntax:
     function long dom.dochub.list.init(string i.table, i.doc.type)
Description:
     Initializes the List Documents request.
Arguments:
string i.table
                     the LN Table
string i.doc.type
                     the DMS Document Type, can be empty
Return value: 0, or -1 if an error occurred
dom.dochub.list.add.attribute.filter
Syntax:
     function long dom.dochub.list.add.attribute.filter (string i.appl.attr.id, string i.attr.value)
Description:
     Adds an attribute filter to the List Documents request.
Arguments:
     string i.appl.attr.id
                          the application attribute ID
     string i.attr.value
                          the attribute value
Return value: 0, or -1 if an error occurred
dom.dochub.list.set.filename.filter
Syntax:
     function long dom.dochub.list.set.filename.filter (string i.filename.filter)
Description:
     Adds a filename filter to the List Documents request.
Arguments:
     string i.filename.filter the filename filter, a regular expression
Return value: 0, or -1 if an error occurred

For more information about the regular expressions, see the description of expr.compile in the Infor ES Programmers Guide (Infor Customer Portal KB2924522)

dom.dochub.list.set.mimetype.filter
Syntax:
     function long dom.dochub.list.set.mimetype.filter (string i.mimetype)
Description:
     Adds a MIME type filter to the List Documents request.
Arguments:
     string i.mimetype
                       the MIME type, a regular expression
Return value: 0, or -1 if an error occurred
dom.dochub.list.execute
Syntax:
     function long dom.dochub.list.execute()
Description:
     Executes the List Documents request. 
Return value: the number of documents found, otherwise <0
dom.dochub.get.document
Syntax:
     function long dom.dochub.get.document (long i.unique.ident ,
                                             ref string o.result.file)
Description:
     Use this function to retrieve one document from DSM and store it as a temporary file.
Arguments:
     long i.unique.ident
                        the internal DMS document ID
     ref string o.result.file
                        the temporary file (including path), which contains the downloaded 
                            DMS document
Return value: 0 if document retrieved, otherwise -1
dom.dochub.get.document.attribute
Syntax:
     function string dom.dochub.get.document.attribute (long i.entry,
                                                    string  i.attribute)
Description:
     Use this function to retrieve the value of a document attribute from DMS.
Pre:
     Call dom.dochub.list before this method to retrieve the list of documents.
Arguments:
     long i.entry
                      The index of the DMS document
     string i.attribute
                      The name of the attribute which value should be retrieved
Return value: the attribute’s value of the document, or empty if an error occurred
dom.dochub.get.document.id
Syntax:
     function string dom.dochub.get.document.id (long i.entry )
Description:
     Use this function to retrieve an internal ID of a document from DMS.
Pre:
     Call dom.dochub.list.execute before this method to retrieve the list of documents.
Arguments:
     long i.entry
                      The index of the DMS document
Return value: the ID of the document, or empty of an error occurred
dom. dochub.get.document.filename
Syntax:
     function string dom. dochub.get.document.filename (long i.entry)
Description:
     Use this function to retrieve the filename of a document from DMS.
Pre:
     Call dom.dochub.list.execute before this method to retrieve the list of documents.
Arguments:
     long i.entry
                      The index of the DMS document
Return value: the filename of the document, or empty of an error occurred
dom.dochub.get.document.mimetype
Syntax:
     function string dom.dochub.get.document.mimetype (long i.entry)
Description:
     Use this function to retrieve the mime type of a document from DMS.
Pre:
     Call dom.dochub.list.execte before this method to retrieve the list of documents.
Arguments:
     long i.entry
                      The index of the DMS document
Return value: the mime type of the document, or empty if an error occurred
dom.add.document.to.distribution
Syntax:
     function long dom.add.document.to.distribution (string i.tempfile,
                                                     string   i.name,
                                                     string   i.mimetype)
Description:
     This function adds an existing document from IDM to the list of distributions.
Arguments:
     string i.tempfile
                      The name of the IDM document to add (including path)
     string i.name
                      The display name of the IDM document to add
     string i.mimetype
                      The mime type of the IDM document to add
Return value: 0 in case of success, otherwise -1
dom.errormessage.set()
Syntax:
     function extern void dom.errormessage.set(const string i.error.message)
Description:
     Creates an error message for a document. Already added destinations will be removed.
Arguments:
     i.error.message: input variable which contains the error message.