LOB File Importer¶
The LOB file importer is a tool for loading LOB files into the database during deployment of IFS Cloud. It handles both text files (CLOBs), and binary files (BLOBs). The purpose with this tool is just to import the LOB file into the database, it is up to each owner of the file to transfer it to it's home table.
The Importer Tool¶
Included in the deployment of IFS Cloud, the IFS Installer scans for files to import to the database. The examined folder is the server/lob folder placed in the <build_home>. Meaning, files should be placed in <component>/server/lob/<component> folder in component structure to be imported. Below the component folder, the folder structure is free. The installer imports all files found here. If the extension is.clob, the file is imported as text file. All other extensions are imported as binary files.
The result of the import is logged into a log file
import_lobFiles.log, located in the selected log folder, and in the sub folder named import_<timestamp>.
Transfer to Home Table¶
The files are imported into table
lob_file_import_tab. The purpose of this table is only to have a temporary storage of the lob file during the export. The main columns in the table are:
|file_id||VARCHAR2(100)||Unique, generated identifier of the file|
|task_id||VARCHAR2(100)||Identifier of the import|
|module||VARCHAR2(6)||Owning module of the file. Based on the first folder in the path. Converted to uppercase|
|file_path||VARCHAR2(500)||Sub folder path structure below the folder name. Front slash "/" is always used to separate folders, no matter of which OS used. If the file is placed in the root, a dot "." will be set as file path. This is a way to categories the files.|
|file_name||VARCHAR2(200)||The name of the file|
|file_date||DATE||The file timestamp|
|import_file_text||CLOB||Lob data if it is a text|
|import_file_binary||BLOB||Lob data if it is binary|
|processed||NUMBER||Status column that can be used during transfer to mark progress or to lock a file|
After all files are imported, the IFS Installer calls all methods in the database named
Post_Installation_Import to start transfer the imported lob files from the temporary import table to their home location. Included in this call is an identification id to tell which files that just has been imported. This means, if you have files to import, you shoud also, in a suitable package, write a plsql method named
Post_Installation_Import, which takes
task_id_ VARCHAR2 as argument. This method should fetch the LOB data from
lob_file_import_tab belonging to your component with the provided
task_id_. After the transfer is complete, the record should be deleted from import table.
Lob_File_Import_API contains following tools to handle the transfer:
|get_lob_files||cursor||Public cursor to fetch records based on task_id, component and path|
|lob_file_import_cursor_rec||type||Return record type of the get_lob_files cursor|
|lob_file_import_cursor_tab||type table||Table of the lob_file_import_cursor_rec type, indexed by an integer|
|Delete_File||method||Method to delete a file that has been transfered to home location. Arguments are module_, file_path_, file_name_, task_id_|
|Get_File_Blob||method||Method to fetch blob data of a file. Arguments are module_, file_path_, file_name_, task_id_|
|Get_File_Clob||method||Method to fetch clob data of a file. Arguments are module_, file_path_, file_name_, task_id_|