How to locate attachments in my Agile server

Hello –

I have Agile PLM, and we are working on an IT project to map our homegrown web portal to our controlled documents. I’d like to be able to press a button on this web portal, and it automatically opens the attachment which is stored and controlled in Agile. We don’t have an issue with creating the button or mapping the part in question on the web portal to Agile. My issue is just being unable to determine how to obtain the link to the attachment or source. I understand the part has an attachment, which is also related to a folder object in Agile.

Currently, we are downloading the attachments from Agile, storing them in a network directory and then mapping our web portal to that network directory. It seems redundant and error prone. It creates silly issues

Thanks,
Nick

Add Comment
3 Answer(s)
Best answer

It is not quite easy. Attachments are linked to business objects using ATTACHMENT_MAP. PARENT_ID is the ID for the object, and PARENT_C LASS is the class ID, and lets the server know where to go to get other information, if needed. FILE_ID is the ID of the actual file, and can be linked directly to the FILES table. That very same ID is used in the file name in the vault, as well as for which sub-directory it is located in. Agile uses the ID in the file name because it helps in anonymizing the file itself (keeping those pesky engineers from editing it without going through the PLM system) and as a simple unique-ness element. The directory where the file is located can be determined by doing the following : 1) convert the file ID to a string; 2) remove 2 rightmost digits, and zero-pad on left to 9 digits total; 3) file directory will then be “<root>/<digits 1-3>/<digits 4-6>/<digits 7-9>/”.
 An example for a text file would be ID = 3579812. Trim and zero-pad gives “000035798”. So the directory would be filevault/000/035/798/agile3579812.txt.
 If you can get the distinct ID for a file, you can then find it and read/copy it from the file vault. I am not certain that getting that ID is easy to do, as it is not a visible attribute by any means. If the API can retrieve that value, you  should be good. Then again, if the API can get the file ID, it can easily get the file itself for you (see below).
 Note that FILE_ID does not always have a value in the ATTACHMENT_MAP table. In that case, you have to link ATTACHMENT_MAP.LATEST_VSN to VERSION_FILE_MAP.VERSION_ID, and retrieve the corresponding FILE_ID value from VERSION_FILE_MAP.

 All of this depends on being able to query the database directly, get the necessary ID values, and then figuring out the file name and location so it can be copied out. You might be best served by writing a PX that uses the Agile API to do that for you – all you need to do is supply the document number, and it copies the file(s) for the latest revision to a temp directory where it can be opened for review by the web portal.     ???

Agile Angel Answered on June 8, 2016.
Add Comment

Hi Kevin –

Thank you for such a detailed response. I’ll make some great progress with your advice. I’ll inquiry some more if and when I get stuck again.

Thanks

Nick

Agile User Answered on June 9, 2016.
Add Comment

use Corewebservices for file export and entice in your portal.

Regards,
Paritosh

Agile Angel Answered on June 13, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.