Help Home      Return to FileHold.Com

FileHold Automatic Filing (Auto-filing) - FAQ


NOTE: The FileHold Auto-filing features is available in systems running FileHold '08 or greater.

 


The Auto-Filing Script - What is it? what does it do?

The act of filing a document in an appropriate folder where it can be easily found at a later date is a laborious and error prone process especially when dealing with large volumes of documents being continuously imported en-masse from a document scanner or 3rd party application. With FileHolds auto-filing feature enabled FileHold can automatically derive the location for where a document should be stored (the folder) based on the metadata assigned to the document and an algorithm built into an auto-filing script. If - based on the metadata associated with the file - an appropriate folder can be found then the file will be added to the folder. If an appropriate folder (or entire path for that matter) cannot be found the folder path and folder is automatically created by the auto-filing script and the document is filed. The result is a fully automated and highly accurate method of filing documents generated from scan stations or third party applications.

The creation of an auto-filing script requires either the assistance of a beginner to intermediate level developer or the assistance of FileHold professional services. Once created, the auto-filing scripts can be associated with any number of pre-defined import events by the Library Administrator. For a complete review of where and how to set-up and and configure import events using the FileHold Desktop Application please watch the scanning tutorial video series in particular the 4th video of the series entitled Configuring FileScan.

Auto-filing components will vary based on the filing needs of the company, the kind of documents being imported and the metadata captured with each file as they are being imported. This FAQ acts as a resource providing developers with the tools and information they need to create auto-filing scripts on behalf of their organization.

 

How do the scripts work with the Manage Imports feature of the FileHold Desktop Application?

There are 3 main pieces to the puzzle which are all tied together with the manage with the Manage Imports feature of the FileHold Desktop Application. First is the a) the meta-data xml file which is created by QuickScan Pro (or other scanning systems) as a result of scanning efforts. This file typically resides on the scan station. Second is the b) the auto-filing.DLL that you compile once and store on the FileHold server. This is used to identify the cabinet> Drawer > Category > folder where the document to be imported should be stored file based on the metadata associated with the file as provided by the meta-data.xml file. This DLL references the c) AutoFilingMembership.XML file to determine which users / groups should be added as members to cabinets and folders in the event that the appropriate folder path does not exist and the DLL will have to create a new cabinet or folder. We put the memberships in this AutoFilingMembership.XML file so that they can be easily adjusted without having to re-compile the DLL.

The manage imports feature ties all 3 files together by allowing you to directly associate which meta-data.xml output file from quickscan pro will be associated with which auto-filing.dll when importing documents. See the video 4 in the scanning video series at http://www.filehold.com/help/tutorial/preparing-for-scanning.htm to learn how to make this association. The auto-filing.DLL will automatically references the AutoFilingMembership.XML for memberships at import time. It does this by opening up the AutoFilingMembership.XML file and searching for where the <name> field is the same as the DLL file name. It then uses the cabinets and folder members associated with its name. With your 7.2 deployment you should have an auto-filing DLL called <Name>SchemaName-Date-Based</Name> that will reference this section of the XML file above to derive its cabinet and folder memberships.


Sample Auto-filing Scripts with Source Code

Two sample auto-filing scripts are delivered with the FileHold '08.2 server installer (SchemaName-Date-Based.dll and Date-Based.dll). They implement the methodology described above. Membership data is taken from AutofilingMembership.xml which must be located in the same folder.

Use the following link to download the Sample Auto-filing Scripts and Source Code

Visual Studio 2005 projects with source files are provided for the sample auto-filing scripts included in this package. A sample AutofilingMembership.xml file is also included. To use, simply open the respective project file in Visual Studio 2005 and build.

 

The Auto-Filing Component - A look at the Auto-Filing .DLL

Auto-filing script is a .dll library file which contains a class with the following structure:

namespace FileHold.AutoFilingScripts

{
public class DestinationGenerator
{

//initialize the generator
public void Initialize( object autoFilingManager, string
schemaName, string documentName, string userDisplayName, string[ ] fieldNames, object[ ] values );

//generates names of the objects based on data supplied //during initialization
public void EvaluateObjectNames();

//generates objects’ membership
public void EvaluateObjectMembership();

//Returns name of the cabinet
public string CabinetName { get; }

//Returns name of the drawer
public string DrawerName { get; }

//Returns name of the folder group
public string FolderGroupName { get; }

//Returns name of the folder
public string FolderName { get; }

//Returns list of guids of cabinet members
public Guid[ ] CabinetMembers { get;

//Returns list of guids of folder members
public Guid[ ] FolderMembers { get; }
}
}

 

 

Where is the Compiled Auto-Filing Script Stored?

Auto-filing scripts (essentially .dll library files) should have some meaningful names and must be located in the ‘AutoFiling’ folder in the LibraryManager location (typically - inetpub\wwwroot\FH\FileHold\LibraryManager) on the FileHold '08 application server. When needed, they are dynamically loaded by AutoFilingManager service and generate names of all library objects in the library path and a list of members for cabinets and folders.


What Happens when Adding a Document With Auto Filing?

During the process of adding documents with auto-filing a special method AddDocumentWithAutoFiling from DocumentManger service (which is a part of LibraryManager) is invoked with the script name being one of its parameters.

If the location calculated by the auto-filing script does not exist it will be created by AddDocumentWithAutoFiling method therefore the user launching the QSP Importation process must be eligible to create all necessary library objects. Created cabinets and folders have current user set as an owner and the schema associated with the document set as a default cabinet schema. Membership of these objects is created based on GUID lists retrieved from the script.

 

How can I Assign Cabinet & Folder Memberships when a New Folder Path is Created?

As the auto-filing script goes through its process of deriving the an appropriate location to store each file there are 2 possible outcomes. If the appropriate folder exists the auto-filing script will simply route the file directly to the folder. However if the folder (or path) does not exist then the path will be automatically created (down to the folder level) and the document will be filed in it. For the auto-filing script to be able to create a full folder path it will need to assign the appropriate security rights (membership) of users / groups to the Cabinet and Folder in this path. This will ensure that once the path is created the appropriate rights to be able to access the imported document will be automatically given to the correct users or groups of users.

In order to add members to every cabinet / folder which will be created by the auto-filing mechanism the auto-filing script must implement a method EvaluateObjectMembership, which should calculate and assign membership based on data supplied during the initialization process. Cabinet and Folder membership is available through CabinetMembers and FolderMembers properties respectively.

It is also possible to define membership using an XML file. A sample XML called AutoFilingMemberhip.xml file is included in the source code package. By using a XML file this will allow the membership to be adjusted after the system is deployed by a non-developer without the need for re-compiling the auto-filing DLL

The sample XML Membership file structure is as follows:

<?xml version="1.0" encoding="utf-8"?>

<AutoFilingScripts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<AutoFilingScript>
<Name>Name_Of_The_Script</Name>
<Cabinet>
<!--Here you can put a description of a member-->
<Member>Guid of a member in format dddddddd-dddd-dddd-dddd-dddddddddddd</Member>
...
</Cabinet>
<Folder>
<!--Here you can put a description of a member-->
<Member>Guid of a member in format dddddddd-dddd-dddd-dddd-dddddddddddd</Member>
...
</Folder>
</AutoFilingScript>

</AutoFilingScripts>

Two equivalent forms of inserting comments depicting members (users/groups) into the xml file in plain text are:

<!--UserName: John Bull-->
<Member>f9ff399e5378112e-0f39-4176-88e9-8d064b08ec2c</Member>

OR

<Member UserName="John Bull">5378112e-0f39-4176-88e9-8d064b08ec2c</Member>

The EvaluateObjectMembership method would need to perform the following actions:
1. Read content of the xml file.
2. Get AutoFilingScript xml node related to your script (based on the Name tag).
3. Retrieve cabinet and folder member GUIDs and store them for example in private variables.

The CabinetMembers and FolderMembers properties should be used to return lists of members’ GUIDs retrieved in previous steps.

GUIDS for users/groups stored in FileHold are located in the FileHold ADAM instance. Because retrieving object GUIDs from the FileHold ADAM instance is not a trivial task a special utility ADAMTest is provided. It is installed on the Sever by the FileHold '08 Installer/Updater and could be used to retrieve and list GUIDs representing FileHold objects (Users and Groups) from ADAM in a suitable format. These GUIDs could then be cut and paste into the XML Membership file (AutofilingMembership.xml).

Related Links