First available in Profound UI Version 5, Fix Pack 4.0.
The PUI Spooled File Access and Transform Exit (PUISPLEXIT) program provides a way for developers to provide their own custom security and/or spooled file transformation logic. Normally, Profound UI uses the operating system's built-in Host Print Transform functionality to convert spooled files to text to PDF format. With this exit program, however, you can call your own utility to do that transformation. This can be a program you write, or a third party tool. You can also write your own logic to deny spooled files, supplementing the security provided by IBM i. The parameters to this exit program are as follows:
spooled file ID
stream file IFS path
attachment file name
how transform is handled
- Timing Flag - The exit program will be called twice, once before downloading to check authority and/or transform the spooled file, and once after the download for cleanup. This flag will contain a 0 during the "before" call, and a 1 during the "after" call.
Spooled File Id - this is a data structure that identifies the spooled file to be transformed. The data structure is laid out as follows:
jobName - job name portion of the job identifier where the spooled file was created
jobUser - user portion of the job identifier where the spooled file was created
jobNbr - the number portion of the job identifier where the spooled file was created
splfName - file name of spooled file to be transformed
splfNum - spooled file number of spooled file to be transformed
- output type - the type of transformation requested, either 'pdf' or 'txt'.
- stream file IFS path - on first input this will be a unique temporary filename. You should transform the spooled file to a file with this name. You can change the name if you'd like to override the location.
- attachment file name - this is the name of the filename that will be sent to the browser. If the user saves the spooled file, this will be the filename that is suggested.
- content type - controls the file type that the user uses when transforming the spooled file. On input, this will be 'text/plain' for text file or 'application/pdf' for a PDF file. You can override these values by changing this parameter.
- how transform is handled - the exit program can set this to control how the spooled file is to be handled. Use 0 to signify that access to the spooled file should be denied, 1 means that Profound UI should handle the trasnformation (default), or 2 means that the exit program has done the transformation. Only if this parameter is changed to a 2 will Profound UI use your transformed spooled file or call again with timingFlag=1.
Profound Logic ships a source member named PUISPLEXIT in the QRPGLESRC file that comes with the product. Inside, you'll find an exit program that has all of the parameter definitions already defined. You can use this as a starting point for developing your own exit program. If compiled without changes, the sample exit program will set the "how transform is handled" value to 1, letting Profound UI handle the transformation, the same as if you had not provided an exit program. A sample source member named SPL2TEXT shows a modified version of this exit program that handles it's own transformation to text format, but lets Profound UI handle the transformation to PDF as an example of one way to write an exit program.
The customer exit program object will not be modified or replaced during a product update installation however the PUIDNLEXIT and SPL2TEXT source members will be overwritten with an update. We recommend saving your source member into a different library.