The following is intended to outline my experience and exposure to PeopleSoft’s Technologies. This is not a training document. References in this blog have been compiled from various sources like Oracle webcasts, blogs, and prototypes that I have developed over time.
Monday, March 6, 2023
Mass upload/download files
Monday, February 20, 2023
Peoplecode to zip/archive files
Following is a way to archive, compress or zip up files via peoplecode. Alternative would be to use command line calls to products like winzip, 7-zip etc. For this test I am running PT 8.59.x. The same should also be possible in slightly older Peopletools releases too, like PT 8.56.x
Oracle provides java classes that can be used for this task. This method will create a new archive file and add files to the root location of the archive or zip file.
The solution uses the following three java classes that are delivered with PeopleTools
1. java.io.FileOutputStream
2. java.util.zip.ZipOutputStream
3. java.util.zip.ZipEntry
Local JavaObject &myArchive = CreateJavaObject("java.util.zip.ZipOutputStream", CreateJavaObject("java.io.FileOutputStream", &zipFileName, True));
In the above line of code &zipFileName is the complete path of the archive file that we will create.
&fileNametoAdd - will have the complete path to the file that we will be adding to the archive.
In order to get the filename value from the file path do the following.
&fname = &FilePath [&FilePath.Len];