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:
- Append the date and time down to the second to the specified filename or not.
- Automatically overwrite an existing output file with the same name or not.
- 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
- Download and unzip the Export Metadata tool on the computer that requires to export the metadata information (see bottom of page for downloads). The MetadataExporter.zip file contains the following files:
- ExportMetadata.dll – The plug-in file that allows the exporting of metadata.
- ExportMetadataConfig.xml – The file which contains the configuration for the export.
- Copy both files to where the FDA was installed. This is typically in Microsoft Windows C:\Program Files (x86)\FileHold\FDA\
- In the same folder location, locate the FDA.exe.config file and open it for editing in Notepad or similar application.
- Under the <plugIns> section, enter the following:
<plugIn>C:\Program Files (x86)\FileHold\FDA\ExportMetadata.dll</plugIn>
- Locate the ExportMetadataConfig.xml file and open it for editing in Notepad or similar application.
- Enter the <PlugInName> tag to include the name you want to see on the Send to menu.
- 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.
- 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. 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 passed as the only command line option. 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.
- It is possible to set the field replacement tag names differently than their source names inside FileHold. For example, instead of the tag name "DocumentName" you could change the document name tag to "DocName". Changing tag names is optional. Configure the following values between the <SystemFieldNames> tags. All metadata fields on the document schema are available as field replacement tags. For example, to output the metadata field called “Invoice No”, the tag <InvoiceNo>Invoice No</InvoiceNo> is added to the list of <SystemFieldNames> tags. In addition to the metadata fields, the following system fields are also available. All are required in the XML file, even if there are no values to include.
- 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 FileHold ID number.
- DocumentSchemaId - The name of the 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.
- Save the configuration file.
- Ensure the template file specified above in the <TemplatePath> field is in the correct folder location.
- 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.
- 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"?> <ExportMetadataConfiguration> <PlugInName>Export_Metadata</PlugInName> <TemplateFile> <TemplatePath>C:\Labelprinter\Print_Label_Barcode.csv</TemplatePath> <TagStartCharacters>&</TagStartCharacters> <TagEndCharacters>&</TagEndCharacters> </TemplateFile> <OutputFile> <FilePath>C:\Labels</FilePath> <Filename>Label_name.csv</Filename> <SeparatorBetweenFieldValues>|</SeparatorBetweenFieldValues> <WaitForDeletion>True</WaitForDeletion> <AppendDateAndTime>True</AppendDateAndTime> <DateTimeFormatForFileName>yyyyMMddHHmmss</DateTimeFormatForFileName> <PostProcessCommand>notepad.exe</PostProcessCommand> </OutputFile> <SystemFieldNames> <Version>Version</Version> <Owner>Owner</Owner> <DocumentId>FileHoldId</DocumentId> <DocumentSchemaId>DocumentSchemaId</DocumentSchemaId> <DocumentName>DocumentName</DocumentName> <DocumentControlNumber></DocumentControlNumber> <VersionControlNumber></VersionControlNumber> <OutputFilename>Output File Name</OutputFilename> <NoMatchingField>:no matching field.</NoMatchingField> <LastName>Last Name</LastName> <DepartmentalList>Departmental List</DepartmentalList> </SystemFieldNames> </ExportMetadataConfiguration>
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: