Metadata exporter tool

The flexible FileHold architecture allows new functionality to be added via our plug-in technology option. The metadata exporter tool is one such plug-in that can be used to export metadata and version properties information to a text file. This file can be used for preparing data to import in to another application such as a dedicated label printer, or similar uses.

Contact [email protected] to purchase this plug-in. The FileHold license requires "Allow FDA Plugins" enabled to use this plug-in.

The plug-in is used in conjunction with the FileHold Desktop Application (FDA) where a user can right-click on a file and select Send to > Export Metadata. This menu option name can be changed as needed. For example, "Print labels". Choosing the option will create the output file and optionally execute user defined post processing.

A configuration file (ExportMetadataConfig.xml) is used to configure the information that is to be exported such as the output filename and location, and the matching metadata or version properties values.

A template file is used in conjunction with the configuration file. The template file contains a combination of text that will be copied verbatim to the output as well as field replacement tags. This template file could be anything – a printer template file, a csv template file, or anything that defines the format of how you want the information outputted. For the template file, start and end tag characters are used to define the values that are exported. For example, if you want the document name exported and the start and end tags are the ampersand (&) character:

The document name is &DocumentName&

The output filename and path is also specified in the configuration file. There are three options for output file naming and handling:

  1. Append the date and time down to the second to the specified filename or not.
  2. Automatically overwrite an existing output file with the same name or not.
  3. Wait for an existing output file to be deleted or not.

Options 2 and 3 are exclusive of one another. If the configuration is not set to automatically overwrite the output file the user will be prompted to overwrite or cancel. If the configuration is set to wait the user will be shown a dialog with the option to cancel.

To configure the metadata exporter tool

  1. Download and unzip the Export Metadata tool on the computer that requires to export the metadata information (see bottom of page for downloads). The file contains a number of files including the following two necessary files:
  • ExportMetadata.dll – The plug-in file that allows the exporting of metadata.
  • ExportMetadataConfig.xml – The file which contains a sample configuration for the plug-in.
  1. Unblock the DLL file if needed. Right-click > Properties > Unblock.
  2. Copy both files to where the FDA was installed. This is typically in Microsoft Windows C:\Program Files (x86)\FileHold\FDA\
  3. In the same folder location, locate the FDA.exe.config file and open it for editing in Notepad or similar application.

You will need to be an administrator to change files in this folder.

  1. Inside the <plugIns> section, add a <plugIn> value. For example,:

   <plugIn>C:\Program Files (x86)\FileHold\FDA\ExportMetadata.dll</plugIn>

  1. Locate the ExportMetadataConfig.xml file and open it for editing in Notepad or similar application.
  2. Enter the <PlugInName> tag to include the name you want to see on the Send to menu.
  3. Configure the following values between the <TemplateFile> tags:
  • TemplatePath – The path and filename for the template file. For example: C:\Labelprinter\Print_Label_Barcode.prn
  • TagStartCharacters and TagEndCharacters - Start and end characters for the exported metadata field values. Alternate characters can be used. This should be a character or string of characters that are not normally used in the exported information. For example, if the start is “[*” and the end is “*]” a field replacement tag for the FileHold id would appear as follows: [*FileHoldId*]. The same sequence could be used for both the start and end but is not required.
  1. Configure the following values between the <OutputFile> tags. All are required in the XML file, even if there are no values to include.
  • FilePath – The path to save the output file. For example: C:\Labels
  • FileName - The file name. For example: Label_name.txt
  • SeparatorBetweenFieldValues – The separator for multiple value dropdowns. This can be used when a metadata field value may contain multiple selected values.
  • WaitForDeletion - Set True to wait if the output file exists. This can be used for case where a prior post processing command must finish before a new one can be started. The user will see a prompt on screen giving the option to cancel their request. If this value is False the file will be immediately overwritten with the new output.
  • AppendDateAndTime - Set True to append the date and time to the text file.
  • DateTimeFormatForFileName – The date and time format to use if AppendDateAndTime is set to True. The format follows standard dot net date formatting rules. For example: yyyyMMddHHmmss
  • PostProcessCommand - Program to run after the label file has been created. This is optional. The configuration file allows for the addition of a post processing command that runs after the output file is written. If a post processing command is specified, the FDA will spawn a new process to execute a program or Windows script. The name of the output file can be passed on the command line using the OutputFilename tag. Post processing could be used to send the output file to a label printer, archive the output file after printing, open Excel, etc. The command could be a Windows script that executes many functions or includes many other parameters. The following simple example opens the output file in Excel and assumes the tags are enclosed by open brackets and asterisks.

EXCEL [*OutputFilename*]

  1. The <SystemFieldNames> group of tags make it possible to set the text to output if a metadata field is specific in a template that does not exist for the document in the NoMatchingField tag. You can also rename the system fields when used in the label template. Every value is case sensitive. All metadata fields on the document schema are available as field replacement tags, but there is no guarentee which document will be selected when the plug-in is executed. The DocumentId is the only required field in the group. All the rest will simply use default values if not specified.
  • Version - The version number of the document.
  • DocumentControlNumber - The document control number.
  • VersionControlNumber - The version control number.
  • ApprovalStatus - The approval status from a document that has gone through a workflow.
  • Owner - The owner of the document.
  • DocumentId - The internal unique ID of the document ID.
  • DocumentSchema - The name of the schema.
  • DocumentSchemaId - The internal ID of the document schema.
  • DocumentName - The document name.
  • NoMatchingField - If there is no matching metadata field the tag will be replaced with the tag name and the text defined here. For example“:no matching field”.
  • OutputFilename -The name of the file in the <FileName> tag in the <OutputFile> section.
  1. Save the configuration file.
  2. Ensure the template file specified above in the <TemplatePath> field is in the correct folder location.
  3. Start the FDA and locate the document that you want to export the metadata. Select Send to > Export Metadata.

At a minimum you must log out of the FDA before any changes you make to the configuration or template file will take effect.

  1. Open the output file to verify the correct information was exported and in the correct template format.

Example ExportMetadataConfig.xml file

	<?xml version="1.0" standalone="yes"?>
	    <PostProcessCommand>notepad.exe C:\Labels\Label_name.csv</PostProcessCommand>
            <OutputFilename>Output File Name</OutputFilename>
	    <NoMatchingField> $$$ no matching field $$$ </NoMatchingField>

Example of the template file

This file will be output to a comma delimited file (csv) where &Departmental List& and &Last Name& are metadata field values and &FileHoldID&, &DocumentName&, &Owner&, and &OutputFilename& are system values.

&FileHoldId&,&DocumentName&,&Owner&,OutputFilename&,&Departmental List&,&Last Name&

After the metadata is exported, the output csv file resembles the following:

5668,123456_Contract_Oct142019,Jane Smith,Label_name.csv,Sales,Doe

Download the file

Choose a download that matches the major and minor version of your FDA. 

FileHold 16.3
FileHold 16.2
FileHold 16.1

Contact [email protected] if you do not see your version listed.