User Tools

Site Tools


pub:idocsapi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pub:idocsapi [2020/01/22 08:41] – [IFDUPSPLF] kkramerpub:idocsapi [2023/07/25 13:08] (current) – [ESENDFILE] kkramer
Line 1: Line 1:
 <html>&#091;</html>[[start#idocs | Up to Main Menu ]]<html>&#093;</html> <html>&#091;</html>[[start#idocs | Up to Main Menu ]]<html>&#093;</html>
  
- +====== Programming API'======
- +
-====== iDocs Programming API ====== +
 iDocs has various methods to automatically print forms that are deposited in output queues.  There are two different types of form overlay engines which are the processors that automatically search defined output queues for spooled files to merge with form applications or form sets.  iDocs also provides api's that can be embedded into a job stream that executes the merge for defined print jobs.  The simplest is TFPRT which is intended to be embedded in the job stream following the program that produced the spool file to be processed.  With the more complex TRPRTAPI api, you can provide the necessary parameters to process any spool file on the system.    iDocs has various methods to automatically print forms that are deposited in output queues.  There are two different types of form overlay engines which are the processors that automatically search defined output queues for spooled files to merge with form applications or form sets.  iDocs also provides api's that can be embedded into a job stream that executes the merge for defined print jobs.  The simplest is TFPRT which is intended to be embedded in the job stream following the program that produced the spool file to be processed.  With the more complex TRPRTAPI api, you can provide the necessary parameters to process any spool file on the system.   
  
Line 73: Line 70:
  
 ---- ----
 +====== UTILITIES ======
 +
 +===== EHTM2CSV =====
 +
 +Quick utility //(added 6.99 1/11/2022)// to convert HTML files into CSV file format. EHTM2CSV program and command; includes an updated IFDJAVA.JAR file.
 +
 +<html><pre>
 +
 +                         Convert HTML to CSV (EHTM2CSV)                         
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + HTML file path . . . . . . . . . > '/home/anguyen/htm2csv/Order.htm'           
 +                                                                                
 +                                                                                
 + CSV file path  . . . . . . . . . > '/home/anguyen/htm2csv/Order.csv'           
 +                                                                                
 +                                                                                
 + Charset  . . . . . . . . . . . . > 'UTF-8'                                     
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +</pre></html>
 +
 +Type command EHTM2CSV and prompt with F4\\
 +HTML file path: Enter the path to pick up the HTML File.\\
 +CSV file path: Enter the path to place the .csv file.\\
 +Charset: UTF-8 is default (F4 for options).\\
 +[Enter] to execute.
 +
 +----
 +
 +===== ESENDFILE =====
 +
 +A new command ESENDFILE is introduced in iDocs 8.00 to send a DB2 file from AS/400 server to a remote AS400 server.
 +<html><pre>
 +                   Send DB2 file to remote server (ESENDFILE)                   
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Remote hostname  . . . . . . . .   '172.16.1.55'                               
 +                                                                                
 + Username . . . . . . . . . . . .   USER                                        
 +                                                                                
 + Password . . . . . . . . . . . .   password                                    
 +                                                                                
 + iDocs lib name on remote servr     IDOCS800      Character value               
 + DB2 file on source system  . . .   FRMTMULH      Name                          
 +   Library  . . . . . . . . . . .     IDOCS6B     Name, *CURLIB                 
 + DB2 file on remote system  . . .   TESTCSV1      Name                          
 +   Library  . . . . . . . . . . .     USERLIB     Name, *CURLIB                 
 + Overwrite file on remote servr     *NO           *YES, *NO, *YES, *NO          
 + Restore file on remote server  .   *YES          *YES, *NO, *YES, *NO          
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +                                                                                
 +</pre></html>
 +
 +**Parameters:** \\
 +Remote hostname\\
 +User ID \\
 +Authentication Password \\
 +iDocs lib name on remote server  \\
 +DB2 file on source system library \\
 +DB2 file on remote system library \\
 +Overwrite file on remote server  (*YES/*NO) \\
 +Restore file on remote server  (*YES/*NO) \\
 +
 +
 +Command ESENDFILE will perform the following steps:
 +  * Executes iDocs command CNVDB2XML to convert DB2 to a temporary .xml file on source server
 +  * Sends this .xml file to remote server
 +  * Calls remote command CNVXML2DB on remote server to restore .xml file to DB2 file. (The command CNVXML2DB is stored on ‘iDocs lib name on remote server’)
 +  * User can input the name of DB2 file on remote server.
 +  * User can overwrite existing data or append them into remote DB2 file
 +
 +----
 +===== ESNDFILE =====
 +
 +A new command ESNDFILE is introduced in iDocs 6.97 to send a file or folder from the IBM i to a SFTP server using Password authentication.
 +<html><pre>
 +                     Send IFS File to SFTP server (ESNDFILE)                    
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + SFTP server  . . . . . . . . . .   'tdgtest.ocr-inc.com'                       
 +                                                                                
 + Authentication User ID . . . . .   testID                                      
 +                                                                                
 + Authentication Password  . . . .                                               
 +                                                                                
 + Port . . . . . . . . . . . . . .   22            Number                        
 + IFS Local Path . . . . . . . . .   '/home/anguyen/awtest.txt'                  
 +                                                                                
 +                                                                                
 +                                                                                
 + Remote folder  . . . . . . . . .   '/QBND'                                     
 +                                                                                
 +                                                                                
 +                                                                                
 + Overwrite  . . . . . . . . . . .               Y, N                          
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +</pre></html>
 +
 +SFTP supports 2 methods of authentication:
 +
 +  * SSH Key authentication
 +  * Password authentication
 +Our [[start#ibridge | iBridge ]] utility sends file using SSH Key and sends as a PDF file only
 +
 +ESNDFILE sends file using Password authentication: the server will authenticate the client by the submitting username and password from client.
 +
 +**Parameters:** 
 +SFTP server \\
 +Authentication User ID \\
 +Job name/User Name/ Job Number: job ID of input spool \\
 +Authentication Password \\
 +Port number \\
 +IFS local path \\
 +Remote folder \\
 +Overwrite (Y/N) \\
 +
 +
 +Result on SFTP Server: \\
 +{{:pub:idocs:esndfile001.png?600|}}
 +
 +----
 +===== ICOMDBMAP =====
 +
 +To evoke the merge process of one, two, or three Database Mapped Form Application(s), and aggregate the output to a desired out queue or trigger Smart Routing settings. The ICOMDBMAP command can be used interactively or submitted into a job (SEE EXAMPLE BELOW). (Added iDOCS 8.0 05/10/2023)
 +<html><pre>
 +                   Combine database map-File name (ICOMDBMAP)                   
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Main Application . . . . . . . .                 Name                          
 + Second Application . . . . . . .   *NONE         Name *NONE                    
 + Third Application  . . . . . . .                 NAME *NONE                    
 + Output Queue . . . . . . . . . .                 Name                          
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +                                                                                
 +</pre></html>
 +
 +**Parameters:** 
 +
 +**MAINAPP** = The first Form Application to be merged.  This Form Application will determine the output for all the Form Applications being used if using Smart Routing settings. \\
 +**SECONDAPP** = The second Form Application to be merged.  If not using a second Form Application, then use *NONE as the value.\\
 +**THIRDAPP** = The Third Form Application to be merged.  If not using a second Form Application, then use *NONE as the value.\\
 +**OUTQ** = This will be the value for the destination of the output into an out queue or the triggering for Smart Routing by using *FORMDEF as the value. \\
 +
 +
 +**Example:**
 +<html><pre>
 +                               Submit Job (SBMJOB)                              
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Command to run . . . . . . . . .   ICOMDBMAP MAINAPP(CYBERLTR) SECONDAPP(*NONE)
 + THIRDAPP(*NONE) OUTQ(*FORMDEF)                                                 
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                     ...        
 + Job name . . . . . . . . . . . .   ICOMDBTEST    Name, *JOBD                   
 + Job description  . . . . . . . .   *USRPRF       Name, *USRPRF                 
 +   Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB          
 + Job queue  . . . . . . . . . . .   FMGJOBQ       Name, *JOBD                   
 +   Library  . . . . . . . . . . .                 Name, *LIBL, *CURLIB          
 + Job priority (on JOBQ) . . . . .   *JOBD         1-9, *JOBD                    
 + Output priority (on OUTQ)  . . .   *JOBD         1-9, *JOBD                    
 + Print device . . . . . . . . . .   *CURRENT      Name, *CURRENT, *USRPRF...    
 +                                                                                
 +                                                                        More... 
 + F3=Exit   F4=Prompt   F5=Refresh   F10=Additional parameters   F12=Cancel      
 + F13=How to use this display        F24=More keys                               
 + </pre></html>                                                                               
 +
 +----
 +
 ===== IFDUPSPLF ===== ===== IFDUPSPLF =====
  
Line 102: Line 308:
 </pre></html> </pre></html>
  
-**Parameters:** <br> +**Parameters:** 
-Spooled file: input spool file name +
-Spooled file number: input spool file number +
-Job name/User Name/ Job Number: job ID of input spool file +
  
-Output Queue/Library: name and library of output queue +Spooled file: input spool file name \\ 
-New SPLF user data: enter user data of output spool file (*SAME to retain the same attribute of input spool file) +Spooled file number: input spool file number \\ 
-New SPLF form type: enter form type of output spool file  (*SAME to retain the same attribute of input spool file) +Job name/User Name/ Job Number: job ID of input spool \\ 
-New SPLF name: enter spool file name of output spool file  (*SAME to retain the same attribute of input spool file + 
-Hold new SPLF: Hold the output spool file name +Output Queue/Library: name and library of output queue \\ 
-Page range: enter the range of pages of input spool file name+New SPLF user data: enter user data of output spool file (*SAME to retain the same attribute of input spool file) \\ 
 +New SPLF form type: enter form type of output spool file  (*SAME to retain the same attribute of input spool file)\\ 
 +New SPLF name: enter spool file name of output spool file  (*SAME to retain the same attribute of input spool file\\ 
 +Hold new SPLF: Hold the output spool file name\\ 
 +Page range: enter the range of pages of input spool file name\\
  
 **Example:** **Example:**
 +
 IFDUPSPLF FILE(INV) SPLNBR(2) JOB(106730/ANGUYEN/ANGUYENA) OWNER(OFERRER) IFDUPSPLF FILE(INV) SPLNBR(2) JOB(106730/ANGUYEN/ANGUYENA) OWNER(OFERRER)
  
 ---- ----
 +
 +===== JOINSPLF =====
 +
 +Quick utility //(added 6.97 7/23/2021)// to stitch together multiple spool files into one spool file (Combines multiple spool files). 
 +Here is how it works: \\
 +  - Give the new spool file a name in the 'Output Spool Name' parameter.
 +  - Assign the out queue to insert the newly combined spool file with the 'Output Queue' and 'Library' parameters.
 +  - Then add the spool file information for the spool files that will be combined.
 +  - Once evoked, the command will stitch together the spool files and write the new spool file to the destination out queue.
 +
 +<html><pre>
 +                      Join multiple spool files (JOINSPLF)                      
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Output Spool Name  . . . . . . . > JOINTEST01    Character value               
 + Output Queue . . . . . . . . . . > OUT           Name                          
 +   Library  . . . . . . . . . . . >   IDOCS6      Name, *CURLIB                 
 + Selected spool files:                                                          
 +   Spool file name  . . . . . . . > R43500        Name                          
 +   Spool file number  . . . . . . > 000008        1-999999, *ONLY, *LAST, *ANY  
 +   Job name . . . . . . . . . . . > OFDEMOADD     Name, *                       
 +     Job user . . . . . . . . . . >   OFERRER     Name                          
 +     Job number . . . . . . . . . >   184316      000000-999999                 
 +                + for more values                                               
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +</pre></html>                                                                                 
 +<html><pre>
 +                    Specify More Values for Parameter SPLF                      
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Selected spool files:                                                          
 +   Spool file name  . . . . . . . > R43500        Name                          
 +   Spool file number  . . . . . . > 000008        1-999999, *ONLY, *LAST, *ANY  
 +   Job name . . . . . . . . . . . > OFDEMOADD     Name, *                       
 +     Job user . . . . . . . . . . >   OFERRER     Name                          
 +     Job number . . . . . . . . . >   184316      000000-999999                 
 +                                                                                
 +   Spool file name  . . . . . . .   R43500        Name                          
 +   Spool file number  . . . . . .   000033        1-999999, *ONLY, *LAST, *ANY  
 +   Job name . . . . . . . . . . .   OFDEMOADD     Name, *                       
 +     Job user . . . . . . . . . .     OFERRER     Name                          
 +     Job number . . . . . . . . .     184316      000000-999999                 
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                        More... 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys 
 +
 +</pre></html>
 +===== PDFCOMBINE =====
 +
 +Quick utility //(added 6.99 2/03/2022*)// has been created to combine multiple PDF files into one PDF file by specifying multiple PDF file paths into the command’s parameter (EXHIBIT A), __or__ by specifying an IFS directory path in which all the PDF files in the folder will be combined in creation date order (EXHIBIT B). \\
 +* Down-level users can obtain this feature by downloading the following savefile: [[ftp://programmer@ftp.informdecisions.com/ftpRoot/CustomerFTP/iDocs/currentReleases/pdfcombine.zip]] \\
 +After uploading, see a save file PDFCOMBINE.SAVF and ifdjava.jar:
 +  * Put PDFCOMBINE.SAVF into QGPL and restore it, they will see a *CMD object and a *PGM object with same name PDFCOMBINE
 +  * Put ifdjava.jar into /QIBM/UserData/java400/ext or a folder in CLASSPATH
 +\\
 +**(EXHIBIT A)**
 +<html><pre>
 +
 +                       Combine multiple PDFs (PDFCOMBINE)                       
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Input PDF files/Directory path   > '/iview/acmecopy/QSYSPRT2204390000.pdf'     
 +                                                                                
 +                                  > '/iview/acmecopy/QSYSPRT2204390001.pdf'     
 +                                                                                
 +                                  > '/iview/acmecopy/QSYSPRT2204390002.pdf'     
 +                                                                                
 +                                  > '/iview/acmecopy/QSYSPRT2204390003.pdf'     
 +                                                                                
 +                + for more values > '/iview/acmecopy/QSYSPRT2204390004.pdf'     
 +                                                                                
 + Output to PDF file . . . . . . .   '/home/anguyen/pdfcombine.pdf               
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +</pre></html>
 +**(EXHIBIT B)**
 +<html><pre>
 +                       Combine multiple PDFs (PDFCOMBINE)                       
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Input PDF files/Directory path     '/iview/acmecopy'                           
 +                                                                                
 +                + for more values                                               
 +                                                                                
 + Output to PDF file . . . . . . .   '/home/anguyen/pdfcombine.pdf'              
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +                                                                                
 +</pre></html>
 +===== SETPDFPWD =====
 +
 +Quick utility //(added 6.99 8/23/2022)// Apply password and security settings natively on the IBM i to already existing PDF Files on the IFS.
 +
 +Type SETPDFPWD and prompt with F4 to view parameters:
 +<html><pre>
 +                          Set PDF password (SETPDFPWD)                          
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Path to PDF file . . . . . . . .                                               
 +                                                                                
 +                                                                                
 +                                                                                
 + User Password  . . . . . . . . .                                               
 +                                                                                
 +                                                                                
 + Owner Password . . . . . . . . .                                               
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +</pre></html> 
 +**Parameters:**\\                                                                               
 +**Path to PDF file:** This is the location where the PDF file is located on the IFS.  It is also the location where the PDF file will be placed after being processed.  The PDF file will retain the original file name.\\
 +**'User Password:'** This parameter will set the User Password.\\
 +**'Owner Password:'** This parameter will set the Owner Password.\\
 +
 +**How the command works:**\\
 +{{:pub:idocs:setpdfpwd_Password.jpg?600|}}
 +
 +//User Password// will restrict the PDF to be open with the //User Password// value and will restrict the PDF’s security.\\
 +//Owner Password// will restrict the PDF to be open with the //Owner Password// value and will NOT restrict the PDF’s security.\\
 +When both //User Password// and //Owner Password// are used both options will apply.
 +See the example table below for the different configuration options and the expected results.\\
 +Example Table: \\
 +{{:pub:idocs:setpdfpwd_results.jpg?600|}}
 +{{:pub:idocs:setpdfpwd_Security.jpg?600|}}
 +
 +**NOTE:**\\
 +Need to install IFDJAVA.JAR file as of 08/12/2022 \\
 +The SETPDFPWD API must be registered for use.  
 +
 +===== SPLCOMBINE =====
 +
 +Quick utility //(added 6.99 3/11/2022)// has been created to combine all *SCS/*AFPDS spool files in an output queue.
 +<html><pre>
 +                       Combine multiple splfs (SPLCOMBINE)                      
 +                                                                                
 + Type choices, press Enter.                                                     
 +                                                                                
 + Source Output Queue  . . . . . .                 Name                          
 +   Library  . . . . . . . . . . .     *LIBL       Name, *LIBL                   
 + To Output Queue  . . . . . . . .                 Name                          
 +   Library  . . . . . . . . . . .     *LIBL       Name, *LIBL                   
 + To SPLF user data  . . . . . . .                 Character value, *FIRST...    
 + To SPLF form type  . . . . . . .                 Character value, *STD...      
 + To SPLF name . . . . . . . . . .   *FIRST        Name, *FIRST, *LAST           
 + To SPLF Owner  . . . . . . . . .   *CURRENT      Name, *CURRENT, *FIRST        
 + Hold new SPLF  . . . . . . . . .   *NO           *YES, *NO                     
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                                
 +                                                                         Bottom 
 + F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 + F24=More keys                                                                  
 +</pre></html> 
 +                                                                               
 +**Source output queue:** all SCS/​AFPDS in this output queue will be combined into a single spool file and outputted to **'To Output Queue'** with the other spool attributes are specified in **'To' fields**-
 +
 +
 +
 +
 <html>&#091;</html>[[start#idocs | Up to Main Menu ]]<html>&#093;</html> <html>&#091;</html>[[start#idocs | Up to Main Menu ]]<html>&#093;</html>
  
pub/idocsapi.1579711264.txt.gz · Last modified: 2022/06/25 17:02 (external edit)