Solved

Unable to Read Shared Repository Document Attachment Contents as BLOB Values

  • 15 April 2022
  • 4 replies
  • 246 views

Userlevel 5
Badge +9

Hi All,

If we copy a file that was saved to an external shared repository, and we place that copy in a folder that is located on the database server, the DBMS_LOB procedures in our process are able to read the file contents as BLOB values and add their contents to the outgoing JSON. But that was failed or have required manual preparation


We need help to handle files in a Repository that is not located on the database server.
Someone with tech background that can help to explain this functionality .
Or if this external repository handling is a limitation, Please let us know.

 

Thanks & Best Regards,

Nipun
 

icon

Best answer by Mathias Dahl 20 April 2022, 10:38

View original

4 replies

Userlevel 7
Badge +30

Hi Nipun,

You need to explain in more detail what you are trying to do and what you have tried. It's not clear.

Thanks!

Userlevel 5
Badge +9

Hi @sajithmendis ,

 

Could you please explain the issue in more detail?

 

Thanks & Best Regards,

Nipun

Userlevel 3
Badge +6

@Mathias Dahl  - The customer upgraded from APP8 to APP10.  They use MWO.  Here is their initial issue from case G2317758:

 “Our database process that gathers and sends work task information as a JSON document to IndySoft (the external system now used by our Field Service technicians) is unable to read the contents of files from any Document Repository that is not located on the database server.

While we have set up a new repository that is located on the database server, there are many existing document attachments from before our IFS10 upgrade that need to be sent with task information, but are saved in a repository on a different machine. All attempts to get the document contents to add to the outgoing JSON have failed or have required manual preparation that we cannot ask our office personnel to perform before running the procedure.”

In addition, they say:

“Attempt to run the following sql in the Production database, which attempts to read file contents from one of the shared repositories:

select mac_work_order_api.loadBlobFromFile2('MWO_DOC-1001083-1-A1-1.PDF','MAC_HIST_WO_DIR') from dual

If successful, the select will return a single BLOB value representing the Base64 encoding of the PDF file. As of now, that select will return error ORA-22288.  Unless we follow the process detailed in the workaround section for a given document from one of the external shared repositories, the file will not be read by the DBMS_LOB functions in our process.”

Userlevel 7
Badge +30

Thanks!

You could try to use Batch_Transfer_Handler_Api.Read_From_Shared to get the file from a shared repository to a temporary folder on the application server, then upload the file to the database repository, then use the current code. You can find examples on how it is used in Edm_File_API, where we use it to move files between document repositories.

Or use the Change Document Repository assistant to move document files into the Database repository.

Note: this is really an "internal" API, and is therefore used on your own risk. We do not support other uses than what Docman needs internally. The API might also break at any time, if we need to change it for some reason.

Also, the approach might not work in IFS Cloud.

Good luck!
 

Reply