ARCHIVE

Top  Previous  Next

Syntax

 

archive "libpath"|{expr},"doctype"|{expr} ,"docid"|{expr} [,subid subid|{expr}] [,title title|{expr}] [,notes notes|{expr}] [,keywords kws|{expr}] [,categories|cats cats|{expr}] [,link|links links] [,entityid|entid entity ID|{expr}] [,args args|{expr}] [,dtm|date yyyymmddhhmmss|{expr}] [,subtitle subtitle|{expr}] [,subdtm|subdate yyyymmddhhmmss|{expr}]                                    

 

Description

 

This command causes UnForm to add two versions of the current document to the library specified.  The first document is a PDF version formatted as the current rule set specifies, the second is the input stream text from which the PDF document was generated.  The PDF version has a default sub ID of "@unform", but this can be overridden by specifying a subid. The sub ID of the text version is "@text".

 

Note that as the formatted document is generated as a PDF, the rule set must be designed to successfully produce PDF output.  In particular, any images or attachments need to be available in PDF format, or be designed to use automatic image conversion.

 

The library, doctype, and docid elements of the archive command are evaluated as each page of the job is printed.  If they change, then a sub-job is executed using the pages to that point as input.  In this manner, a batch job with multiple documents can be archived as multiple documents rather than as a single large document.  For example, if an invoice run is processed, and the docid is derived from the invoice number, then each new invoice number during the job will produce a new document in the archive.

 

The library is a path name on the UnForm server.  If it doesn't exist, it will be created and a library pointer record will be created.  If it isn't a full path, the library is created using the full path of the "arc" directory under the UnForm server, such as "/usr/lib/unform90/arc/library".

 

An archive document is identified in a library by the document type doctype and document ID docid.  A document can also contain further information: title, notes, keywords, date and time, and categories. Further, each document can contain multiple versions identified by a subid, each of which contains a title and date and time.  See the Archiving and Document Management chapter more information about each of the archive elements.

 

If any archive command elements are not supplied, the following defaults are used:

 

The document type is set to the rule set name
The document ID is set to a unique date/time stamp
The title is set to the value of the title command, if any, or is derived from text input
Keywords are derived from unique words in the content, up to a default limit on the number of words
The date and time is set to the current date and time
Command line arguments, such as –arclib or –arcdoctype, supply remaining defaults

 

If the subid ends with an asterisk, such as "Formatted*", then UnForm will not overwrite duplicate sub ID values.  Instead, a 5-digit sequence will be added to ensure up to 99,999 versions of a document can be added.

 

If the keywords value begins with "*;", the * is replaced with auto-derived keywords based on content, so you can have both auto and custom keywords using this structure.  The keywords parameter can also be the word "all", or a number, indicating the maximum number of keywords to calculate (-1 means the same as 'all', and 0 means no keywords should be calculated).

 

Categories should be structured with vertical bars separating segments and semi-colons separating categories.  For example: "CustPO|"+custname$+"|"+custpo$ + ";" + "Salesperson|"+slspid$.  There can be any number of categories, and each category can contain up to ten segments.  A category index ends at a null segment.  The browser interface treats a null segment as a signal to display document records.  It is therefore improper to have an empty segment in the middle of a category sequence (i.e CustPO||12345).  If you have empty data and still would like to index this, replace the null with an "!", which will sort lower than any other viewable data and provide a visual indicator of missing data as well.

 

Links provide outbound linking to other documents, within or without the archive system.  This value is a semi-colon delimited list of links, each of which can be in one of the following formats:

 

A full URL, optionally matching a URL used to load a document or image from a library, or a URL to an outside page or document. This structure, if it begins with http:// or ftp://, can be prefixed with a title in the format of title=URL.  If the title is specified, that becomes the visible link in the browser.
 
A simplified pipe-delimited structure of library|doctype|docid[|subid], which is displayed in the browser interface as a URL link to the document or image named by library, document type, document ID, and optionally image sub ID.

 

There can be any number of links in the list.

 

An entity ID can be set to tie this document to a particular code that can be used to filter access in the browser interface.  A user login can be assigned to an entity ID, and that user can only view documents with a matching entity ID.

 

The args option can be used to specify UnForm command line arguments to pass to the sub-job used to generate the archive PDF file.  For example, if you only want to archive copy 1 of a job, you could pass "-ce 1" (copies enabled 1).

 

If more than one archive command is present in a rule set, then archives are generated for all of them.  For example, a second archive command might be added to produce a full job archive in addition to archives for individual documents.  Note this differs from version 7.x, where only one archive command was honored.

 

Examples

 

archive "demo_accounting","ApAging"

 

This first example simply archives the A/P aging report to the demo_accounting library, under the document type "ApAging".  The document ID will be automatically generated as a 10-digit sequential number, and the entire job is archived as a single document.  The title and keywords are derived automatically from the content.

 

archive "demo_sales","ArStatement",{arcid$},title {arctitle$},cats {arccats$}, args "-ce 1"                                                              

 

This example archives statements to the demo_sales library.  The document ID, title, and categories are expressions derived from code block variables.  The sub-job that generates the PDF document will have a "-ce 1" command line argument, which enables copy 1 only, so the archived copy will only be of the rule set’s first copy.  The sample rule file arcdemo.rul contains the full Statement rule set where this example comes from.

 

 

Drivers: pcl, pdf, ps