How to download attached files in the Dataset by Teamcenter connector

0
Hi, Buddies I’m struggling to get attached files in the dataset from Teamcenter. Q1) What is the best approach to retrieve dataset instance? Assuming that the UID or ID or Name of the dataset is given. Q2) I need a URL to display the downloaded file. It is actually a JT file and to be displayed in the VisWeb widget. The widget requires a URL not binary. Where can I get the URL? The dataset download widget returns an only boolean value, not URL. https://drive.google.com/file/d/13tOFF4nYEGJK0-WQRxegjHT-agEEUc4c/preview Thank you in advance :)
asked
2 answers
0

Hello YONGPYO JANG,

First you have to create object for dataset , where you can pass the respective dataset uid as the input,

then create the model object and add it to the list , The object which you created in the beginning you can able to retrieve it as a filedocument….

 

 

answered
0

Hi Jang,

regarding the second half of your question (getting a URL for a FileDocument instead of the binary contents) the following strategy may be an option:

  • FileID is an attribute of the FileDocument entity. Get the FileID number for the relevant FileDocument object (e.g. 18)
  • Use the “file” API directly to access the file constructing the URL in the following format https://[AppDomain]/file?FileID=[FileIDNumber] (e.g. https://yourappname.yourdomain.com/file?FileID=18 )

 

Some restriction may apply, for example I wasn’t able to effectively use this approach with the Video Player widget, but it may work for you.

I hope this may help.

answered