Infor Document Management
Utilities
Important Notices
Please be advised that by downloading the Infor Document Management (IDM) application for use
on a desktop/laptop computer, or other supported device, you will gain access to certain IDM source
code, made available by Infor for the limited purpose of allowing the IDM application to run on such
supported devices. Infor cautions you not to modify such source code. Infor neither assumes nor
accepts responsibility or liability regarding any such modifications and will not provide support for any
application issues related to such modifications.
IDM Utilities
The following utilities are available:
• Export
• Export All
• Export Configuration
• Import
• Import All
• Import Configuration
• File Import
• Batch Delete
• Batch Update
• Verify Connection
• Audit Files
• Bulk Import
All utilities are packaged into one self-contained executable jar file which includes all dependencies to
other components. The jar file can be executed with this command (make sure to use enough memory,
large imports and exports can consume a lot of memory, 1GB RAM is used here):
java -Xms1024m -Xmx1024m -jar Utilities-<version>.jar <utility> <arguments>
If no utility and arguments are specified (for example when just launching the jar file), then it will launch
a graphical user interface for the utilities. This GUI simplifies the configuration of the utilities and also
provides you with the command line arguments to run the specified configuration.
The utilities work with IDM versions from 10.1 or newer if not other is specified. Source code is also
included.
System Requirements
Java 17 is required.
If Java 17 is used together with the Utilities UI then JavaFX needs to be installed as well
(https://openjfx.io/). The Utilities tool can be started from command line where the “module-path”
points to the JavaFX directory:
java -Xms1024m -Xmx1024m --module-path "C:\Program Files\Java\javafx-sdk-11.0.1\lib" --add-modules=javafx.controls,javafx.fxml,javafx.web
-jar Utilities-<version>.jar
Connection arguments
All utilities support the same connection arguments which is used to connect to the IDM server.
• -baseUrl – the url to the IDM server, for example “Error! Hyperlink reference not valid.”
• -authMode – the authentication mode
• -username – the username used to authenticate
• -password – the password used to authenticate
• -consumerKey – the OAuth 1.0a consumer key if authentication mode is “OAUTH1”
• -secretKey – the OAuth 1.0a secret key if authentication mode is “OAUTH1”
• -sessionCookieName – the name of the session cookie if authentication mode is “SESSION”
• -sessionCookieValue – the session cookie id, used if authentication mode is “SESSION”
• -impersonationTenant – the tenant to impersonate, supported if authentication mode is
“OAUTH1. Will not work in MT Cloud.
• -impersonationUsername – the username to impersonate, supported if authentication mode is
“OAUTH1”. Will not work in MT Cloud.
• -authorizationHeader – the authorization header to use, used if authentication mode is
“AUTHORIZATION”. For usage with ION Api this value could look like this: “Bearer
16acd3a25fc9bc810539f5de656df53c”. This is not recommended for long running jobs using ION
Api since the token will expire after two hours.
Common issues
1. When running any utility and the message “Exception: output log” is displayed in the right-hand
menu, this indicates that the Utility does not have write access to the directory from which it is
being ran. To navigate this issue, please do the following:
i. Create a new folder that the user will have write access for.
ii. Place the Utility Jar File in this folder.
iii. Grant the read and write permission to everyone for this folder alone (just to be
sure we have the correct permissions).
iv. Open either the command prompt or terminal as administrator and change
directories to the folder that was just created.
v. Run the Utility using the command: java -jar Utilities-<version>.jar
vi. You should now be able to use the Utilities without the Exception message
referenced above.
Export
Used for migration of documents from one document type from one system to another. Make sure to
use a user that is allowed to access all documents. All documents should also be checked in before the
export because the data in the checked out documents will not be exported.
The export is executed in two steps, the first step is the export of metadata the second step is the files.
The first step must finish successfully but the second step can be aborted and then when restarted it will
automatically continue downloading the rest of the files. The export is saved into the “export” folder.
Note: This means that if an export is executed against a non-empty folder then only the files will be
resumed. No document metadata will be downloaded again.
If SharePoint is used, then the “-sharepoint” argument must be specified which will use a different kind
of search so that all documents can be exported. For SharePoint only one thread will be used for the
exports of metadata, for the other systems multiple threads will be used for increased performance.
All actions will be retried one time if an error occurs. If the error persists then it will be logged and then
forgotten. It is up to the person doing the export to verify what to do with the error(s).
Common Arguments
• -path – the path to an existing migration folder on disk, if the folder is not empty then we
assume that we are resuming the download of files for an existing export
• -documentType – the document type to export, for example “MDS_File”
• -allVersions – if specified then all versions for a document will be exported, with many versions
this can take considerable more time for the export to complete
• -sharepoint – should be specified if the system is SharePoint, otherwise only the first 5000
document will be exported
• -xquery – the search query used, if this is specified then “–documentType” and “–sharepoint”
can’t be specified. The search query should only search in one document type otherwise the
error handling might not work.
Export All
Works the same as “Export” except that it will automatically export all document types.
Common Arguments
• -path – the path to an existing migration folder on disk, if the folder is not empty then we
assume that we are resuming the download of files for an existing export
• -allVersions – if specified then all versions for a document will be exported, with many versions
this can take considerable more time for the export to complete
• -sharepoint – should be specified if the system is SharePoint, otherwise only the first 5000
document will be exported
• -includeDataModel – this exports all document types to a “configuration.xml” file in the
migration folder. This is especially interesting when exporting from IBM CM and MS SharePoint
since it is not possible to manually export from those systems.
• -onlyIncludeValidDocumentTypes – if specified then document types that are not considered to
be valid and therefore will not be possible to import will not be exported, instead a warning will
be created. Reasons for a document type to not be considered to be valid could be incorrect
naming, for example having a space in the name (could be a problem in MS SharePoint) or it
could be that it uses multiple attributes in a multi value attribute (could be a problem in IBM
CM).
Export Configuration
Used for exporting documents to a Configuration .xml file that can later be imported with Import
Configuration. What documents are exported is specified with an xquery. There is a limit on 50 MB of
documents in a Configuration .xml file (raw size). If the combined sized of all documents are bigger than
50 MB several Configuration .xml files will be created. The files will be named with the value of the
baseFileName argument, appending a numbering sequence starting at 001. Maximum number of
documents that can be exported is 1000.
By default, the ACLs are not included in the export but it is possible to include a reference to the ACLs or
set a specific ACL. Note that the actual ACL is not included in the export.
Common Arguments
• -path – the path to an existing folder on disk where the Configuration .xml files should be saved
• -xquery – the xquery that defines what documents should be exported
• -baseFileName – start of the Configuration .xml filename, “_XXX.xml” will be added to the
baseFileName where XXX is a number sequence starting on 001. Default value is “ExportFile”
• -overrideACL– name of an ACL to set on every document
• -includeACL – if true, the ACL will be included in the export and the parameter overrideACL will
be ignored. Default value is false
Import
Used for migration of one document type from one system to another. Depending on how the export
and import is configured all data can be migrated except these:
• Id (and therefore the Pid will change)
• All timestamp properties (Created, Last Modified, Checked Out)
The first step is to make sure that the document type in the target system has the same attributes and
access control lists as the exported system.
The import will run in multiple threads, each thread will move one of the folders from the “export”
folder into the “in-progress” folder. When that folder has been imported then it will be moved to the
“finished” folder. If any error occurs then that document will be placed in a separate folder in the “error”
folder. To rerun any of the errors just move those folders to the “export” folder and start the import
again.
It can also be a good idea to make a backup on the export folder before starting an import. Because if an
unhandled exception like out of memory occurs then the import might not be possible to restart.
Common Arguments
• -path – the path to an existing migration folder on disk. This folder should have a child folder
called “export”.
• -keepCheckOutState – if the document should still be checked out if that was the state when it
was exported.
• -trimAttributes– when attributes of the document have unwanted leading / trailing spaces in
String values or trailing zeros in Decimal values, they can be trimmed by using this option. This
may be necessary when importing documents from older versions of IDM or Smart Office.
Import All
Works the same as “Import” except that it will automatically import all document types.
Common Arguments
• -path – the path to an existing migration folder on disk. This folder should have a child folder
called “export”.
• -keepCheckOutState – if the document should still be checked out if that was the state when it
was exported.
• -trimAttributes – when attributes of the document have unwanted leading / trailing spaces in
String values or trailing zeros in Decimal values, they can be trimmed by using this option. This
may be necessary when importing documents from older versions of IDM or Smart Office.
• -includeDataModel – this imports all document types from a “configuration.xml” file in the
migration folder.
Import Configuration
Used for importing a Configuration Xml file. This file can be created from Control Center in IDM and can
include everything from Document Types to Value Sets to configuration data like Business Context
Models.
Common Arguments
• -path – the path to the configuration xml file
File Import
Used for importing unstructured files on disk to the specified document type. Either the filename or a
static value can be set on the created documents. An Access Control List can also be specified.
It is possible to move processed files to another location by specifying a secondary path. If specified,
then a folder called “movedFiles” will be generated in the folder containing the processed files. If there
are files in this folder then those files will be moved to a new sub-folder called “oldFiles_{timestamp}”.
Common Arguments
• -path – the path to a folder to import files from
• -documentType – the document type to export, for example “MDS_File”
• -acl – the Access Control List to set on all the documents
• -finishedPath – the path to where the files can be optionally moved
• -filenameAttribute – the attribute where the filename should be saved into, for example
“MDS_Name”
• Additional arguments are the attributes that should be changed like this:
MDS_Name "ABC" MDS_Status 20
Batch Delete
Used for deleting all documents in a specific document type or specific documents using a search query.
Common Arguments
• -documentType – the document type to export, for example “MDS_File”
• -xquery – the search query used, if this is specified then “–documentType” can’t be specified.
Batch Update
Used for changing one or more attributes and/or access control list matching a specific search query.
The search query used must be setup so that it doesn’t match the document after the document has
been updated. Otherwise the batch update will end up in an infinite loop doing updates on the same
document over and over. Multi value attributes can also not be used in the search query since that
would also end up in an infinite loop.
If only the “xquery” argument is specified, then the number of matched documents will be returned but
no changes will be made.
Common Arguments
• -xquery – the search query
• -acl – an optional access control list to set on the matched documents
• Additional arguments are the attributes that should be changed like this:
MDS_Name "ABC" MDS_Status 20
Verify Connection
Verifies if it can connect to the IDM server or to the IDM SharePoint adapter.
When connecting to the IDM SharePoint adapter it will connect the same way as the IDM server do
when it connects to SharePoint. If the “baseUrl” argument is a SharePoint adapter url the SharePoint
connection mode will be used. A SharePoint url contains this: “/_vti_bin/”.
Common Arguments
No specific arguments are available. Everything is configured through the connection arguments.
Audit Files
Creates an Audit for file integrity. Checking if files are missing from disk or if they have been tampered
with since uploaded to IDM. Tampered means that the SHA256 checksum returned from server doesn’t
match the calculated checksum. The report includes:
• Audit requested by <username>
• xQuery
• SearchState (Active or Archived documents)
• Total number of documents found
• Total number of documents with files
• Total number of documents which files could not be retrieved
o A list of these documents including the PID and xQuery
• Number of documents with tampered files
o A list of these documents including the PID, xQuery and SHA256 checksums
Common Arguments
• -documentType – the document type to export, for example “MDS_File”
• -xquery – the search query used, if this is specified then “–documentType” can’t be specified.
• -searchArchived – searches in archived documents.
Bulk Import
Used for uploading multiple documents of the same type to IDM from another repository by
enumerating each document’s files and attributes in an Excel spreadsheet.
The spreadsheet must have a header in the first row that contains four required columns (Status, MDS
ID, Relative Path, File) and a column for each attribute of the document type the user intends to set on
the uploaded items.
Fill out the spreadsheet’s rows with the following information and place within the root directory
selected for the upload. Ensure the spreadsheet is named either bulkImport.xlsx or bulkImport.xls.
Headers with a hollow bullet point require the IDM-SuperUser role to be properly supported.
Header Information:
• Status: Leave blank; when the upload has finished, data will be generated here to let end-user
know whether upload of file was successful.
• MDS ID: Leave blank; when the upload has finished, data will be generated here to enable end-
user to search for the document in IDM, will be overwritten with the item's PID if the document
type doesn't support MDS ID.
• Relative Path: List the containing folder path of each file to be uploaded (relative to the root
directory from step 1).
• File: List the name of the file to upload.
o Created By: Enter the original creator of the item here.
o Created Timestamp: Enter the original creation timestamp of the item here.
o Last Changed By: Enter the last modifier of the item here.
o Last Changed Timestamp: Enter the last modification timestamp of the item here.
• Create new column for each IDM attribute (named with the attribute name, not the display
name); required attributes are mandatory.
Attribute Information:
• If the attribute is required, the cell cannot be left blank
• Based on data type, please make sure value abides by data type rules.
• Long and short values should be integer values.
• GUIDs should match the pattern for a GUID.
• Value Sets should contain a valid value of the set.
• Booleans must be either TRUE or FALSE.
• Time must be in HH:mm:ss format (Can be configured in Excel).
• Date must be in yyyy-mm-dd format (Can be configured in Excel).
• Timestamp must be in yyyy-mm-dd HH:mm:ss format (Can be configured in Excel).
• Multi-valued attributes should be separated with a comma (,) in the same cell, and to escape a
comma a slash (\) should be used.
Additional Information
• Example of Relative Path: For a single upload, let’s say the root directory is
/Users/<user>/Desktop/BulkImport (or C:\Users\<user>\Desktop\BulkImport on Windows),
and there is a file to be uploaded at the path
/Users/<user>/Desktop/BulkImport/files/docs/doc1.docx (or
C:\Users\<user>\Desktop\BulkImport\files\docs\doc1.docx on Windows),. The user, for this
specific upload would list files/docs (or files\docs on Windows), and doc1.docx as the Relative
Path and File respectively.
Common Arguments
• -documentType – the document type to use for upload, for example “MDS_File”
• -rootDirectory – the directory that contains all files (directly or through a sub-directory) to be
uploaded
• -threads – the number of threads to use when uploading (max value of 10), this will allow the
utility to upload multiple documents at a time
• -batchSize – the number of documents to batch together (max value of 100), this is the size of
the batches a single thread will work on at a time while uploading. This is not a limit on the size
of an entire bulk import; once the thread uploads this number of items, it will be assigned
another ‘batch’ that is less than or equal to this value in size to begin uploading.
• -persistProperties – include if the user intends to set the properties ‘Created By’, ‘Created
Timestamp’, ‘Modified By’, ‘Modified Timestamp’ of the item during upload. The user must have
the role IDM-SuperUser and the columns must be included in the spreadsheet for the upload to
be successful.
• -versionColumn – used to select the attribute that will be used to match multiple items to be
used as different version of the same item. Items will be grouped with items that have an
identical value within the attribute selected. The user must have the role IDM-SuperUser and the
items should be listed in version order within the spreadsheet, with the original item appearing
first. Possible values for this property include any attribute of the item and ‘File Name’ if the
item’s resource name is to be used.
Modifying the source code
The source code for the utilities is included in the zip file. It can be used to modify the default behavior to
match customer requirements. The code can be edited in an IDE like eclipse or just with a text editor.
In the code you can search for this text: “// Modify:” It will be added to places in the code where it is
recommended to do changes.
If a text editor is used to edit the code then following commands can be used. A Java JDK is needed on
the path for the commands to work.
Extract the code
jar -xf Utilities-<version>-sources.jar
Compile all classes
javac -encoding UTF-8 -classpath Utilities-<version>.jar com\infor\daf\utilities\core\*.java
com\infor\daf\utilities\migration\*.java com\infor\daf\utilities\*.java
Create a new jar (“changes.jar”) with the changed code
jar -cmf META-INF\MANIFEST.MF changes.jar com
Run the new code
Command Line: java -classpath changes.jar;Utilities-<version>.jar com.infor.daf.utilities.Main
GUI: java -classpath changes.jar;Utilities-<version>.jar com.infor.daf.utilities.ui.MainApplication