inbound

Top  Previous  Next

inboundobj=new("inbound")

 

The inbound object is designed to manage documents stored in inbound source libraries.  These libraries are supplied documents from configured inbound sources such as email and monitored directories, or can also be supplied documents programmatically or via upload, using the inbound object.  The documents are identified by library, type, and doc ID, but these values are system-controlled.  Inbound libraries are staging repositories for documents that will ultimately be transferred to document archive libraries in the UnForm archiving system.  Properties are maintained using the 'document data' feature of UnForm libraries, and then used as identification and data values when the documents are transferred.

 

Many of the document-related methods are duplicated in the inbounddoc object as a convenience.

 

Properties

 

lasterr contains an error number if the last method encountered an error to be reported.

lasterrmsg$ contains an error message if the last method encountered an error to be reported

 

Inbound Source Methods

These methods are generally used only by the UnForm server internally when maintaining inbound source records.

 

count() returns the number of inbound source records.

delete(id$) removes the source record id$.

exists(id$) returns true (1) if the source id$ exists.

get(id$,prop$) fills the prop$ template with the record for source id$.  Property fields include id$, description$, inactive$, type$, source$, emserver$, empassword$, emmanager$, emallowfrom$, emtimeout$, action$, actionoption$.

libname$(id$) returns the library pathname of the source id$, used when access to a library object for the library is required.

put(id$,prop$) adds or updates the source record id$ with data in the prop$ template.

range$(first,count[,flds$]) returns a tab-delimited range of source records, starting with a 1-based index, for up to count records.  Optionally specify a list of fields.

 

Document Related Methods

These methods related to specific documents in an inbound source library.  Where id$, doctype$, and docid$ values are specified, these refer to the working library document identification rather than the ultimate target library identification.  The source id$ refers to the inbound source identifying name rather than the library itself.  The doctype$ and docid$ values are the auto-generated values used to identify the documents while they reside in the inbound source library.  The docid$ value is visible in the Image Manager interface, as the Inbound ID column, and both doctype and docid values can be seen when browsing the source library through the archive browser interface (these libraries are only visible to administrators).  The doctype$ value is based on the date the document was imported from the inbound source, in yyyy-mmdd format.  The docid$ value is a day value plus time-based sequence values, in the format mmdd-####-####.

 

 

assignto(id$,doctype$,docid$[,userid$]) assigns the specified document to userid$, or de-assigns it if no userid$ is supplied.  De-assigned documents are in the pool of available documents that image manager users can self-assign.

bcd$(id$,doctype$,docid$,x,y,w,h[,page|pages$][,symbology$]) returns a barcode value found on the specified page(s) on the coordinates supplied (in inches).  If no page is supplied, 1 is assumed.  If a string of pages is supplied, such as "1-5", or "1,3,5", or "first-{last-1}", multiple values separated by [page] headers are returned.  Optionally specify a symbology that the barcode must be, such as code39, code128, or qrcode.

createdoc(id$,docprop$) creates a new document in the source library, and fills docprop$ with its default properties, so that docprop.doctype$ and docprop.docid$ are valid to further set up the inbound document in the source library.

deldoc(id$,doctype$,docid$) removes a document from the inbound source library.

delfield(id$,doctype$,docid$,name$) removes a specific custom data field from the document.

getdoc(id$,doctype$,docid$,prop$) loads prop$ with the underlying library document properties, using the library object.  Note this data differs from the getdocdata() method, which produces document identification data to be used when transferring to an archive library.  For example the doctype and docdata properties from this method hold inbound source library document type and id, which are auto-generated by the createdoc() method as documents arrive from their respective inbound sources.

getdocdata(id$,doctype$,docid$,data$) loads data$ with the document identification properties that will be used when the document is transferred to an archive library. Template values include library$, doctype$, docid$, subid$, subtitle$, title$, notes$, categories$, keywords$, and links$.

getdocdataitem$(id$,doctype$,docid$,item$) returns the value of one document data identifier. Items can be library, doctype, docid, subid, subtitle, title, notes, categories, keywords, and links.

getdocdataitem(id$,doctype$,docid$,item$,value$) fills value$ with the value of a specified document data item.  Returns 1 if the item is found.

getfield$(id$,doctype$,docid$,name$) returns the custom field data named name$.

getfield(id$,doctype$,docid$,name$,value$) fills value$ with the custom field name$ data.

getfields$(id$,doctype$,docid$) returns a tab-separated values list of custom field names and values.

getmeta$(id$,doctype$,docid$,name$) returns the metadata value of name$.  Metadata items are read-only values created at the time a document is imported from a source, such as subject and from addresses of email sources, or file names of directory sources.  Each name is prefixed with "@".

getmeta(id$,doctype$,docid$,name$,value$) fills value$ with the metadata value for name$, such as @subject, or @filename.

getmetas$(id$,doctype$,docid$) returns a tab-separated values list of metadata names and values.

getpages(id$,doctype$,docid$) returns the number of image pages in the document.

getsubdoc(id$,doctype$,docid$,subid$,prop$) fills the library object subdoc properties in prop$.

getsubdoc(id$,doctype$,docid$,subid$,prop$,imagefile$) fills the library object subdoc properties in prop$, and also creates a file with the image of the subdoc and provides the filename in imagefile$.

gridzone$(id$,doctype$,docid$,coldefs$[,pages$|page]) returns a tab-delimited-values list of OCR word data from the coldefs$ specification.  If no page is supplied, 1 is assumed.  If a string of pages is supplied, such as "1-5", or "1,3,5", or "first-{last-1}", columns contain [page] headers.  The coldefs$ variable must be a tab-separted-values where each column is defined as a name, position, pages, and filter.  Position is a comma-separated list of left, top, width, height in inches.  Column filters are applied, and supplied with an inbounddoc object obtained with the id$, doctype$, and docid$ fields.

initinvaliditems(id$,doctype$,docid$) initializes all validation error messages for the document.

initinvaliditems(id$,doctype$,docid$,item$) initializes the validation error message for a single item$, which can be a docdata property name or a custom field name.

joindocs$(id$,doclist$) joins the images and properties of the documents in doclist$.  The doclist$ value should be tab-separated-value list of doctypes and docids in the inbound source library.  The second and later documents in the list are added to the first, so that images are appended as additional pages, notes are appended, and categories, keywords, and links are merged.  The function returns tab-separated doctype and docid of the combined document, which is simply the first document type/id in doclist$.

movetosource(id$,doctype$,docid$,tosrcid$[,newdoctype$,newdocid$]) transfers a document from the source id$ to a different source tosrcid$.  The document is removed from the original source, and begins the normal processing defined for the new source, such as OCR processing and job execution.  If the newdoctype$ and newdocid$ arguments are provided, they will return the values in the new source library.

ocr$(id$,doctype$,docid$,x,y,w,h[,page|pages$][,trim]) returns the OCR word values found on the specified page(s) on the coordinates supplied (in inches).  If no page is supplied, 1 is assumed.  If a string of pages is supplied, such as "1-5", or "1,3,5", or "first-{last-1}", multiple values separated by [page] headers are returned.

ocrconfidence(id$,doctype$,docid$,x,y,w,h[,page|pages$]) will return the lowest OCR confidence value for words in the region specified, a value from 1 to 100.  If no values are available, this returns 100.  Confidence values are returned by an UnForm OCR service.

pageswap(id$,doctype$,docid$,page1,page2) swaps two image pages in a document.

putdoc(id$,doctype$,docid$,prop$) updates document properties in the underlying library, using the library object.  Note this differs from the putdocdata() method, which updates properties related to document identification when a document is transferred to an archive library.

putdocdata(id$,doctype$,docid$,data$) updates document identification data with values in the data$ template.  Template values include library$, doctype$, docid$, subid$, subtitle$, title$, notes$, categories$, keywords$, and links$.

putdocdataitem(id$,doctype$,docid$,item$,value$) updates a specific docdata item, such as library or title.

putfield(id$,doctype$,docid$,name$,value$) updates a custom field name$ with the supplied value$.

removepage(id$,doctype$,docid$,page) removes the specified page number from the document, shifting later pages up.  Returns 1 if successful.

reversepages(id$,doctype$,docid$) reverses the page order of the document.

rotate(id$,doctype$,docid$,degrees) rotates all pages and re-processes them for text and page extraction.

splitdoc$(id$,doctype$,docid$) splits all images of a document into new single-page documents.  It returns a tab-separated-values list of the added doc types and doc ids (note no trailing linefeed character).  All document data and field properties are duplicated.

splitdoc$(id$,doctype$,docid$,atpage) splits the document into two, with pages starting with atpage removed from the first document and added to the second.  It returns the added doc type and doc id, separated by a tab character.  All document data and field properties are duplicated.

splitdoc$(id$,doctype$,docid$,zonename$[,jobname$]) splits the document at pages where the specified zone value changes.  If no jobname$ is specified, the job currently assigned to the document is used.  Both OCR and barcode zone types are supported.  If the zone returns a value, and that value differs from the previous page, the document is split at that page.  The function returns a tab-separated list of added doctypes and doc ids (note no trailing linefeed character).  All document data and field properties are duplicated, so this process is normally followed by job execution on the existing and new documents in order to recalculate the data.

transfer$(id$,doclist$) transfers the documents specified in doclist$ to their respective target libraries with the document properties defined as document data and fields.  The doclist$ value should be a line-feed delimited list of tab-separated  doctype and docid values in the inbound source library.  Each doctype/docid pair identifies an inbound document to transfer.  Only documents that have no validation errors are transferred.  Before each document is transferred, if a job is assigned to the document, its preupload code is executed.  Likewise, after the transfer, its postupload code is executed.

 

The method returns a log of the transfer, with a line for each document.

validatedoc(id$,doctype$,docid$) performs all validation tests on the document's identification data and fields.  If there is a job assigned to the document, its validation rules are used.  Otherwise, the minimum validation required is performed, requiring library and doc type data.

zoneconfidence(id$,doctype$,docid$,zonename$[,jobname$]) returns the lowest OCR confidence value for words in the named zone, from 1 to 100.  If no jobname$ is specified, the job currently assigned to the document is used.  If no values are available, this returns 100.  Confidence values are returned by an UnForm OCR service.  If zonename$ is null (""), all zones are checked.