This function may be used to automatically generate a subfolder structure for your archived documents, resulting in a more manageable number of files in each folder. It also provides the ability to convert DBR report files to PDF’s.
This starter function was originally developed to implement archiving for installations that didn't archive from the beginning of SAMPro This process attempts to bring the document management data up-to-date based on current archiving technology as follows:
1. Archives any source documents (and their children) not already archived.
2. Creates a .pdf if the original file is missing but a .xml file with the same base name exists in the directory.
3. Updates the Archive File Location and File Type columns in dcmnt records. These fields are visible in the parent form of the Document records viewer.
4. The results are written to a log file, sampro_DocumentLog.txt, in the directory containing the SAM Pro executable. This file may be launched from SAM Pro.
5. Evaluates document records where the Archive File Location and File type fields are not set, and updates their appropriate if the archive file itself exists. This will enable the Create PDF button to successfully find these documents.
It may take some time for this function to process a large numbers of documents; a Progress Indicator window is displayed while it is running.
See Start Document Archive Maintenance (Automated) for information on running an automated version of this function as a Scheduled Event.
1. Before running this function, check the available disk space of the drive on which you are archiving.
2. This function is NOT available without the appropriate sys-document-archive registry settings.
3. This function can't archive documents unless SAMPro can find the original source document.
4. If documents (such as scanned files) were saved to user’s local directories, this function must be run FROM THAT USER’S TERMINAL to ensure that they are included in the maintenance.
See Registry Start Document Archive Maintenance for details on setting defaults for this function and to specify a 'processed' folder if the Move Original Documents option is selected.
This function is front-ended with a range screen that will enable the user to filter the documents being maintained – especially on subsequent runnings of this function.
Show Details?
If this box is checked, the results of the maintenance will be written to a log file as well as to the document log table. Note that only ‘successes’ will be written to the Document Log.
Force Archive?
When this option is enabled, this function ignores the presence of a value in dcmnt.dcmnt_fle_lctn_archve and copies the original source document (if available) over top of the previously archived file. This option would be used to help recover archived files if, for example, the machine they resided on was infected by a virus, resulting in the files being corrupted.
Move to Subfolders?
This option can be used to automatically generate a subfolder structure for your archived documents, resulting in a more manageable number of files in each folder. Documents will be processed beginning with the most recently saved documents which have not yet been moved to a Subfolder.
Checking this option instructs the Start Document Archive Maintenance function to automatically create subfolders (based on the month and year the document was archived e.g, 2012-06) and then move the archived files from the main document archive folder to the subfolder.
Convert DBR to PDF?
The Convert DBR to PDF option will convert your archived reports from the proprietary DBR format to PDF’s. DBR files are not supported in the new DBAnalytics-based web functionality; this option provides a simple way of managing the conversion to PDF’s. Documents will be processed beginning with the most recently saved DBR documents (documents with the greatest Rn) which have not yet been converted to PDF format. When this option is enabled, a copy of the converted DBR files will be placed in the auto-created ConvertedDBRs folder (within the main archive folder). This function puts convertedDBRs in the root of the document\archive\convertedDBRs with subfoldering (YYYY-MM) if UseSubdirectories is enabled in the sys-document-archives registry The function will use the DBR's files internal bitmap path to set the PDF graphics if available..
These files should be backed up/deleted on a regular basis.
Maximum Number of Documents to Process:
This required field controls the number of documents that will be processed when this function is run. When using the Move to Subfolders or Convert DBR to PDF for the first time, we recommend limiting the number of files to 5000 and checking the time required to process them.
Days Past to Check PDF Archives:
This field controls a phase of this function which looks for documents which failed to be converted from XML to PDF's; if any are found, the system will convert them to PDF's.
When this function is run, the system subtracts the NumberOfPastDaysToCheckPDFArchives in the registry from today's date to check all documents created after that date; if the archive file is a PDF file then it checks if it exists. If it doesn't then it checks if there is an XML document for that archive, and if there is it converts it to the PDF Archive.
By default, this field is set to 7: documents created within the last 7 days will be checked to see if they need to be converted to PDF's. If this field is set to 0, no Documents will be checked to set if they are XML files which need to be converted to PDF. A registry is available to set the default value of the Days Past to Check PDF Archives field to be adjusted.
Date Logged:
To limit the maintenance to documents created on a specific date or range of dates, complete this range. For example, to run the maintenance for documents created in January of 2011, you would enter 2011-01-01_2011-01-31.
Document Id
This range would be completed if only a few Documents needed to be re-archived.
Category
This range enables you to limit the maintenance to specific document cartegories.
Function Id:
This field enables you to limit the maintenance to documents created by specific functions (e.g., rpofrm for generating printed purchase orders).
File Type
This range enables you to limit the maintenance to specific file types (e.g., dbr, pdf, jpg).
Logged By:
Enter the user's Id to process only those documents they logged by them. Filter this function to multiple users by specifying a comma-separated list of Id's.
File Location:
To limit this function to a specific folder or file, enter the completed path (including the filename) to the original file.