LaserVault DMS Record Import

LaserVault DMS Reference Guide
Record Import
The LaserVault Record Import utility can be used to import data into LaserVault DMS. The program
can read CSV, TAB, TXT, MDB, and XLS files. The import program can add records to DMS and
(optionally) add files, or print barcodes for each record added.
Command Line Parameters
LVDMSRecordImport.exe /CONFIG=[path and file name of config file] /DataFile=[path
and filename of data file]
The /CONFIG parameter is optional. If it is not specified the program will try to use a config file named
LVDMSRecordImport.xml in the same directory as the exe.
The /DataFile parameter is also optional. If it is not specified, the program will try to use the datafile
entry defined in the config xml file.
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 1
Configuration File Parameters
The configuration file is an XML file with the following entries. Each entry is explained after the
sample config file.
<CONFIG>
<RunHidden>0</RunHidden>
<DMSServerURL>http://servername/LvDmsWeb/Default.asp</DMSServerURL>
<DMSSiteName>SiteName</DMSSiteName>
<DMSUserName>UserName</DMSUserName>
<DMSPassword>Password</DMSPassword>
<ColumnHeaderFile>E:\HeaderFile.txt</ColumnHeaderFile>
<DataFile>F:\temp\DMSRecTest\Invoices.csv</DataFile>
<TableName>Invoices</TableName>
<RecordFilter>InvoiceAmount&gt;0<RecordFilter>
<DeleteDataFile>1</DeleteDataFile>
<ImageRoot>F:\Temp\DMSRecTest\Images</ImageRoot>
<Margin>1</Margin>
<BCHeight>1</BCHeight>
<BCWidth>4</BCWidth>
<BCCaption>#Acct_Name# #crlf# #Inv_Number#</BCCaption>
<LabelPrinter>0</LabelPrinter>
<DefaultDeleteImage>0</DefaultDeleteImage>
<DefaultFolderName>Invoices</DefaultFolderName>
<DefaultMakeBarCode>1</DefaultMakeBarCode>
<DefaultReprint>0</DefaultReprint>
<DefaultLaunchWorkFlow>0</DefaultLaunchWorkFlow>
<DefaultImageExtension>TIF</DefaultImageExtension>
<Printers>
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 2
<Printer>
<PrinterName>HP LaserJet 4000 Series PCL</PrinterName>
<FolderName>Invoices</FolderName>
</Printer>
</Printers>
<MappedFields>
<MappedField>
<ADOFieldName>Inv_Date</ADOFieldName>
<DMSFieldName>Inv_Date</DMSFieldName>
<FieldPurpose>Update</FieldPurpose>
</MappedField>
<MappedField>
<ADOFieldName>Inv_Number</ADOFieldName>
<DMSFieldName>Inv_Number</DMSFieldName>
<FieldPurpose>Update</FieldPurpose>
</MappedField>
</MappedFields>
<StaticFields>
<StaticField>
<DMSFieldName>Document_Type</DMSFieldName>
<FieldValue>Invoices</FieldValue>
<FieldPurpose>Update</FieldPurpose>
</StaticField>
</StaticFields>
</CONFIG>
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 3
<RunHidden>0/1</RunHidden> This entry tells the program to hide the status bar while importing.
Set to 1 to turn this option on.
<DMSServerURL>[URL to DMS]</DMSServerURL> This entry specifies the URL to DMS. Be sure
to specify the full path to default.asp
<DMSSiteName>SiteName</DMSSiteName> This entry specifies the name of the DMS site to
import to.
<DMSUserName>UserName</DMSUserName> This specifies the user name to log in to DMS.
<DMSPassword>Password</DMSPassword> This specifies the password to log in to DMS.
<ColumnHeaderFile>[path and filename of colum header file]</ColumnHeaderFile> This entry
is optional. You can use this to have the program prepend column headers to a CSV, TAB, or TXT
file. The recommended method for specifying data layout is to use a schema.ini file, which is covered
later.
<DataFile>[path and filename of data file to import]</DataFile> This entry is optional if you
specified the data file on the command line. If no data file was specified on the command line the
program will attempt to use the file specified here.
<TableName>[Table Name]</TableName> This specifies the name of the table in the data file. This
only applies to .MDB and .XLS files. For XLS files this specifies the worksheet name. You will need to
place a $ after the worksheet name in the config file. For example, if the worksheet name is
‘WorkSheet1’ you would specify WorkSheet1$ as the table name.
<RecordFilter>[fieldname=value]<RecordFilter> This section defines a filter to use if you do not
want to import all records in the data file. Leave this blank to apply no filter. If you wish to filter the
records, enter a value similar to what you would use in an SQL WHERE clause.
For example:
VendorNumber=123
VendorName=’Company Inc’
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 4
<DeleteDataFile>[1/0]</DeleteDataFile> If this entry is set to 1 the program will attempt to delete
the data file after import.
<ImageRoot>[Path to folder where image files are.]</ImageRoot> This specifies the path to the
image files. This entry is optional. The path to each image can also be specified in the data file by
including a column named ‘FilePath’. There are a couple possible variations in how you can use
these settings.
1. Leave the ImageRoot entry blank and specify the full path and file name in
the ‘FilePath’ column of the data file.
2. Enter a root path for the ImageRoot entry and then specify only the file name
in the ‘FilePath’ column of the data file.
<Margin>[margin in inches]</Margin> This entry is used if you are printing a barcode cover page
for each record imported. This tells the program the top and left margin in inches to use for the
barcode.
<BCHeight>[barcode height in inches]</BCHeight> This entry is used if you are printing a
barcode cover page for each record imported. This tells the program the height of the barcode in
inches to print.
<BCWidth>[barcode width in inches]</BCWidth> This entry is used if you are printing a barcode
cover page for each record imported. This tells the program the width of the barcode in inches to
print.
<BCCaption>[text and replaceable tokens]</BCCaption> This entry is used if you are printing a
barcode cover page for each record imported. This tells the program to print a caption below the
barcode. This can be static text that you type in or you can use replaceable tokens.
Note: Replaceable tokens are values surrounded by the pound sign character. For example, if you
have a field called ‘InvoiceNumber’ in the data file, you could enter #InvoiceNumber# for the caption
and the value from that field would be output. You can also use #CRLF# to output text on a new line.
Example:
<BCCaption>Invoice Number: #InvoiceNumber# #CRLF# Vendor Name:
#VendName#</BCCaption>
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 5
<LabelPrinter>[0/1]</LabelPrinter> This entry is used if you are printing a barcode for each record
imported and you are printing to a label printer. This entry may not be necessary unless you are
having problems with the labels not auto advancing from the printer.
The following XML tags define the default actions to take for each record being imported. These
options can be overridden if there are fields in the data file that specify these values.
<DefaultDeleteImage>[0/1]</DefaultDeleteImage> This option applies if you are importing images
with each record that is imported. Setting this to 1 will tell the program to delete the image file after
it’s been imported. This sets the default option.
If there is a field in the data file named ‘DeleteFile’ the program will use the value from that field. The
field, if defined, should contain a value that evaluates to a Boolean true or false such as 1 or 0, or
‘True’ or ‘False’.
<DefaultFolderName>[DMS Folder Name]</DefaultFolderName> This option tells the program
which folder to import records and images to. This is the default value. If there is a field in the data file
named ‘FolderName’ the value from that field will be used to determine which folder the record and
image is added to.
<DefaultMakeBarCode>[1/0]</DefaultMakeBarCode> This option tells the system to create a
barcode cover page or label by default. If the data file has a field named ‘MakeBarCode’ the value
from that field will be used instead. The field, if defined, should contain a value that evaluates to a
Boolean true or false such as 1 or 0, or ‘True’ or ‘False’.
<DefaultReprint>0</DefaultReprint> This option tells the system to reprint a barcode cover page or
label by default. If the data file has a field named ‘Reprint’ the value from that field will be used
instead. The field, if defined, should contain a value that evaluates to a Boolean true or false such as
1 or 0, or ‘True’ or ‘False’.
If the reprint option is specified the system will not add any records to DMS. It will instead try to find
an existing record using the data from the data file. If it finds a record it will output a barcode cover
page that can be used to attach documents to the record.
<DefaultLaunchWorkFlow>0</DefaultLaunchWorkFlow> This option tells the system to launch
any associated workflows for the folder by default. If the data file has a field named
LaunchWorkFlow, the value from that field will be used instead. The field, if defined, should contain
a value that evaluates to a Boolean true or false such as 1 or 0, or ‘True’ or ‘False’.
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 6
<DefaultImageExtension>[file extension]</DefaultImageExtension>
This option can be used when adding records and importing images. If the file extension is not
specified in the ‘FilePath’ field this default extension will be applied.
Printers
<Printers>
<Printer>
<PrinterName>[name of printer as seen in windows printer list]</PrinterName>
<FolderName>[DMS folder name]</FolderName>
</Printer>
…
</Printers>
The Printers section of the Config file is used to define which printer will be used when printing
barcode cover pages.
The Printers section contains one or more printer blocks. Each printer block contains a PrinterName
tag and a FolderName tag.
This gives you the option to have different printers used for output depending on which folder a record
is being imported into.
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 7
Mapped Fields
<MappedFields>
<MappedField>
<ADOFieldName>[name of field in data file]</ADOFieldName>
<DMSFieldName>[name of field in DMS]</DMSFieldName>
<FieldPurpose>[Update/Lookup/Both]</FieldPurpose>
</MappedField>
…
</MappedFields>
The Mapped Fields section is where you tell the program how to import the field data. For each field
that you wish to import data from, add a MappedField block. In the mapped field block are tags that
define the name of the field in the data file <ADOFieldName>, the name of the field in DMS
<DMSFieldName>, and how to use the field <FieldPurpose>. The values for <FieldPurpose> can be
Update, Lookup, or Both.

Update means the data from the field in the data file will be used to update the field value in
DMS.

Lookup means the data from the field in the data file will be used to query for an existing
record in DMS.

Both means the data from the field in the data file will be used to first query for an existing
record and then also used to update a field in DMS. This can be used in cases where you want
to look for an existing record first, update it if found, or create a new record if not found.
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 8
Static Fields
<StaticFields>
<StaticField>
<DMSFieldName>[DMS Field Name]</DMSFieldName>
<FieldValue>[Value to update DMS Field Name with]</FieldValue>
<FieldPurpose>[Update/Lookup/Both]</FieldPurpose>
</StaticField>
…
</StaticFields>
In the Static Fields section you can define field values to update in DMS that are not part of the data
file. The entries in this section work almost the same as the entries in the Mapped Fields section,
except that instead of specifying an ADOFieldName entry you specify a FieldValue entry. The
FieldPurpose entry works the same way as in the Mapped Field.
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 9
Using a Schema.Ini file
When importing CSV, TAB, and TXT files it’s recommended that you create a Schema.ini file and
place it in the folder which contains the data file.
A Schema file is essentially an outline used to define the data structure and format of each column in
a flat text data file. The schema information file must always be named schema.ini.
The first entry in the Schema.ini file must be the name of the corresponding text source file, enclosed
in square brackets.
A Format option is used to specify the format of the text file. In a CSV file, for instance, you would
use the Format statement Format=CSVDelimited.
If the field names of the data items are specified in the first row of the data file, the entry
ColNameHeader=True should also be included.
Here’s the link to the schema.ini specification from Microsoft:
http://msdn.microsoft.com/en-us/library/ms709353(v=vs.85).aspx
If that link is no longer valid, search for schema.ini in a search engine - you should be able to find the
appropriate documentation.
Here’s a sample data file and the associated schema file that you should use.
Data file is a CSV file named invoices.csv in the following format:
“InvoiceNumber”,”InvoiceAmount”,”InvoiceDate”,”VendorNumber”,”VendorName”
“1001”,”124.32”,”3/15/2010”,”34556”,”Fixit Inc.”
“1132”,”99.32”,”5/15/2010”,”45533”,”Copier Services Inc.”
The Schema.ini files might look like this:
[invoices.csv]
Format=CSVDelimited
ColNameHeader=True
Col1=InvoiceNumber Text
Col2=InvoiceAmount Currency
Col3=InvoiceDate DateTime
Col4=VendorNumber Text
Col5=VendorName Text
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 10
You can have a single schema.ini file that contains definitions for many different data files. Just
create a section in the schema.ini file with the name of the data file in brackets, as in
[datafilename], and the options and field definitions below it.
Logging
The LVDMSRecordImport program writes to log files in a folder named LVDMSRecordImportLogs.
This folder is located in the folder where the exe file resides.
In this folder there is a log file for each day that the program performed an action. The files are
named. YYMMDD.LOG as in 150315.LOG for 03/15/2015. The program automatically deletes log
files older than 30 days.
Copyright 2015 Electronic Storage Corporation • 918-664-7276 • 800-444-6283 • www.laservault.com • [email protected]
Page 11