# ################################################################### # eDocEngine.rul rule file # # This is the "engine" for handling archiving, scanning barcodes, # # emailing, faxing, print copy selection, & old style archiving # # Requires, at least, UnForm version 7.0 # ################################################################### # This rule file is provided "AS IS", without warranty. # # Under no circumstances will the publisher be liable # # for consequential damages resulting from the use or # # inability to use the contents. # ######################################################### # # Generic comments ###################################### # # Make changes to all constants as needed. # # Modification history # # Last modified 01/16/2007 -- BCJ # ############################################### # Merge rule sets ############################# ############################################### # The below rule sets are to be used as # needed to convert your rule file for # new capabilities # Copies of each shell should # be added to the rule sets that you # want to add each capability # # e.g. If you want archiving and emailing, # you would copy the archiving shell # and the email shell to your rule file # and add both to the rule set in question. # then modify the variables as needed # to configure each option. # # You will also need to add a global # constant to your rule file to make # use of these features. # global DOC_ENGINE="eDocEngine.rul" # # Please note that in most cases, there # will be 4 types of shells. # Each type applies to the applicable # engine. # # Engine 1 is for the placement of # specific information, like email # address, at a specified location # # Engine 2 is for placement of a line of # information anywhere on the page # # Engine 3 is for looking up information # in text files # # Engine #4 will allow you to use ODBC # to look up information [Shell for archiving] # # Copy this shell to any rule set to # "turn" on this feature. # # Then change the variables below as # needed / wanted to fit your document. # # Archiving section # # Coding for this feature uses the following constants # which are preset in standard SDSI rule files/sets # Globals constants set at top of rule file # UFTRIM - trim value for get command (std, "Y") # # These constant(s) must be added in rule file/set as needed # or inserted below # # establish text-based docdate format for date conversion into segments # adjust this format to fit your document local UFA_DATEFMT="MM/DD/YY" prejob { day_format "UFA_DATEFMT" } prepage { # arclibpath$=name of library ufa_libpath$="SXE_Sales" # arcdoctype$=document type, default=rule set name ufa_doctype$="Acknowledgement" if pos("Quote Order"=text$[2]) then ufa_doctype$="Quote" # arcdocid$=document id,eg invoice #, default=10 digit sequential number ufa_docid$=get(121,3,12,"UFTRIM") # arcsubid$=subid name, default=@unform ufa_subid$="" # arctitle$=document title, default=title command or derived from data ufa_docdate$=get(106,3,12,"UFTRIM") if ufa_docdate$="" then ufa_docdate$=get(94,5,8) # recommend insuring date is valid if ufa_docdate$="" then ufa_docdate$=dte(0:"%Mz/%Dz/%Yz") ufa_custid$="Id: "+get(11,4,13) ufa_custname$=get(12,7,35,"UFTRIM") ufa_custpo$="PO "+get(104,5,22,"UFTRIM") if trim(ufa_custpo$)="PO" then ufa_custpo$="PO (none)" ufa_title$=ufa_docdate$+" "+ufa_custid$+":"+ufa_custname$+" "+ufa_custpo$ # arcnotes$=free form document notes ufa_notes$="" # arckeywords$=semi-colon delimited document identifiers, # default=derived from unique words in document ufa_keywords$="*;" # arccats$=semi-colon delimited sort keys(indexes), # categories can contain multiple segments separated by pipes (|) # info needed for categories ufa_shiptoname$=get(12,12,35,"UFTRIM") ufa_yyyy$=dte(ufa_docdate$:"%Ys") ufa_mmm$=dte(ufa_docdate$:"%Ms") ufa_dd$=dte(ufa_docdate$:"%Dz") # 3 segment category:year then year-month then year-month-day ufa_yyyymmmdd$=ufa_yyyy$+"|"+ufa_yyyy$+" "+ufa_mmm$+"|"+ufa_yyyy$+" "+ufa_mmm$+" "+ufa_dd$ # 2 segment year category: year then year-month ufa_yyyymmm$=ufa_yyyy$+"|"+ufa_yyyy$+" "+ufa_mmm$ # now set categories ufa_cats$="Customer|Id|"+ufa_custid$+":"+ufa_custname$+"|"+ufa_yyyymmm$+";" ufa_cats$+="Customer|Name|"+ufa_custname$+"|"+ufa_yyyymmm$+";" ufa_cats$+="CustPo|Id|"+ufa_custid$+":"+ufa_custname$+"|"+ufa_custpo$+";" ufa_cats$+="CustPo|Name|"+ufa_custname$+"|"+ufa_custpo$+";" ufa_cats$+="CustShipTo|Id|"+ufa_custid$+":"+ufa_custname$+"|"+ufa_shiptoname$+"|"+ufa_yyyymmm$+";" ufa_cats$+="CustShipTo|Name|"+ufa_custname$+"|"+ufa_shiptoname$+"|"+ufa_yyyymmm$+";" ufa_cats$+="by Month|"+ufa_yyyymmm$ ufa_cats$+="by Day|"+ufa_yyyymmmdd$ # arclinks$=links to other documents ufa_links$="" # arcargs$=UnForm command line arguments to pass to archive subjobs ufa_args$="-ce 1" # arcdtm$= date & time for document, # default=current date and time ufa_dtm$="" # arcsubtitle$=titles for subids ufa_subtitle$="" # arcsubdtm$=date & time for subids ufa_subdtm$="" } # Place a # in front of the archive line to turn off archiving if uf.arcenabled archive {ufa_libpath$},{ufa_doctype$},{ufa_docid$},subid {ufa_subid$},title {ufa_title$},notes {ufa_notes$},keywords {ufa_keywords$},categories {ufa_cats$},links {ufa_links$},args {ufa_args$},dtm {ufa_dtm$},subtitle {ufa_subtitle$},subdtm {ufa_subdtm$} endif [Shell (Method1) for old style archiving] # # Information will be hard-coded and/or # located at specific locations on the page # # eg. 1,3 at one location # /archive at another location # # Copy this shell to any rule set to # "turn" on this feature. # # change constants below as needed to # match your document # # NOTE: use dbl quotes if no expression is involved # # used for new get option to trim local UFO_TRIM="Y" # default copies to archive # none, all, or comma-delimited string, eg. 1,3,4 local UFO_DEFAULT_COPIES="1" # default archive directory local UFO_DEFAULT_DIRECTORY="/archive/" # location for comma-delimited string of copies to archive local UFO_COPIES_GET=get(col,row,cols,"UFO_TRIM") # set command to erase if wanted local UFO_COPIES_ERASE=set(col,row,cols,"") # location for archive directory local UFO_DIRECTORY_GET=get(col,row,cols,"UFO_TRIM") # set command to erase if wanted local UFO_DIRECTORY_ERASE=set(col,row,cols,"") # get unique doc id local UFO_DOCID=get(col,row,cols,"UFO_TRIM") # get unique doc id for next page local UFO_NEXT_DOCID=get(col,row,cols,"UFO_TRIM",pagenum+1) # setup other job args, copies will be added local UFO_JOBARGS="" # set logfile local UFO_LOGFILE="/tmp/ufo.log" # set log level: 0=none, 1=minimal, 2=detailed local UFO_DEBUG=0 merge "Engine Method 1","DOC_ENGINE" [Shell (Method2) for old style archving] # # Information will be hard-coded and/or # within lines of text located # at any location on the page # # eg. archive|1,3|/archive # # Copy this shell to any rule set to # "turn" on this feature. # # change constants below as needed to # match your document # # NOTE: use dbl quotes if no expression is involved # # used for new get option to trim local UFO_TRIM="Y" # default copies to archive # none, all, or comma-delimited string, eg. 1,3,4 local UFO_DEFAULT_COPIES="1" # default archive directory local UFO_DEFAULT_DIRECTORY="/archive/" # header for archive info line local UFO_LINEHDR="archive" # delimiter for archive info line local UFO_DELIMITER="|" # line end for archive info line local UFO_LINE_END="\|" # fld # for comma-delimited string of copies to archive local UFO_COPIES_FLD=2 # fld # for archive directory local UFO_DIRECTORY_FLD=3 # get unique doc id local UFO_DOCID=get(col,row,cols,"UFO_TRIM") # get unique doc id for next page local UFO_NEXT_DOCID=get(col,row,cols,"UFO_TRIM",pagenum+1) # set logfile local UFO_LOGFILE="/tmp/ufo.log" # set log level: 0=none, 1=minimal, 2=detailed local UFO_DEBUG=0 merge "Engine Method 2","DOC_ENGINE" [Shell (Method3) for old style archiving] # # Information will be hard-coded and/or # within lines of a specified text file. # # eg. key = A100 # fld3= 1,3 # fld4= /archive/ # # Copy this shell to any rule set to # "turn" on this feature. # # change constants below as needed to # match your document # # NOTE: use dbl quotes if no expression is involved # # used for new get option to trim local UFO_TRIM="Y" # default copies to archive # none, all, or comma-delimited string, eg. 1,3,4 local UFO_DEFAULT_COPIES="1" # default archive directory local UFO_DEFAULT_DIRECTORY="/archive/" # file with info local UFO_FILE="/path/filename" # key of info line in file local UFO_KEY=get(col,row,rows,"UFO_TRIM") # fld# for copies local UFO_COPIES_FLDNO=## # command to load comma-delimited string of copies to archive local UFO_COPIES=getfilefield("UFO_FILE","UFO_KEY",UFO_COPIES_FLDNO) # fld# for archive directory local UFO_DIRECTORY_FLDNO=## # command to load archive directory local UFO_DIRECTORY=getfilefield("UFO_FILE","UFO_KEY",UFO_DIRECTORY_FLDNO) # get unique doc id local UFO_DOCID=get(col,row,cols,"UFO_TRIM") # get unique doc id for next page local UFO_NEXT_DOCID=get(col,row,cols,"UFO_TRIM",pagenum+1) # set logfile local UFO_LOGFILE="/tmp/ufo.log" # set log level: 0=none, 1=minimal, 2=detailed local UFO_DEBUG=0 merge "Engine Method 3","DOC_ENGINE" [Shell (Method4) for old style archiving] [Shell (Method1) for selective copy printing] # # Information will be hard-coded and/or # located at specific locations on the page # # eg. col 1, row 2 # # Copy this shell to any rule set to # "turn" on this feature. # # change constants below as needed to # match your document # # NOTE: use dbl quotes if no expression is involved # # used for new get option to trim local UFP_TRIM="Y" # default copies to print # none, all, or comma-delimited string, eg. 1,3,4 local UFP_DEFAULT_COPIES="all" # location for comma-delimited string of copies to print local UFP_COPIES_GET=get(col,row,cols,"UFP_TRIM") # set command to erase if wanted local UFP_COPIES_ERASE=set(col,row,cols,"") # get unique doc id local UFP_DOCID=get(col,row,cols,"UFP_TRIM") # get unique doc id for next page local UFP_NEXT_DOCID=get(col,row,cols,"UFP_TRIM",pagenum+1) # set logfile local UFP_LOGFILE="/tmp/ufp.log" # set log level: 0=none, 1=minimal, 2=detailed local UFP_DEBUG=0 merge "Engine Method 1","DOC_ENGINE" [Shell (Method2) for selective copy printing] # # Information will be hard-coded and/or # within lines of text located # at any location on the page # # eg. print|1,3 # # Copy this shell to any rule set to # "turn" on this feature. # # change constants below as needed to # match your document # # NOTE: use dbl quotes if no expression is involved # # used for new get option to trim local UFP_TRIM="Y" # default copies to print # none, all, or comma-delimited string, eg. 1,3,4 local UFP_DEFAULT_COPIES="all" # header for print info line local UFP_LINEHDR="print" # delimiter for print info line local UFP_DELIMITER="|" # line end for print info line local UFP_LINE_END="\|" # fld # for copies string local UFP_COPIES_FLD=2 # get unique doc id local UFP_DOCID=get(col,row,cols,"UFP_TRIM") # get unique doc id for next page local UFP_NEXT_DOCID=get(col,row,cols,"UFP_TRIM",pagenum+1) # set logfile local UFP_LOGFILE="/tmp/ufp.log" # set log level: 0=none, 1=minimal, 2=detailed local UFP_DEBUG=0 merge "Engine Method 2","DOC_ENGINE" [Shell (Method3) for selective copy printing] # # Information will be hard-coded and/or # within lines of a specified text file. # # eg. key = A100 # fld3=1,3 # # Copy this shell to any rule set to # "turn" on this feature. # # change constants below as needed to # match your document # # NOTE: use dbl quotes if no expression is involved # # used for new get option to trim local UFP_TRIM="Y" # default copies to print # none, all, or comma-delimited string, eg. 1,3,4 local UFP_DEFAULT_COPIES="all" # file with info local UFP_FILE="/path/filename" # key of info line in file local UFP_KEY=get(col,row,rows,"UFP_TRIM") # fld# for copies local UFP_FLDNO=## # command to load comma-delimited string of copies to print local UFP_COPIES=getfilefield("UFP_FILE","UFP_KEY",UFP_FLDNO) # get unique doc id local UFP_DOCID=get(col,row,cols,"UFP_TRIM") # get unique doc id for next page local UFP_NEXT_DOCID=get(col,row,cols,"UFP_TRIM",pagenum+1) # set logfile local UFP_LOGFILE="/tmp/ufp.log" # set log level: 0=none, 1=minimal, 2=detailed local UFP_DEBUG=0 merge "Engine Method 3","DOC_ENGINE" [Shell (Method4) for selective copy printing] [Shell for scanning copy barcodes ] # # Copy this shell to any rule set to # "turn" on this feature. # # Scanning barcode copy section # # Coding for this feature uses the following constants # which are preset in standard SDSI rule files/sets # Globals constants set at top of rule file # UFTRIM - trim value for get command (std, "Y") # DFONT - detail font (std, cgtimes,9) # locals constants set near top of rule set # MAXCOLS - max columns on document, eg. 80 # MAXROWS - max rows on document, eg. 66 # SCANNING_COPY- copy # barcodes should be placed, eg. 2 # # These constants must be added in rule file/set as needed # or inserted below # prepage { # ufs_doctype$ MUST be upper case ufs_doctype$="ACK" if pos("Quote Order"=text$[2]) then ufs_doctype$="QTE" ufs_docid$=get(121,3,12,"UFTRIM") # warning message text ufs_warnmsg$="Please do not write in this area." # increase rows to allow space for barcodes. # s/b at least 4 rows more than maximum # for enhanced page. ufs_maxrows=MAXROWS+4 # adjusted max form columns as needed ufs_maxcols=MAXCOLS # set flag for right-justified signature # line: 0=no, 1=yes ufs_sign=1 # set signature text, "" for no text ufs_text_sign$="Accepted By" } precopy { # if no archiving enabled then turn off scanning copy if copy=SCANNING_COPY and not(uf.arcenabled) then skip=1 # to turn off scanning copy, remove the # from next line # if copy=SCANNING_COPY then skip=1 # Specify copy to print barcodes ufs_copy=SCANNING_COPY } merge "Engine Scn","DOC_ENGINE" ############################################### # Engine rule sets ############################ ############################################### [Engine Scanning copy barcodes] # # this is the engine used by the scn constants # rule set. It will add barcodes to the document # to aid in scanning and archiving the scanned # image. # prepage { # to determine how long the box needs to be # and what column to start the second barcode # calculate the width of each barcode # based upon the number of characters in each # ufs_doctype_len=len(ufs_doctype$) ufs_docid_len=len(ufs_docid$) ufs_doctype_bcdlen=cmtocols(1+.47*(ufs_doctype_len-1)) ufs_docid_bcdlen=cmtocols(1+.47*(ufs_docid_len-1)) ufs_boxend=5+ufs_doctype_bcdlen+5+ufs_docid_bcdlen+5 ufs_docid_start=5+ufs_doctype_bcdlen+5 } precopy { # only perform scanning stuff on copy selected if copy=ufs_copy then : # set new rows rows$=str(ufs_maxrows) # add box and warning message x$="cbox 1,"+str(ufs_maxrows-3.75)+","+str(ufs_boxend)+","+str(ufs_maxrows)+",5" exec(x$) x$="text 2,"+str(ufs_maxrows-3.5)+","+$22$+ufs_warnmsg$+$22$+",DFONT,6" exec(x$) # barcode document type inside box with text x$="barcode 5,"+str(ufs_maxrows-3)+","+$22$+ufs_doctype$+$22$+",400,75,4" exec(x$) x$="text 5,"+str(ufs_maxrows-.5)+","+$22$+ufs_doctype$+$22$+",DFONT,6" exec(x$) # barcode document id inside box with text x$="barcode "+str(ufs_docid_start)+","+str(ufs_maxrows-3)+","+$22$+ufs_docid$+$22$+",400,75,4" exec(x$) x$="text "+str(ufs_docid_start)+","+str(ufs_maxrows-.5)+","+$22$+ufs_docid$+$22$+",DFONT,6" exec(x$) # add signature line and text as specified if ufs_sign then : x$="cline "+str(ufs_maxcols-25)+","+str(ufs_maxrows-1)+","+str(ufs_maxcols-1)+","+str(ufs_maxrows-1)+",5" exec(x$) x$="text "+str(ufs_maxcols-20)+","+str(ufs_maxrows)+","+$22$+ufs_text_sign$+$22$+",DFONT,center,cols=20" exec(x$) endif endif } [Engine Scn-old] # # this is the engine used by the scn constants # rule set. It will add barcodes to the document # to aid in scanning and archiving the scanned # image. # prepage { # to determine how long the box needs to be # and what column to start the second barcode # calculate the width of each barcode # based upon the number of characters in each # ufs_doctype$=UFS_DOCTYPE ufs_doctype_len=len(ufs_doctype$) ufs_docid$=UFS_DOCID ufs_docid_len=len(ufs_docid$) ufs_doctype_bcdlen=cmtocols(1+.47*(ufs_doctype_len-1)) ufs_docid_bcdlen=cmtocols(1+.47*(ufs_docid_len-1)) ufs_boxend=5+ufs_doctype_bcdlen+5+ufs_docid_bcdlen+5 ufs_docid_start=5+ufs_doctype_bcdlen+5 } precopy { # only perform scanning stuff on copies selected if pos(","+str(copy)+","=",UFS_COPY,") then : # set new rows rows$=str(UFS_MAX_ROWS) # add box and warning message x$="cbox 1,"+str(UFS_MAX_ROWS-3.75)+","+str(ufs_boxend)+","+str(UFS_MAX_ROWS)+",5" exec(x$) x$="text 2,"+str(UFS_MAX_ROWS-3.5)+","+$22$+UFS_WARNMSG+$22$+",DBFONT,6,cols=34" exec(x$) # barcode document type inside box with text x$="barcode 5,"+str(UFS_MAX_ROWS-3)+","+$22$+UFS_DOCTYPE+$22$+",400,75,4" exec(x$) x$="text 5,"+str(UFS_MAX_ROWS-.5)+","+$22$+UFS_DOCTYPE+$22$+",DFONT,6" exec(x$) # barcode document id inside box with text x$="barcode "+str(ufs_docid_start)+","+str(UFS_MAX_ROWS-3)+","+$22$+UFS_DOCID+$22$+",400,75,4" exec(x$) x$="text "+str(ufs_docid_start)+","+str(UFS_MAX_ROWS-.5)+","+$22$+UFS_DOCID+$22$+",UFS_FONT,6" exec(x$) # add signature line and text as specified if UFS_SIGN then : x$="cline "+str(UFS_MAX_COLS-25)+","+str(UFS_MAX_ROWS-1)+","+str(UFS_MAX_COLS-1)+","+str(UFS_MAX_ROWS-1)+",5" exec(x$) x$="text "+str(UFS_MAX_COLS-20)+","+str(UFS_MAX_ROWS)+","+$22$+UFS_TEXT_SIGN+$22$+",UFS_BCFONT,cols=20" exec(x$) endif endif } [Engine Method 1] # # Information will be hard-coded and/or # located at preset locations # prejob { prejob_print_sel_copies: uf_plogfile$="UFP_LOGFILE" uf_pdebug=UFP_DEBUG ufp_docid$="" prejob_archive: uf_ologfile$="UFO_LOGFILE" uf_odebug=UFO_DEBUG ufo_docid$="" prejob_email: uf_elogfile$="UFE_LOGFILE" uf_edebug=UFE_DEBUG ufe_docid$="" prejob_fax: uf_flogfile$="UFF_LOGFILE" uf_fdebug=UFF_DEBUG uff_docid$="" } prepage { prepage_print_sel_copies: # note: only look for info on first page if not(uf.subjob) and ufp_docid$<>UFP_DOCID then : ufp_docid$=UFP_DOCID ufp_copies$="all" ufp_x$=trim("UFP_DEFAULT_COPIES") if ufp_x$<>"" then ufp_copies$=ufp_x$ ufp_x$=UFP_COPIES_GET if ufp_x$<>"" then ufp_copies$=ufp_x$ if uf_pdebug then : log("Print copies="+ufp_copies$,uf_plogfile$) endif if UFP_COPIES_ERASE<>"" then ufp_x$=UFP_COPIES_ERASE if uf_pdebug=2 then : log("Erased at UFP_COPIES_ERASE",uf_plogfile$) endif endif # not(uf.subjob) prepage_archive: if ufo_docid$=UFO_DOCID then goto prepage_archive_store ufo_docid$=UFO_DOCID if uf_odebug then : log("Archive? Doc id "+ufo_docid$,uf_ologfile$) endif ufo_archive_chk=1 while ufo_archive_chk ufo_copies$="none",ufo_archivedir$="" ufo_x$=trim("UFO_DEFAULT_COPIES") if ufo_x$<>"" then ufo_copies$=ufo_x$ ufo_x$=trim("UFO_DEFAULT_DIRECTORY") if ufo_x$<>"" then ufo_archivedir$=ufo_x$ ufo_x$=UFO_COPIES_GET if ufo_x$<>"" then ufo_copies$=ufo_x$ if UFO_COPIES_ERASE<>"" then ufo_x$=UFO_COPIES_ERASE ufo_x$=UFO_DIRECTORY_GET if ufo_x$<>"" then ufo_archivedir$=ufo_x$ if UFO_DIRECTORY_ERASE<>"" then ufo_x$=UFO_DIRECTORY_ERASE # exit if not archiving if ufo_archivedir$="" or ufo_copies$="" then break ufo_do_archive=1 if uf_odebug then : log("Archive? Yes",uf_ologfile$) log("Archive Copies: "+ufo_copies$,uf_ologfile$) log("Archive Directory: "+ufo_archivedir$,uf_ologfile$) endif # uf_odebug if uf_odebug=2 then : if UFO_COPIES_ERASE then : log("Archive Erase copies: "+UFO_COPIES_ERASE,uf_ologfile$) endif # UFO_COPIES_ERASE if UFO_DIRECTORY_ERASE then : log("Archive Erase directory: "+UFO_COPIES_ERASE,uf_ologfile$) endif # UFO_DIRECTORY_ERASE endif # uf_odebug=2 ufo_archive_chk=0 # forces loop exit wend # ufo_archive_check # now store the document prepage_archive_store: while ufo_do_archive if uf_odebug then : log("Archive Stored: "+ufo_docid$,uf_ologfile$) endif # uf_odebug jobstore(ufo_docid$) wend # ufo_do_archive endif # not(uf.subjob) prepage_fax: if not(uf.subjob) then : endif # not(uf.subjob) prepage_email: if not(uf.subjob) then : endif # not(uf.subjob) } postpage { postpage_archive: if not(uf.subjob) then : if ufo_do_archive then : ufo_next_docid$=UFO_NEXT_DOCID if ufo_docid$<>ufo_next_docid$ then : ufo_filename$=ufo_archive$+ufo_docid$+".pdf" ufo_jobargs$="-ce "+ufo_copies$+" UFO_JOBARGS" jobexec(ufo_docid$,ufo_filename$,"pdf",ufo_jobargs$) jobclose(ufo_docid$) if uf_odebug=2 then : log("Archive Filename: "+ufo_filename$,uf_ologfile$) log("Archive Job args: "+ufo_jobargs$E,uf_ologfile$) endif # uf_odebug=2 if uf_odebug then : log("Archive Complete: "+ufo_docid$,uf_ologfile$) endif # uf_odebug ufo_do_archive=0 endif # ufo_docid$<>ufo_next_docid$ endif # ufo_do_archive endif # not(uf.subjob) postpage_fax: if not(uf.subjob) then : endif # not(uf.subjob) postpage_email: if not(uf.subjob) then : endif # not(uf.subjob) } precopy { precopy_print_sel_copies: if not(uf.subjob) then : switch lower(ufp_copies$) case "none","0" skip=1 break case "all" break default if pos(","+str(copy)+","=","+ufp_copies$+",")=0 then skip=1 end switch endif # not(uf.subjob) } [Engine Method 2] # # Information will be hard-coded and/or # within lines of text located # at any location on the page # # If no line terminator is given, # UnForm will use the end of the line # as its line terminator # prejob { prejob_print_sel_copies: uf_plogfile$="UFP_LOGFILE" uf_pdebug=UFP_DEBUG prejob_archive: uf_ologfile$="UFO_LOGFILE" uf_odebug=UFO_DEBUG ufo_docid$="" prejob_email: uf_elogfile$="UFE_LOGFILE" uf_edebug=UFE_DEBUG prejob_fax: uf_flogfile$="UFF_LOGFILE" uf_fdebug=UFF_DEBUG } prepage { prepage_print_sel_copies: if not(uf.subjob) ufp_copies$="all" ufp_x$=trim("UFP_DEFAULT_COPIES") if ufp_x$<>"" then ufp_copies$=ufp_x$ # search page ufp_linehdr$=trim("UFP_LINEHDR") ufp_delimiter$=trim("UFP_DELIMIER") if ufp_linehdr$<>"" and ufp_delimiter$<>"" then : ufp_maxrows=ubound(text$[all]) while ufp_row<=ufp_maxrows ufp_col=pos(lower(ufp_linehdr$)+ufp_delimiter$=lower(text$[ufp_row])) if ufp_col=0 then ++ufp_row;continue ufp_line$=trim(text$[ufp_row](ufp_col)) break wend # ufp_row<=ufp_maxrows endif # ufp_linehdr$<>"" and ufp_delimiter$<>"" # check for line end and trim ufp_line_end$=trim("UFP_LINE_END") ufp_line_end_len=0 if ufp_line_end$<>"" then : ufp_x=pos(ufp_line_end$=ufp_line$) if ufp_x then : ufp_line$=trim(ufp_line$(1,ufp_x-1)) ufp_line_end=len(ufp_line_end$) endif # ufp_x endif # ufp_line_end$<>"" # clear from page if ufp_line$<>"" then : ufp_x$=set(ufp_col,ufp_row,len(ufp_line$)+ufp_line_end_len,"") endif # ufp_line$<>"" # get value (fld=2) ufp_x$=trim(parse(ufp_line$,UFP_COPIES_FLD,ufp_delimiter$)) if ufp_x$<>"" then ufp_copies$=ufp_x$ if UFP_DEBUG then : log("Print copies="+ufp_copies$,logfile$) endif endif # not(uf.subjob) prepage_archive: ufo_archive_chk=1 while ufo_archive_chk ufo_do_archive=0 ufo_copies$="none",ufo_archivedir$="" ufo_x$=trim("UFO_DEFAULT_COPIES") if ufo_x$<>"" then ufo_copies$=ufo_x$ ufo_x$=trim("UFO_DEFAULT_DIRECTORY") if ufo_x$<>"" then ufo_archivedir$=ufo_x$ ufo_x$=UFO_COPIES_GET if ufo_x$<>"" then ufo_copies$=ufo_x$ if UFO_COPIES_ERASE<>"" then ufo_x$=UFO_COPIES_ERASE ufo_x$=UFO_DIRECTORY_GET if ufo_x$<>"" then ufo_archivedir$=ufo_x$ if UFO_DIRECTORY_ERASE<>"" then ufo_x$=UFO_DIRECTORY_ERASE # exit if not archiving if ufo_archivedir$="" or ufo_copies$="" then break # valid directory? create as needed ufo_archivedir$=sub(ufo_archivedir$,"\\","/") if left(ufo_archivedir$,1,2)="./" then ufo_archivedir$=uf.home$+ufo_archivedir$(3) if left(ufo_archivedir$,1,3)="../" then ufo_archivedir$=uf.home$+ufo_archivedir$(4) if right(ufo_archivedir$,1)<>"/" then ufo_archivedir$=ufo_archivedir$+"/" ufo_cnt=pos("/"=ufo_archivedir$,1,0) for ufo_i=2 to ufo_cnt ufo_x$=ufo_archivedir$(1,pos("/"=ufo_archivedir$,1,ufo_i)) ufo_ok=1 while ufo_ok test=unt open(test,err=next)ufo_x$;close(test);break directory ufo_x$,err=next;continue # can't create directory ufo_ok=0 # forces loop exit wend # ufo_ok if not(ufo_ok) then ufo_archivedir$="";break next ufo_i if ufo_archivedir$<>"" and ufo_copies$<>"" then ufo_do_archive=1 ufo_archive_chk=0 # forces loop exit wend # ufo_archive_check ufo_docid$=UFO_DOCID while ufo_do_archive jobstore(ufo_docid$) wend # ufo_do_archive } precopy { precopy_print_sel_copies: if not(uf.subjob) then : switch lower(ufp_copies$) case "none","0" skip=1 break case "all" break default if pos(","+str(copy)+","=","+ufp_copies$+",")=0 then skip=1 end switch endif # not(uf.subjob) } [Engine Method 3] # # Information will be hard-coded and/or # within lines of a specified text file. # prejob { prejob_print_sel_copies: uf_plogfile$="UFP_LOGFILE" uf_pdebug=UFP_DEBUG prejob_archive: uf_ologfile$="UFO_LOGFILE" uf_odebug=UFO_DEBUG ufo_docid$="" prejob_email: uf_elogfile$="UFE_LOGFILE" uf_edebug=UFE_DEBUG prejob_fax: uf_flogfile$="UFF_LOGFILE" uf_fdebug=UFF_DEBUG } prepage { prepage_print_sel_copies: ufp_copies$="all" ufp_x$=trim("UFP_DEFAULT_COPIES") if ufp_x$<>"" then ufp_copies$=ufp_x$ ufp_x$=trim(UFP_COPIES) if ufp_x$<>"" then ufp_copies$=ufp_x$ if UFP_DEBUG then : log("Print copies="+ufp_copies$,logfile$) endif } precopy { precopy_print_sel_copies: switch lower(ufp_copies$) case "none","0" skip=1 break case "all" break default if pos(","+str(copy)+","=","+ufp_copies$+",")=0 then skip=1 end switch } [Engine Method 4] # # Information will be hard-coded and/or # located in files that will be accessed # using the Windows Support Server # and ODBC using SQL. # # THIS ENGINE WILL BE ADDED LATER # prejob { prejob_print_sel_copies: uf_plogfile$="UFP_LOGFILE" uf_pdebug=UFP_DEBUG prejob_archive: uf_ologfile$="UFO_LOGFILE" uf_odebug=UFO_DEBUG ufo_docid$="" prejob_email: uf_elogfile$="UFE_LOGFILE" uf_edebug=UFE_DEBUG prejob_fax: uf_flogfile$="UFF_LOGFILE" uf_fdebug=UFF_DEBUG }