Skip to main content
Solved

Unable to Read Shared Repository Document Attachment Contents as BLOB Values


Nipun Gunaratne
Sidekick (Employee)
Forum|alt.badge.img+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
 

Best answer by Mathias Dahl

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!
 

View original
Did this topic help you find an answer to your question?

4 replies

Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2810 replies
  • April 15, 2022

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!


Nipun Gunaratne
Sidekick (Employee)
Forum|alt.badge.img+9
  • Author
  • Sidekick (Employee)
  • 55 replies
  • April 18, 2022

Hi @sajithmendis ,

 

Could you please explain the issue in more detail?

 

Thanks & Best Regards,

Nipun


cmdriordan
Sidekick (Employee)
Forum|alt.badge.img+7
  • Sidekick (Employee)
  • 14 replies
  • April 19, 2022

@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.”


Mathias Dahl
Superhero (Employee)
Forum|alt.badge.img+32
  • Superhero (Employee)
  • 2810 replies
  • Answer
  • April 20, 2022

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings