Once docXporter is installed, it can be configured. Note that docXporter does not include a UI-based configuration tool. Instead, all configurations are managed through individual XML files, which can be edited using any text editor..
We recommend to use an editor like Notepad++ or Visual Studio Code to edit the configuration files. The editor supplied with Windows (Notepad.exe) has already caused configuration files to become unusable in the past.
During the setup of docXporter, the default configuration file defaultconfig.xml is installed in the folder C:\ProgramData\docXporter\.
Use this configuration file as a template for other configuration files. Any number of configurations can be created by copying an existing file and renaming it according to its task. For example, if you need an export specifically for invoices, the name invoices.xml is a good choice. Configurations can be executed all or specifically (see chapter “Execute an export”)
For basic settings, it is sufficient to change the value between the XML tags. Go to General parameters in the table below to check.
Settings such as search parameters in the file cabinet or updating index terms follow a specific structure:
The
Item
line is duplicated for each entryName
contains the database name of the fieldValue
the value
Example
<Object Name="DWArchivFilter" Type="Docuscan.DocuwareExporter.Configuration.FieldMapping">
<Item Name="COMPANY" Value="Berger Stahlgroßhandel GmbH" />
<Item Name="STATUS" Value="Export" />
</Object>
Special characters like &, < or >, as well as language specific characters like ä, ö or ñ can cause issues if used in clear text within XML-files. If your configuration requires the usage of those characters, please expand the following section for further information.
Additional information about how to handle special characters in XML-files
As the syntax used in an XML file has reserved some characters, these must be rewritten in order to save them in the file. The following table shows the most common characters that need to be rewritten. Problems occur particularly frequently because the ampersand character is not rewritten.
Characters | To be replaced by |
---|---|
& |
|
< |
|
> |
|
Classic examples are DocuWare organization names for company forms such as GmbH & Co KG or when SQL queries with greater than/less than conditions.
Problems can also occur if characters outside the ASCII character space are used. Examples of this are é, à etc.
Such characters must also be replaced by corresponding substitute characters. An Internet search for “Unicode character table” brings up the following page, for example https://www.utf8-zeichentabelle.de/unicode-utf8-table.pl?names=-&unicodeinhtml=hex
According to this, for example, the character é is replaced by é
or à by à
. It is of course also possible to use the respective hexadecimal notation.
Parameters in the configuration file
General
DWServiceUrl
URL to DocuWare Platform Services
Example: https://DOCUWARESERVER/DocuWare/Platform
Replace the DOCUWARESERVER value with the same server name as for the DocuWare Web Client
DWUser
User name of the DocuWare user which the application uses to log on to DocuWare.
If this parameter is left blank, the application attempts to log in via Windows authentication with the user with whom the application was started.
DWPassword
Password of the DocuWare user which the application uses to log on to DocuWare.
Password must be encrypted via the provided EncryptionTool. You will find a shortcut within the configuration files folder.
DWOrganization
The DocuWare organization to which the application is registered.
DWArchivGuid
GUID of the DocuWare file cabinet from which the documents are exported. The GUID can be found in the DocuWare Configuration in the general settings of the file cabinet.
DWSearchDialogGuid
GUID of the search dialog that is used to compile the documents for export. The GUID can be found in the DocuWare configuration in the file cabinet dialogs.
Stamps
Documents can be stamped before or after export.
EnableStamps
Activate or deactivate the option to place the stamp on the exported document.
Valid values are True = active, False = not active.
Note further information about stamps below.
StampBeforeExport
This switch is ignored if EnableStamps has the value False.
Decide whether
the stamp is set before the document is exported and is therefore included in the exported documents (if annotations are to be exported via the ExportMode)
or after the document has been exported.
Valid values are
True = Stamp before export
False = Stamp after export
StampLayer
Designates the annotation level where the stamp is applied. By default, this setting has the value 1.
StampPosX
Position in pixels, starting at the left edge of the document, where the stamp is placed.
For automatic positioning of the stamp, -1 must be entered here.
StampPosY
Position in pixels, starting at the top of the document, where the stamp is placed.
For automatic positioning of the stamp, -1 must be entered here.
DWStampName
Name of the stamp that is applied to the document during export.
Search
docXporter supports two variants to search for documents. The recommended way is to use SearchMode DocuWare
. For very special use cases in Docuware on-premises you can use SearchMode SQL
.
SearchMode
Valid values are DocuWare
and SQL
.
A normal search is performed in the DocuWare file cabinet. Parameters that are valid when searching in DocuWare (e.g. NOT, OR or EMPTY() ) can be used when searching in text fields.
The search via DocuWare returns a maximum of 10,000 results.
To use this search mode, following parameters have to be configured:
DWSearchDialogGuid
GUID of the search dialog that is used to compile the documents for export. The GUID can be found in the DocuWare configuration in the file cabinet dialogs.
DWArchivFilter
Filter criteria according to which the documents to be exported are selected. The general syntax of the settings looks like this. For each DocuWare field another item-row needs to be added.
<Object Name="DWArchivFilter" Type="Docuscan.DocuwareExporter.Configuration.FieldMapping">
<Item Name="COMPANY" Value="Peter Engineering" />
<Item Name="STATUS" Value="Export" />
</Object>
The value of the name attribute corresponds to the database name of the DocuWare field in capital letters (look in DocuWare Configuration in properties of the respective field).
Sometimes special chars like have been used in field creation. Enter those also, here, e.g Name=”COMPANY”
The value attribute can either be a fixed value, the part of a fixed value with * as a wildcard or a variable known from DocuWare such as EMPTY() or NOTEMPTY(). The input options correspond to the general search dialog in DocuWare Configuration, e.g. for file cabinet filters.
For more sophisticated search operations please refer the article about Advanced Search Filters.
Alternative search in a Sql database for on-premise systems
This search is only required for special cases, e.g. if the expected number of results exceeds 10,000 documents or if a comparison with another database is required.
To use this search mode, following parameters have to be configured
SqlConnectionString
A SQL connection string to the database used. In most cases, this is the DocuWare database. Various examples of connection strings can be found e.g. at https://connectionstrings.com
docXporter only supports Microsoft Sql Server databases.
SqlSearchQuery
The select statement as a sql query to determine the documents to be exported. The query must contain the DWDOCID field. Furthermore, an explicit specification of all fields required for the file name and folder name is required.
Export
docXporter supports different options how to export documents from DocuWare. This is defined by the setting ExportMode
ExportMode
Specify the format in which documents will be saved in the file system after export. Take into account upper and lower case.
Disabled | Deactivates the document export. Note: Enables to export index data only (see IndexFileMode) |
Export as PDF | |
PdfWithAnnotations | Export as PDF with annotations. Corresponds to merging the annotations |
Tiff | Export as Tiff, see below for more settings |
TiffWithAnnotations | Export as Tiff with annotations. Corresponds to merging the annotations |
OriginalFormat | Export document in original format. A clipped document is exported as multiple files and and index is attached to the file name. |
OriginalFormatZipped | Export in orignal format bundled in a zip file |
ExportCoverage
Define which part of the document is to be exported.
All | Default. Export of entire document |
FirstSection | Export of first section only |
LastSection | Export of last section only |
SectionIndex | Export of sections with index only – such as defined in setting SectionIndex. All documents to be exported require a sections with this index. |
SectionIndex
The index of the section to be exported. For this setting to be used, the value must be set to SectionIndex in the ExportCoverage setting.
ExportPath
Defines the folder to which the documents are to be exported. Example: C:\Export\
(UNC path is possible). If the folder does not exist, it is created. Index values of the document can also be used here by specifying the field name in curly brackets, e.g. {COMPANY}
. As with the other settings, the field name is specified according to the database name of the DocuWare field.
Example: C:\Export\{COMPANY}\
The ExportPath may also contain parts of a DocuWare date field, for example the month or year. After specifying the field name, the .net-compliant date formatting is specified with a colon, e.g. {DATE:MMMM}
for the full month name, or {DATE:yy}
for a two-digit year.
If both month and year are used in an export path, the information is entered in one.
Example: C:\Export\{DATE:yyyy}\{DATE:MMMM}\{COMPANY}\
Result: C:\Export\2021\January\Peters Engineering\
FileName
Defines the structure of the file name of the exported file. Both fixed values and index values of the document can be used for this. In the case of index values, the field name is specified in curly brackets, e.g. {COMPANY} or {DWDOCID}. As with the other settings, the field name is specified according to the database name of the DocuWare field. The files are exported as PDF files by default.
Use a unique file name to prevent accidental overwriting. Under certain circumstances, different documents can be given the same file name during export, namely if both documents contain the same value in the index fields from which the file name is built. In this case, the document that has already been exported will be overwritten.
This applies in particular to the MergedPdf export target.
TiffCompression
Specify the compression for saving the Tiff files. Influence the quality and file size. The following values are available:
JPEG: Recommended for color documents and documents with greyscale
CcittGroup4: Recommended for black and white documents
TiffResolution
Specify the resolution of the Tiff. The higher the value, the better the quality may be, but the file size will potentially increase with high values.
After the export of a document has been completed the document’s index data should be updated to avoid to export them again.
DWArchivUpdateIndex
Contains the index values that are to be changed after the export to exclude exported documents from the export filter. The configuration works basically the same as for DWArchivFilter.
The general syntax of the DWArchivUpdateIndex Setting looks like this. For each DocuWare field another Item row needs to be added.
<Object Name="DWArchivUpdateIndex" Type="Docuscan.DocuwareExporter.Configuration.FieldMapping">
<Item Name="STATUS" Value="Exported" />
</Object>
The value of the name attribute corresponds to the database name of the DocuWare field in capital letters (can be found in DocuWare Configuration of the field properties of the respective field). Sometimes these also contain if special characters were used when creating the field. These must also be entered, for example: Name=”COMPANY”
Example: <Item Name=“EXPORTED_” Value=“done” />
. Value is either a fixed value or a relative date such as DATE(-1)
for the date of the previous day.
Index files
If documents are exported, you may create additional files with the index data of the documents. Please refer the detailed article about index files how to create templates.
IndexFileMode
Controls whether an index file is to be created for a document and how it is created. Upper/lower case must be observed.
Disabled | Do not create an index file |
Document | Create one index file per document |
ResultSet | Create an index file containing the index data for all exported documents. |
IndexFileNamePattern
Defines the structure of the file name of the exported file. Both fixed values and index values of the document can be used for this. In contrast to the FileName setting (see above), the file extension must be specified here.
TemplateFile
The path to the template file. If only the file name is specified, the template is searched for in the folder C:\ProgramData\docXporter\Templates. If a path is specified, this is used directly.
Obsolete Legacy Settings
You may find the settings IndexFileDocumentTemplate and IndexFileRepetitionTemplate in the configuration file. This setting is included to maintain compatibility and should no longer be used. Use a template for index files instead.
Bundle documents in a ZIP or merged PDF
In addition to exporting documents to a folder in the file system, documents can also be exported to ZIP file(s). Depending on requirements, the documents can also be distributed across several files.
ExportTarget
Controls whether the export is made to a ZIP file or a file system folder.
Folder | Export to the ExportPath folder |
ZipFile | The exported documents are packed into ZIP file(s), which are then saved in the ExportPath folder. |
MergedPdf | The exported documents are bundled in a single PDF file, which is saved in the ExportPath folder. The ExportMode is automatically set to Pdf if an ExportMode other than Pdf or PdfWithAnnotations is set. |
GroupFileNamePattern
Specify the pattern from which the file name for the output file is to be created here.
It is not necessary to specify the file extension here as this is assigned automatically. Depending on which export target was selected, the extension is .zip or .pdf
The files are provided in the folder as specified in the ExportPath setting.
When creating a zip file, the structure of the document file names within the zip file is defined via the FileName setting.
Example: {CUSTOMER_NUMBER}
GroupPath
In order to group the documents, this setting is used to create a grouping from one or more index terms.
The value defined here is appended to the internally generated temp path in order to pack the respective documents into the intended ZIP files when the export is completed or to generate a merge PDF from these files.
Example: {COMPANY}\{CUSTOMER_NUMBER}
following this example, ZIP files are created that contain documents with the same value in the COMPANY
and CUSTOMER_NUMBER
index fields.
Stamps
If the stamp contains fields that have the same name (label) as the database field names of the index fields of the document on which the stamp is to be applied, these fields are automatically filled with the index values of the corresponding index field.
To use the DocuWare Document ID in a stamp, use the label DWDOCID for the stamp field.
Run a configuration
Once the application has been fully configured, the application can be started.
To do so, just run docXporter.exe. If it is executed without further parameters, all configuration files are processed.
If you do not want to process a specific configuration, you can either delete or rename it. Simply assign a different file extension of your choice, for example:
invoices.xml.disable
It does not matter which extension you use for this. It just must not be ".xml".
If the call is made with parameter docXporter.exe -c "Configuration name"
, then only the corresponding configuration is processed. The configuration name is the same as the filename of configuration file without its extension.
The application documents the individual processing steps as output in the console window and into a log file. It can be helpful to take a close look at the program output, especially during the initial tests.
To automate the processing or execution, the docXporter.exe can be executed via the "Scheduled Tasks" of Windows according to the possibilities there at different times or events.
Advanced command line parameters
docXporter can also be called with command line parameters. Here you can define alternative search criteria, search in different archives or set index values to a different value.
This feature becomes handy in situations where you want to call docXporter from 3rd party applications and want to dynamically set which documents should be selected.
-help | Calls the help page and does not perform any processing. |
-q “FELDNAME=value” | An additional search term that supplements or replaces the values from the configuration file. |
-u “FELDNAME=value” | An additional index update that supplements or replaces the values from the configuration file. |
-fc GUID | The GUID of an archive can be specified here. Replaces the setting of the configuration file. |
-sd GUID | The GUID of a search mask can be specified here. Replaces the setting of the configuration file. |
Parameters -q and -u allow to specify multiple fields and values. These are separated by the hashtag character #
.
Example: -q “CUSTOMER=Peters Engineering#STATUS=New”
Example Use Case
DocXporter is used to export all invoices for the current quarter that have not yet been exported.
This is specified in the configuration file:
<setting name="DWArchivFilter" serializeas="Xml">
<value>
<arrayofstring xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<string>DOCUMENT_DATE=SEARCH_QUARTER()</string>
<string>DOCUMENT_TYPE=Invoice</string>
<string>STATUS=NOT Exported</string>
</arrayofstring>
</value>
</setting>
Now, instead of the invoices, the credit notes of the current quarter are to be exported, where the customer is “Peters Engineering”. In addition, the Status field should be set to “Exported”.
The following parameters are specified:
DocXporter.exe -q “DOCUMENT_TYPE=Invoice#CUSTOMER=Peters Engineering” -u “STATUS=Exported”
As DOCMENT_DATE has already been set correctly in the configuration, it does not need to be specified again.
Logging
All program activities can be documented in a log file. The log directory is located under C:\ProgramData\docXporter\Logs. By default, one log file is created per day and 30 files are stored. As soon as the number of these historical log files is reached, the oldest file is deleted.
In addition, initially only information and errors are logged. If more details are required - e.g. during the test phase - the logging can be increased to DEBUG.
The level of detail for logging is also set in docXporter.exe.config. Search for the block here and change the text INFO to DEBUG:
<root>
<level value="INFO" />
</root>